- if (read_batch) {
- /* 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_sum_head(f_out, s);
- 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);
- }
+ match_sums(f_out, s, mbuf, st.st_size);
+ if (!log_before_transfer)
+ log_send(file, &initial_stats, iflags);