From e2bc4126691bdbc8ab78e6e56c72bf1d8bc51168 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 22 Jul 2004 04:15:18 +0000 Subject: [PATCH] Added a warning message when a file fails to verify, letting the user know if we retained it or discarded it. Especially useful for batch- reading mode where the old code could look like it did the update when it really silently failed. --- receiver.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/receiver.c b/receiver.c index fcde60f8..1fe97335 100644 --- a/receiver.c +++ b/receiver.c @@ -552,15 +552,25 @@ int recv_files(int f_in, struct file_list *flist, char *local_name) cleanup_disable(); if (!recv_ok) { - if (csum_length == SUM_LENGTH) { - rprintf(FERROR,"ERROR: file corruption in %s. File changed during transfer?\n", - full_fname(fname)); - } else { + int msgtype; + char *redostr; + if (csum_length != SUM_LENGTH) { char buf[4]; - if (verbose > 1) - rprintf(FINFO,"redoing %s(%d)\n",fname,i); SIVAL(buf, 0, i); send_msg(MSG_REDO, buf, 4); + msgtype = read_batch ? FERROR : FINFO; + redostr = read_batch ? " Redo doubtful." + : " Redo pending."; + } else { + msgtype = FERROR; + redostr = ""; + } + if (verbose || read_batch) { + rprintf(msgtype, + "%s: %s failed verification. Update %sed.%s\n", + msgtype == FERROR ? "ERROR" : "WARNING", + fname, keep_partial || inplace ? + "retain" : "discard", redostr); } } } -- 2.34.1