-
- if (am_sender) {
- in = read_total();
- out = write_total();
- tsize = total_size;
- } else {
- out = read_longint(f);
- in = read_longint(f);
- tsize = read_longint(f);
- }
-
- printf("wrote %.0f bytes read %.0f bytes %.2f bytes/sec\n",
- (double)out,(double)in,(in+out)/(0.5 + (t-starttime)));
- printf("total size is %.0f speedup is %.2f\n",
- (double)tsize,(1.0*tsize)/(in+out));
+
+ /* this is the client */
+
+ if (!am_sender) {
+ total_written = read_longint(f);
+ total_read = read_longint(f);
+ stats.total_size = read_longint(f);
+ } else if (write_batch) {
+ /* The --read-batch process is going to be a client
+ * receiver, so we need to give it the stats. */
+ write_longint(batch_fd, total_read);
+ write_longint(batch_fd, total_written);
+ write_longint(batch_fd, stats.total_size);
+ }
+
+ if (do_stats) {
+ rprintf(FINFO,"\nNumber of files: %d\n", stats.num_files);
+ rprintf(FINFO,"Number of files transferred: %d\n",
+ stats.num_transferred_files);
+ rprintf(FINFO,"Total file size: %.0f bytes\n",
+ (double)stats.total_size);
+ rprintf(FINFO,"Total transferred file size: %.0f bytes\n",
+ (double)stats.total_transferred_size);
+ rprintf(FINFO,"Literal data: %.0f bytes\n",
+ (double)stats.literal_data);
+ rprintf(FINFO,"Matched data: %.0f bytes\n",
+ (double)stats.matched_data);
+ rprintf(FINFO,"File list size: %d\n", stats.flist_size);
+ rprintf(FINFO,"Total bytes written: %.0f\n",
+ (double)total_written);
+ rprintf(FINFO,"Total bytes read: %.0f\n",
+ (double)total_read);
+ }
+
+ if (verbose || do_stats) {
+ rprintf(FINFO,
+ "\nwrote %.0f bytes read %.0f bytes %.2f bytes/sec\n",
+ (double)total_written, (double)total_read,
+ (total_written + total_read)/(0.5 + (t - starttime)));
+ rprintf(FINFO, "total size is %.0f speedup is %.2f\n",
+ (double)stats.total_size,
+ (double)stats.total_size / (total_written+total_read));
+ }
+
+ fflush(stdout);
+ fflush(stderr);