X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/6cc119828892f4c28fc55274e11055f8c420515c..ecc7623e7faf75f6ba3dd7b5a416c52e2346ac7d:/sender.c diff --git a/sender.c b/sender.c index b19ecb54..3a8ec7fa 100644 --- a/sender.c +++ b/sender.c @@ -1,21 +1,24 @@ /* - Copyright (C) Andrew Tridgell 1996 - Copyright (C) Paul Mackerras 1996 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + * Routines only used by the sending process. + * + * Copyright (C) 1996 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + */ #include "rsync.h" @@ -25,7 +28,7 @@ extern int am_server; extern int am_daemon; extern int log_before_transfer; extern int log_format_has_i; -extern int daemon_log_format_has_i; +extern int logfile_format_has_i; extern int csum_length; extern int append_mode; extern int io_error; @@ -133,11 +136,9 @@ void successful_send(int ndx) file->dir.root, "/", NULL); } else offset = 0; - f_name_to(file, fname + offset); - if (remove_sent_files && do_unlink(fname) == 0 && verbose > 1) { - rprintf(FINFO, "sender removed %s\n", - safe_fname(fname + offset)); - } + f_name(file, fname + offset); + if (remove_sent_files && do_unlink(fname) == 0 && verbose > 1) + rprintf(FINFO, "sender removed %s\n", fname + offset); } static void write_ndx_and_attrs(int f_out, int ndx, int iflags, @@ -217,8 +218,7 @@ void send_files(struct file_list *flist, int f_out, int f_in) int phase = 0, max_phase = protocol_version >= 29 ? 2 : 1; struct stats initial_stats; int save_make_backups = make_backups; - int itemizing = am_daemon ? daemon_log_format_has_i - : !am_server && log_format_has_i; + int itemizing = am_server ? logfile_format_has_i : log_format_has_i; int f_xfer = write_batch < 0 ? batch_fd : f_out; int i, j; @@ -256,7 +256,7 @@ void send_files(struct file_list *flist, int f_out, int f_in) fname[offset++] = '/'; } else offset = 0; - fname2 = f_name_to(file, fname + offset); + fname2 = f_name(file, fname + offset); if (verbose > 2) rprintf(FINFO, "send_files(%d, %s)\n", i, fname); @@ -331,22 +331,20 @@ void send_files(struct file_list *flist, int f_out, int f_in) if (verbose > 2) { rprintf(FINFO, "send_files mapped %s of size %.0f\n", - safe_fname(fname), (double)st.st_size); + fname, (double)st.st_size); } write_ndx_and_attrs(f_out, i, iflags, fnamecmp_type, xname, xlen); write_sum_head(f_xfer, s); - if (verbose > 2) { - rprintf(FINFO, "calling match_sums %s\n", - safe_fname(fname)); - } + if (verbose > 2) + rprintf(FINFO, "calling match_sums %s\n", fname); if (log_before_transfer) log_item(file, &initial_stats, iflags, NULL); else if (!am_server && verbose && do_progress) - rprintf(FINFO, "%s\n", safe_fname(fname2)); + rprintf(FINFO, "%s\n", fname2); set_compression(fname); @@ -370,10 +368,8 @@ void send_files(struct file_list *flist, int f_out, int f_in) free_sums(s); - if (verbose > 2) { - rprintf(FINFO, "sender finished %s\n", - safe_fname(fname)); - } + if (verbose > 2) + rprintf(FINFO, "sender finished %s\n", fname); /* Flag that we actually sent this entry. */ file->flags |= FLAG_SENT;