X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/4ea4acf17ba245e64a0d549e030fa9def99750ea..e10664c5e877bd75b58fe542024fcecf74e55091:/io.c diff --git a/io.c b/io.c index 79fb7e93..1bc3e2f3 100644 --- a/io.c +++ b/io.c @@ -302,11 +302,13 @@ static void read_msg_fd(void) flist_ndx_push(&hlink_list, IVAL(buf,0)); break; case MSG_SOCKERR: + case MSG_CLIENT: if (!am_generator) { rprintf(FERROR, "invalid message %d:%d\n", tag, len); exit_cleanup(RERR_STREAMIO); } - close_multiplexing_out(); + if (tag == MSG_SOCKERR) + close_multiplexing_out(); /* FALL THROUGH */ case MSG_INFO: case MSG_ERROR: @@ -336,19 +338,21 @@ void increment_active_files(int ndx, int itemizing, enum logcode code) { /* TODO: tune these limits? */ while (active_filecnt >= (active_bytecnt >= 128*1024 ? 10 : 50)) { +#ifdef SUPPORT_HARD_LINKS if (hlink_list.head) check_for_finished_hlinks(itemizing, code); +#endif read_msg_fd(); } active_filecnt++; - active_bytecnt += the_file_list->files[ndx]->length; + active_bytecnt += F_LENGTH(the_file_list->files[ndx]); } void decrement_active_files(int ndx) { active_filecnt--; - active_bytecnt -= the_file_list->files[ndx]->length; + active_bytecnt -= F_LENGTH(the_file_list->files[ndx]); } /* Try to push messages off the list onto the wire. If we leave with more @@ -405,11 +409,20 @@ int send_msg(enum msgcode code, const char *buf, int len) return 1; } +void send_msg_int(enum msgcode code, int num) +{ + char numbuf[4]; + SIVAL(numbuf, 0, num); + send_msg(code, numbuf, 4); +} + int get_redo_num(int itemizing, enum logcode code) { while (1) { +#ifdef SUPPORT_HARD_LINKS if (hlink_list.head) check_for_finished_hlinks(itemizing, code); +#endif if (redo_list.head) break; read_msg_fd(); @@ -1535,8 +1548,6 @@ void close_multiplexing_out(void) void start_write_batch(int fd) { - write_stream_flags(batch_fd); - /* Some communication has already taken place, but we don't * enable batch writing until here so that we can write a * canonical record of the communication even though the