- if (read_batch) { /* dw */
- /* read checksums originally computed on sender side */
- read_batch_csum_info(i, s, &checksums_match);
- if (checksums_match) {
- read_batch_delta_file( (char *) &j, sizeof(int) );
- if (j != i) { /* if flist index entries don't match*/
- rprintf(FINFO,"index mismatch in send_files\n");
- rprintf(FINFO,"read index = %d flist ndx = %d\n",j,i);
- close_batch_delta_file();
- close_batch_csums_file();
- exit_cleanup(1);
- }
- else {
- write_int(f_out,j);
- write_int(f_out,s->count);
- write_int(f_out,s->n);
- write_int(f_out,s->remainder);
- done=0;
- while (!done) {
- read_batch_delta_file( (char *) &buff_len, sizeof(int) );
- write_int(f_out,buff_len);
- if (buff_len == 0) {
- done = 1;
- }
- else {
- if (buff_len > 0) {
- read_batch_delta_file(buff, buff_len);
- write_buf(f_out,buff,buff_len);
- }
- }
- } /* end while */
- read_batch_delta_file( buff, MD4_SUM_LENGTH);
- write_buf(f_out, buff, MD4_SUM_LENGTH);
-
- } /* j=i */
- } else { /* not checksum match */
- rprintf (FINFO,"readbatch & checksums don't match\n");
- rprintf (FINFO,"filename=%s is being skipped\n",
- fname);
- continue;
- }
- } else {
- match_sums(f_out,s,buf,st.st_size);
- log_send(file, &initial_stats);
- }
-
- if (!read_batch) { /* dw */
- if (buf) unmap_file(buf);
- close(fd);
+ match_sums(f_xfer, s, mbuf, st.st_size);
+ if (do_progress)
+ end_progress(st.st_size);
+
+ log_item(log_code, file, &initial_stats, iflags, NULL);
+
+ if (mbuf) {
+ j = unmap_file(mbuf);
+ if (j) {
+ io_error |= IOERR_GENERAL;
+ rsyserr(FERROR, j,
+ "read errors mapping %s",
+ full_fname(fname));
+ }