blob: 00b60c94df8b90ae7aca512fecaba324779c4d7b [file] [log] [blame]
J.W. Schultze6e3f122003-08-15 00:57:27 +00001/*
Andrew Tridgell2f03f951998-07-25 02:25:22 +00002 Copyright (C) Andrew Tridgell 1996
3 Copyright (C) Paul Mackerras 1996
J.W. Schultze6e3f122003-08-15 00:57:27 +00004
Andrew Tridgell2f03f951998-07-25 02:25:22 +00005 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
J.W. Schultze6e3f122003-08-15 00:57:27 +00009
Andrew Tridgell2f03f951998-07-25 02:25:22 +000010 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
J.W. Schultze6e3f122003-08-15 00:57:27 +000014
Andrew Tridgell2f03f951998-07-25 02:25:22 +000015 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18*/
19
20#include "rsync.h"
21
22extern int verbose;
Wayne Davisona0545702005-04-09 18:59:57 +000023extern int do_xfers;
Wayne Davison8715db22005-02-20 00:16:23 +000024extern int am_server;
25extern int am_daemon;
Wayne Davison8a9cfb22005-02-16 08:10:41 +000026extern int log_before_transfer;
Wayne Davison7f371672005-02-19 22:16:50 +000027extern int log_format_has_i;
28extern int daemon_log_format_has_i;
Andrew Tridgell2f03f951998-07-25 02:25:22 +000029extern int csum_length;
Andrew Tridgell2f03f951998-07-25 02:25:22 +000030extern int io_error;
Wayne Davison605fed42005-05-19 08:52:24 +000031extern int allowed_lull;
Wayne Davisond6631cf2004-01-15 08:56:33 +000032extern int protocol_version;
Wayne Davison95306d92005-02-20 01:04:54 +000033extern int remove_sent_files;
Wayne Davison53f85192005-01-17 23:11:26 +000034extern int updating_basis_file;
Wayne Davison8b115ac2004-09-07 21:32:36 +000035extern int make_backups;
Wayne Davison8a9cfb22005-02-16 08:10:41 +000036extern int do_progress;
Wayne Davison53f85192005-01-17 23:11:26 +000037extern int inplace;
Wayne Davisona0545702005-04-09 18:59:57 +000038extern int batch_fd;
39extern int write_batch;
Wayne Davisona3221d22004-07-16 20:06:24 +000040extern struct stats stats;
Wayne Davison5f406152005-03-04 15:57:14 +000041extern struct file_list *the_file_list;
Wayne Davison8715db22005-02-20 00:16:23 +000042extern char *log_format;
Andrew Tridgell2f03f951998-07-25 02:25:22 +000043
44
Martin Pool0f9c48b2002-04-08 08:34:03 +000045/**
46 * @file
47 *
48 * The sender gets checksums from the generator, calculates deltas,
49 * and transmits them to the receiver. The sender process runs on the
50 * machine holding the source files.
51 **/
J.W. Schultzfc0257c2003-04-10 01:13:30 +000052
Martin Poolce8149b2002-04-09 06:03:50 +000053/**
54 * Receive the checksums for a buffer
55 **/
Andrew Tridgell2f03f951998-07-25 02:25:22 +000056static struct sum_struct *receive_sums(int f)
57{
58 struct sum_struct *s;
Wayne Davisona1cbe762005-02-14 22:47:42 +000059 int32 i;
Wayne Davison605fed42005-05-19 08:52:24 +000060 int lull_mod = allowed_lull * 5;
Andrew Tridgell2f03f951998-07-25 02:25:22 +000061 OFF_T offset = 0;
62
Wayne Davisona3221d22004-07-16 20:06:24 +000063 if (!(s = new(struct sum_struct)))
64 out_of_memory("receive_sums");
Andrew Tridgell2f03f951998-07-25 02:25:22 +000065
J.W. Schultzfc0257c2003-04-10 01:13:30 +000066 read_sum_head(f, s);
67
Andrew Tridgell2f03f951998-07-25 02:25:22 +000068 s->sums = NULL;
69
Wayne Davisonda9d12f2004-01-03 18:37:41 +000070 if (verbose > 3) {
Wayne Davison6c495e02005-01-01 21:08:17 +000071 rprintf(FINFO, "count=%.0f n=%ld rem=%ld\n",
72 (double)s->count, (long)s->blength, (long)s->remainder);
Wayne Davisonda9d12f2004-01-03 18:37:41 +000073 }
Andrew Tridgell2f03f951998-07-25 02:25:22 +000074
J.W. Schultze6e3f122003-08-15 00:57:27 +000075 if (s->count == 0)
Andrew Tridgell2f03f951998-07-25 02:25:22 +000076 return(s);
77
Wayne Davisona3221d22004-07-16 20:06:24 +000078 if (!(s->sums = new_array(struct sum_buf, s->count)))
79 out_of_memory("receive_sums");
Andrew Tridgell2f03f951998-07-25 02:25:22 +000080
Wayne Davisoneed47b62005-02-11 20:46:55 +000081 for (i = 0; i < s->count; i++) {
Andrew Tridgell2f03f951998-07-25 02:25:22 +000082 s->sums[i].sum1 = read_int(f);
J.W. Schultze6e3f122003-08-15 00:57:27 +000083 read_buf(f, s->sums[i].sum2, s->s2length);
Andrew Tridgell2f03f951998-07-25 02:25:22 +000084
85 s->sums[i].offset = offset;
Wayne Davisona3221d22004-07-16 20:06:24 +000086 s->sums[i].flags = 0;
Andrew Tridgell2f03f951998-07-25 02:25:22 +000087
Wayne Davisoneed47b62005-02-11 20:46:55 +000088 if (i == s->count-1 && s->remainder != 0)
Andrew Tridgell2f03f951998-07-25 02:25:22 +000089 s->sums[i].len = s->remainder;
Wayne Davisona3221d22004-07-16 20:06:24 +000090 else
J.W. Schultzfc0257c2003-04-10 01:13:30 +000091 s->sums[i].len = s->blength;
Andrew Tridgell2f03f951998-07-25 02:25:22 +000092 offset += s->sums[i].len;
93
Wayne Davison605fed42005-05-19 08:52:24 +000094 if (allowed_lull && !(i % lull_mod))
95 maybe_send_keepalive();
96
Wayne Davisona3221d22004-07-16 20:06:24 +000097 if (verbose > 3) {
98 rprintf(FINFO,
99 "chunk[%d] len=%d offset=%.0f sum1=%08x\n",
100 i, s->sums[i].len, (double)s->sums[i].offset,
101 s->sums[i].sum1);
102 }
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000103 }
104
105 s->flength = offset;
106
107 return s;
108}
109
Wayne Davison5f406152005-03-04 15:57:14 +0000110void successful_send(int ndx)
Wayne Davison95306d92005-02-20 01:04:54 +0000111{
112 char fname[MAXPATHLEN];
113 struct file_struct *file;
114 unsigned int offset;
115
Wayne Davison5f406152005-03-04 15:57:14 +0000116 if (ndx < 0 || ndx >= the_file_list->count)
Wayne Davison95306d92005-02-20 01:04:54 +0000117 return;
118
Wayne Davison5f406152005-03-04 15:57:14 +0000119 file = the_file_list->files[ndx];
Wayne Davison95306d92005-02-20 01:04:54 +0000120 /* The generator might tell us about symlinks we didn't send. */
121 if (!(file->flags & FLAG_SENT) && !S_ISLNK(file->mode))
122 return;
123 if (file->dir.root) {
124 offset = stringjoin(fname, sizeof fname,
125 file->dir.root, "/", NULL);
126 } else
127 offset = 0;
128 f_name_to(file, fname + offset);
129 if (remove_sent_files && do_unlink(fname) == 0 && verbose > 1) {
130 rprintf(FINFO, "sender removed %s\n",
131 safe_fname(fname + offset));
132 }
133}
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000134
Wayne Davison927c8062005-03-13 05:34:00 +0000135static void write_ndx_and_attrs(int f_out, int ndx, int iflags,
136 uchar fnamecmp_type, char *buf, int len)
Wayne Davison4d53c4d2005-03-09 18:54:19 +0000137{
138 write_int(f_out, ndx);
139 if (protocol_version < 29)
140 return;
141 write_shortint(f_out, iflags);
142 if (iflags & ITEM_BASIS_TYPE_FOLLOWS)
143 write_byte(f_out, fnamecmp_type);
Wayne Davison927c8062005-03-13 05:34:00 +0000144 if (iflags & ITEM_XNAME_FOLLOWS)
Wayne Davison4d53c4d2005-03-09 18:54:19 +0000145 write_vstring(f_out, buf, len);
Wayne Davison4d53c4d2005-03-09 18:54:19 +0000146}
147
Wayne Davison165e6d42005-03-04 16:53:26 +0000148/* This is also used by receive.c with f_out = -1. */
Wayne Davison6087ef22005-03-10 00:05:58 +0000149int read_item_attrs(int f_in, int f_out, int ndx, uchar *type_ptr,
150 char *buf, int *len_ptr)
Wayne Davison165e6d42005-03-04 16:53:26 +0000151{
Wayne Davisonfad3dc42005-03-05 00:21:59 +0000152 int len;
Wayne Davison4d53c4d2005-03-09 18:54:19 +0000153 uchar fnamecmp_type = FNAMECMP_FNAME;
Wayne Davison165e6d42005-03-04 16:53:26 +0000154 int iflags = protocol_version >= 29 ? read_shortint(f_in)
Wayne Davisonfad3dc42005-03-05 00:21:59 +0000155 : ITEM_TRANSFER | ITEM_MISSING_DATA;
Wayne Davison165e6d42005-03-04 16:53:26 +0000156
157 /* Handle the new keep-alive (no-op) packet. */
158 if (ndx == the_file_list->count && iflags == ITEM_IS_NEW)
159 ;
160 else if (ndx < 0 || ndx >= the_file_list->count) {
Wayne Davison927c8062005-03-13 05:34:00 +0000161 rprintf(FERROR, "Invalid file index: %d (count=%d) [%s]\n",
Wayne Davison165e6d42005-03-04 16:53:26 +0000162 ndx, the_file_list->count, who_am_i());
163 exit_cleanup(RERR_PROTOCOL);
164 } else if (iflags == ITEM_IS_NEW) {
Wayne Davison927c8062005-03-13 05:34:00 +0000165 rprintf(FERROR, "Invalid itemized flag word: %x [%s]\n",
166 iflags, who_am_i());
Wayne Davison165e6d42005-03-04 16:53:26 +0000167 exit_cleanup(RERR_PROTOCOL);
168 }
169
Wayne Davison4d53c4d2005-03-09 18:54:19 +0000170 if (iflags & ITEM_BASIS_TYPE_FOLLOWS)
171 fnamecmp_type = read_byte(f_in);
172 *type_ptr = fnamecmp_type;
173
174 if (iflags & ITEM_XNAME_FOLLOWS) {
175 if ((len = read_vstring(f_in, buf, MAXPATHLEN)) < 0)
176 exit_cleanup(RERR_PROTOCOL);
177 } else {
Wayne Davisonfad3dc42005-03-05 00:21:59 +0000178 *buf = '\0';
179 len = -1;
180 }
Wayne Davison6087ef22005-03-10 00:05:58 +0000181 *len_ptr = len;
Wayne Davison85aa57a2005-03-04 18:01:16 +0000182
Wayne Davisonfad3dc42005-03-05 00:21:59 +0000183 if (iflags & ITEM_TRANSFER) {
184 if (!S_ISREG(the_file_list->files[ndx]->mode)) {
185 rprintf(FERROR,
Wayne Davison927c8062005-03-13 05:34:00 +0000186 "received request to transfer non-regular file: %d [%s]\n",
Wayne Davisonfad3dc42005-03-05 00:21:59 +0000187 ndx, who_am_i());
188 exit_cleanup(RERR_PROTOCOL);
189 }
190 } else if (f_out >= 0) {
Wayne Davison11290702005-03-15 19:19:44 +0000191 write_ndx_and_attrs(f_out, ndx, iflags,
Wayne Davison927c8062005-03-13 05:34:00 +0000192 fnamecmp_type, buf, len);
Wayne Davison165e6d42005-03-04 16:53:26 +0000193 }
194
195 return iflags;
196}
197
J.W. Schultze6e3f122003-08-15 00:57:27 +0000198void send_files(struct file_list *flist, int f_out, int f_in)
199{
Martin Poolc1659c72001-08-31 09:27:35 +0000200 int fd = -1;
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000201 struct sum_struct *s;
Wayne Davison41cc97a2004-05-11 19:53:16 +0000202 struct map_struct *mbuf = NULL;
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000203 STRUCT_STAT st;
Wayne Davisonecc81fc2004-07-26 16:36:59 +0000204 char *fname2, fname[MAXPATHLEN];
Wayne Davison6087ef22005-03-10 00:05:58 +0000205 char xname[MAXPATHLEN];
Wayne Davison4d53c4d2005-03-09 18:54:19 +0000206 uchar fnamecmp_type;
Wayne Davison6087ef22005-03-10 00:05:58 +0000207 int iflags, xlen;
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000208 struct file_struct *file;
Wayne Davison11290702005-03-15 19:19:44 +0000209 int phase = 0, max_phase = protocol_version >= 29 ? 2 : 1;
Andrew Tridgell1b7c47c1998-11-02 04:17:56 +0000210 struct stats initial_stats;
Wayne Davison8b115ac2004-09-07 21:32:36 +0000211 int save_make_backups = make_backups;
Wayne Davison7f371672005-02-19 22:16:50 +0000212 int itemizing = am_daemon ? daemon_log_format_has_i
213 : !am_server && log_format_has_i;
Wayne Davisona0545702005-04-09 18:59:57 +0000214 int f_xfer = write_batch < 0 ? batch_fd : f_out;
Wayne Davison8a9cfb22005-02-16 08:10:41 +0000215 int i, j;
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000216
217 if (verbose > 2)
J.W. Schultze6e3f122003-08-15 00:57:27 +0000218 rprintf(FINFO, "send_files starting\n");
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000219
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000220 while (1) {
Wayne Davison3fef5362004-01-22 04:38:18 +0000221 unsigned int offset;
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000222
223 i = read_int(f_in);
224 if (i == -1) {
Wayne Davison11290702005-03-15 19:19:44 +0000225 if (++phase > max_phase)
Wayne Davison8b48bf12005-03-15 17:30:56 +0000226 break;
Wayne Davison8b48bf12005-03-15 17:30:56 +0000227 csum_length = SUM_LENGTH;
228 if (verbose > 2)
229 rprintf(FINFO, "send_files phase=%d\n", phase);
230 write_int(f_out, -1);
231 /* For inplace: redo phase turns off the backup
232 * flag so that we do a regular inplace send. */
233 make_backups = 0;
234 continue;
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000235 }
236
Wayne Davisone732fb02005-04-14 01:45:47 +0000237 iflags = read_item_attrs(f_in, f_out, i, &fnamecmp_type,
Wayne Davison6087ef22005-03-10 00:05:58 +0000238 xname, &xlen);
Wayne Davison165e6d42005-03-04 16:53:26 +0000239 if (iflags == ITEM_IS_NEW) /* no-op packet */
240 continue;
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000241
Wayne Davison8a9cfb22005-02-16 08:10:41 +0000242 file = flist->files[i];
Wayne Davison7f371672005-02-19 22:16:50 +0000243 if (file->dir.root) {
244 /* N.B. We're sure that this fits, so offset is OK. */
245 offset = strlcpy(fname, file->dir.root, sizeof fname);
246 if (!offset || fname[offset-1] != '/')
247 fname[offset++] = '/';
248 } else
249 offset = 0;
250 fname2 = f_name_to(file, fname + offset);
251
252 if (verbose > 2)
253 rprintf(FINFO, "send_files(%d, %s)\n", i, fname);
Wayne Davison8a9cfb22005-02-16 08:10:41 +0000254
Wayne Davisonfad3dc42005-03-05 00:21:59 +0000255 if (!(iflags & ITEM_TRANSFER)) {
Wayne Davison6087ef22005-03-10 00:05:58 +0000256 maybe_log_item(file, iflags, itemizing, xname);
Wayne Davison165e6d42005-03-04 16:53:26 +0000257 continue;
258 }
Wayne Davison11290702005-03-15 19:19:44 +0000259 if (phase == 2) {
260 rprintf(FERROR,
261 "got transfer request in phase 2 [%s]\n",
262 who_am_i());
263 exit_cleanup(RERR_PROTOCOL);
264 }
Wayne Davison8a9cfb22005-02-16 08:10:41 +0000265
Wayne Davison6087ef22005-03-10 00:05:58 +0000266 updating_basis_file = inplace && (protocol_version >= 29
267 ? fnamecmp_type == FNAMECMP_FNAME : !make_backups);
Wayne Davisonb951e022005-01-24 17:19:04 +0000268
Wayne Davison97feb552004-01-13 18:22:43 +0000269 stats.current_file_index = i;
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000270 stats.num_transferred_files++;
271 stats.total_transferred_size += file->length;
272
Wayne Davisona0545702005-04-09 18:59:57 +0000273 if (!do_xfers) { /* log the transfer */
Wayne Davison8a832462005-02-16 17:02:16 +0000274 if (!am_server && log_format)
Wayne Davisonb694f8a2005-03-04 16:08:02 +0000275 log_item(file, &stats, iflags, NULL);
Wayne Davisone732fb02005-04-14 01:45:47 +0000276 write_ndx_and_attrs(f_out, i, iflags, fnamecmp_type,
Wayne Davison927c8062005-03-13 05:34:00 +0000277 xname, xlen);
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000278 continue;
279 }
280
Andrew Tridgell1b7c47c1998-11-02 04:17:56 +0000281 initial_stats = stats;
282
Wayne Davisonefa95a12004-07-20 21:35:46 +0000283 if (!(s = receive_sums(f_in))) {
Wayne Davison06c28402003-12-15 08:10:31 +0000284 io_error |= IOERR_GENERAL;
J.W. Schultze6e3f122003-08-15 00:57:27 +0000285 rprintf(FERROR, "receive_sums failed\n");
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000286 return;
287 }
Martin Pool76f79ba2002-01-23 05:51:06 +0000288
Wayne Davisonb9f592f2004-07-15 02:20:08 +0000289 fd = do_open(fname, O_RDONLY, 0);
290 if (fd == -1) {
291 if (errno == ENOENT) {
292 enum logcode c = am_daemon
293 && protocol_version < 28 ? FERROR
294 : FINFO;
295 io_error |= IOERR_VANISHED;
296 rprintf(c, "file has vanished: %s\n",
297 full_fname(fname));
298 } else {
Wayne Davison06c28402003-12-15 08:10:31 +0000299 io_error |= IOERR_GENERAL;
Wayne Davisonb9f592f2004-07-15 02:20:08 +0000300 rsyserr(FERROR, errno,
301 "send_files failed to open %s",
302 full_fname(fname));
Martin Poolc1659c72001-08-31 09:27:35 +0000303 }
Wayne Davisonb9f592f2004-07-15 02:20:08 +0000304 free_sums(s);
305 continue;
Martin Pool6902ed12001-08-14 02:04:47 +0000306 }
J.W. Schultze6e3f122003-08-15 00:57:27 +0000307
Wayne Davisonb9f592f2004-07-15 02:20:08 +0000308 /* map the local file */
309 if (do_fstat(fd, &st) != 0) {
310 io_error |= IOERR_GENERAL;
311 rsyserr(FERROR, errno, "fstat failed");
312 free_sums(s);
313 close(fd);
314 return;
315 }
316
Wayne Davison96d910c2004-08-03 08:05:27 +0000317 if (st.st_size) {
Wayne Davison9b919d52005-01-17 22:51:29 +0000318 int32 read_size = MAX(s->blength * 3, MAX_MAP_SIZE);
319 mbuf = map_file(fd, st.st_size, read_size, s->blength);
Wayne Davison96d910c2004-08-03 08:05:27 +0000320 } else
321 mbuf = NULL;
Wayne Davisonb9f592f2004-07-15 02:20:08 +0000322
323 if (verbose > 2) {
324 rprintf(FINFO, "send_files mapped %s of size %.0f\n",
Wayne Davisonecc81fc2004-07-26 16:36:59 +0000325 safe_fname(fname), (double)st.st_size);
Wayne Davisonb9f592f2004-07-15 02:20:08 +0000326 }
327
Wayne Davisone732fb02005-04-14 01:45:47 +0000328 write_ndx_and_attrs(f_out, i, iflags, fnamecmp_type,
Wayne Davison927c8062005-03-13 05:34:00 +0000329 xname, xlen);
Wayne Davisona0545702005-04-09 18:59:57 +0000330 write_sum_head(f_xfer, s);
Wayne Davisonb9f592f2004-07-15 02:20:08 +0000331
Wayne Davisonecc81fc2004-07-26 16:36:59 +0000332 if (verbose > 2) {
333 rprintf(FINFO, "calling match_sums %s\n",
334 safe_fname(fname));
Andrew Tridgell11a5a3c1998-10-28 03:28:30 +0000335 }
Andrew Tridgell83fff1a1998-11-20 22:26:29 +0000336
Wayne Davison8a9cfb22005-02-16 08:10:41 +0000337 if (log_before_transfer)
Wayne Davisonb694f8a2005-03-04 16:08:02 +0000338 log_item(file, &initial_stats, iflags, NULL);
Wayne Davison8a832462005-02-16 17:02:16 +0000339 else if (!am_server && verbose && do_progress)
Wayne Davisonecc81fc2004-07-26 16:36:59 +0000340 rprintf(FINFO, "%s\n", safe_fname(fname2));
341
Andrew Tridgell83fff1a1998-11-20 22:26:29 +0000342 set_compression(fname);
Andrew Tridgell1b7c47c1998-11-02 04:17:56 +0000343
Wayne Davisona0545702005-04-09 18:59:57 +0000344 match_sums(f_xfer, s, mbuf, st.st_size);
Wayne Davison0394e342005-03-05 17:51:23 +0000345 if (do_progress)
346 end_progress(st.st_size);
347
Wayne Davison8a9cfb22005-02-16 08:10:41 +0000348 if (!log_before_transfer)
Wayne Davisonb694f8a2005-03-04 16:08:02 +0000349 log_item(file, &initial_stats, iflags, NULL);
Martin Pool6902ed12001-08-14 02:04:47 +0000350
Wayne Davisonb9f592f2004-07-15 02:20:08 +0000351 if (mbuf) {
352 j = unmap_file(mbuf);
353 if (j) {
354 io_error |= IOERR_GENERAL;
355 rsyserr(FERROR, j,
356 "read errors mapping %s",
357 full_fname(fname));
J.W. Schultze6e3f122003-08-15 00:57:27 +0000358 }
J.W. Schultze6e3f122003-08-15 00:57:27 +0000359 }
Wayne Davisonb9f592f2004-07-15 02:20:08 +0000360 close(fd);
J.W. Schultze6e3f122003-08-15 00:57:27 +0000361
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000362 free_sums(s);
J.W. Schultze6e3f122003-08-15 00:57:27 +0000363
Wayne Davisonecc81fc2004-07-26 16:36:59 +0000364 if (verbose > 2) {
365 rprintf(FINFO, "sender finished %s\n",
366 safe_fname(fname));
367 }
Wayne Davison95306d92005-02-20 01:04:54 +0000368
369 /* Flag that we actually sent this entry. */
370 file->flags |= FLAG_SENT;
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000371 }
Wayne Davison8b115ac2004-09-07 21:32:36 +0000372 make_backups = save_make_backups;
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000373
374 if (verbose > 2)
J.W. Schultze6e3f122003-08-15 00:57:27 +0000375 rprintf(FINFO, "send files finished\n");
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000376
377 match_report();
378
J.W. Schultze6e3f122003-08-15 00:57:27 +0000379 write_int(f_out, -1);
Andrew Tridgell2f03f951998-07-25 02:25:22 +0000380}