- if (!recv_ok) {
- if (csum_length == SUM_LENGTH) {
- rprintf(FERROR,"ERROR: file corruption in %s. File changed during transfer?\n",
- full_fname(fname));
- } else {
- char buf[4];
- if (verbose > 1)
- rprintf(FINFO,"redoing %s(%d)\n",fname,i);
- SIVAL(buf, 0, i);
- send_msg(MSG_REDO, buf, 4);
+ if (recv_ok) {
+ if (remove_sent_files && recv_ok > 0) {
+ SIVAL(numbuf, 0, i);
+ send_msg(MSG_SUCCESS, numbuf, 4);
+ }
+ } else {
+ int msgtype = csum_length == SUM_LENGTH || read_batch ?
+ FERROR : FINFO;
+ if (msgtype == FERROR || verbose) {
+ char *errstr, *redostr, *keptstr;
+ if (!(keep_partial && partialptr) && !inplace)
+ keptstr = "discarded";
+ else if (partial_dir)
+ keptstr = "put into partial-dir";
+ else
+ keptstr = "retained";
+ if (msgtype == FERROR) {
+ errstr = "ERROR";
+ redostr = "";
+ } else {
+ errstr = "WARNING";
+ redostr = " (will try again)";
+ }
+ rprintf(msgtype,
+ "%s: %s failed verification -- update %s%s.\n",
+ errstr, safe_fname(fname),
+ keptstr, redostr);
+ }
+ if (csum_length != SUM_LENGTH) {
+ SIVAL(numbuf, 0, i);
+ send_msg(MSG_REDO, numbuf, 4);