Lines Matching refs:sbuf
229 static int write_data_file(int fd, const char *path, syncsendbuf *sbuf, int show_progress)
251 sbuf->id = ID_DATA;
255 ret = adb_read(lfd, sbuf->data, SYNC_DATA_MAX);
266 sbuf->size = htoll(ret);
267 if(writex(fd, sbuf, sizeof(unsigned) * 2 + ret)){
282 static int write_data_buffer(int fd, char* file_buffer, int size, syncsendbuf *sbuf,
288 sbuf->id = ID_DATA;
295 memcpy(sbuf->data, &file_buffer[total], count);
296 sbuf->size = htoll(count);
297 if(writex(fd, sbuf, sizeof(unsigned) * 2 + count)){
313 static int write_data_link(int fd, const char *path, syncsendbuf *sbuf)
317 len = readlink(path, sbuf->data, SYNC_DATA_MAX-1);
322 sbuf->data[len] = '\0';
324 sbuf->size = htoll(len + 1);
325 sbuf->id = ID_DATA;
327 ret = writex(fd, sbuf, sizeof(unsigned) * 2 + len + 1);
342 syncsendbuf *sbuf = &send_buffer;
363 write_data_buffer(fd, file_buffer, size, sbuf, show_progress);
366 write_data_file(fd, lpath, sbuf, show_progress);
369 write_data_link(fd, lpath, sbuf);
386 if(readx(fd, sbuf->data, len)) {
389 sbuf->data[len] = 0;
391 strcpy(sbuf->data, "unknown reason");
393 fprintf(stderr,"failed to copy '%s' to '%s': %s\n", lpath, rpath, sbuf->data);