MCPcopy Create free account
hub / github.com/RsyncProject/rsync / send_file_list

Function send_file_list

flist.c:2227–2594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2225}
2226
2227struct file_list *send_file_list(int f, int argc, char *argv[])
2228{
2229 static const char *lastdir;
2230 static int lastdir_len = -1;
2231 int len, dirlen;
2232 STRUCT_STAT st = {0};
2233 char *p, *dir;
2234 struct file_list *flist;
2235 struct timeval start_tv, end_tv;
2236 int64 start_write;
2237 int use_ff_fd = 0;
2238 int disable_buffering, reenable_multiplex = -1;
2239 int flags = recurse ? FLAG_CONTENT_DIR : 0;
2240 int reading_remotely = filesfrom_host != NULL;
2241 int rl_flags = (reading_remotely ? 0 : RL_DUMP_COMMENTS)
2242#ifdef ICONV_OPTION
2243 | (filesfrom_convert ? RL_CONVERT : 0)
2244#endif
2245 | (eol_nulls || reading_remotely ? RL_EOL_NULLS : 0);
2246 int implied_dot_dir = 0;
2247
2248 rprintf(FLOG, "building file list\n");
2249 if (show_filelist_progress)
2250 start_filelist_progress("building file list");
2251 else if (inc_recurse && INFO_GTE(FLIST, 1) && !am_server)
2252 rprintf(FCLIENT, "sending incremental file list\n");
2253
2254 start_write = stats.total_written;
2255 gettimeofday(&start_tv, NULL);
2256
2257 if (relative_paths && protocol_version >= 30)
2258 implied_dirs = 1; /* We send flagged implied dirs */
2259
2260#ifdef SUPPORT_HARD_LINKS
2261 if (preserve_hard_links && protocol_version >= 30 && !cur_flist)
2262 init_hard_links();
2263#endif
2264
2265 flist = cur_flist = flist_new(0, "send_file_list");
2266 flist_expand(flist, FLIST_START_LARGE);
2267 if (inc_recurse) {
2268 dir_flist = flist_new(FLIST_TEMP, "send_file_list");
2269 flist_expand(dir_flist, FLIST_START_LARGE);
2270 flags |= FLAG_DIVERT_DIRS;
2271 } else
2272 dir_flist = cur_flist;
2273
2274 disable_buffering = io_start_buffering_out(f);
2275 if (filesfrom_fd >= 0) {
2276 if (argv[0] && !change_dir(argv[0], CD_NORMAL)) {
2277 rsyserr(FERROR_XFER, errno, "change_dir %s failed",
2278 full_fname(argv[0]));
2279 exit_cleanup(RERR_FILESELECT);
2280 }
2281 if (protocol_version < 31) {
2282 /* Older protocols send the files-from data w/o packaging
2283 * it in multiplexed I/O packets, so temporarily switch
2284 * to buffered I/O to match this behavior. */

Callers 2

do_server_senderFunction · 0.85
client_runFunction · 0.85

Calls 15

start_filelist_progressFunction · 0.85
init_hard_linksFunction · 0.85
flist_newFunction · 0.85
flist_expandFunction · 0.85
io_start_buffering_outFunction · 0.85
change_dirFunction · 0.85
full_fnameFunction · 0.85
io_end_multiplex_inFunction · 0.85
read_lineFunction · 0.85
sanitize_pathFunction · 0.85
strlcpyFunction · 0.85
clean_fnameFunction · 0.85

Tested by

no test coverage detected