static void read_gen_name(int fd, char *dirname, char *buf)
{
int dlen;
- int len = read_byte(fd);
-
- if (len & 0x80) {
-#if MAXPATHLEN > 32767
- uchar lenbuf[2];
- read_buf(fd, (char *)lenbuf, 2);
- len = (len & ~0x80) * 0x10000 + lenbuf[0] * 0x100 + lenbuf[1];
-#else
- len = (len & ~0x80) * 0x100 + read_byte(fd);
-#endif
- }
if (dirname) {
dlen = strlcpy(buf, dirname, MAXPATHLEN);
} else
dlen = 0;
- if (dlen + len >= MAXPATHLEN) {
- rprintf(FERROR, "bogus data on generator name pipe\n");
- exit_cleanup(RERR_PROTOCOL);
- }
-
- read_sbuf(fd, buf + dlen, len);
+ read_vstring(fd, buf + dlen, MAXPATHLEN - dlen);
}
int see_item = itemizing && (iflags || verbose > 1);
if (am_server) {
if (am_daemon && !dry_run && see_item)
- log_recv(file, &stats, iflags);
+ log_item(file, &stats, iflags, NULL);
} else if (see_item || iflags & ITEM_UPDATING
|| (S_ISDIR(file->mode)
&& iflags & ITEM_REPORT_TIME))
- log_recv(file, &stats, iflags);
+ log_item(file, &stats, iflags, NULL);
continue;
}
} else
if (dry_run) { /* log the transfer */
if (!am_server && log_format)
- log_recv(file, &stats, iflags);
+ log_item(file, &stats, iflags, NULL);
continue;
}
/* log the transfer */
if (log_before_transfer)
- log_recv(file, &initial_stats, iflags);
+ log_item(file, &initial_stats, iflags, NULL);
else if (!am_server && verbose && do_progress)
rprintf(FINFO, "%s\n", safe_fname(fname));
fname, fd2, file->length);
if (!log_before_transfer)
- log_recv(file, &initial_stats, iflags);
+ log_item(file, &initial_stats, iflags, NULL);
if (fd1 != -1)
close(fd1);