We need to call msg2sndr_flush() in read_msg_fd() now.
[rsync/rsync.git] / io.c
diff --git a/io.c b/io.c
index e23c69a..567065b 100644 (file)
--- a/io.c
+++ b/io.c
@@ -107,6 +107,7 @@ static char int_byte_cnt[64] = {
        5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 8, 9, /* (C0 - FF)/4 */
 };
 
+static void msg2sndr_flush(void);
 static void readfd(int fd, char *buffer, size_t N);
 static void writefd(int fd, const char *buf, size_t len);
 static void writefd_unbuffered(int fd, const char *buf, size_t len);
@@ -263,6 +264,7 @@ static void read_msg_fd(void)
        /* Temporarily disable msg_fd_in.  This is needed to avoid looping back
         * to this routine from writefd_unbuffered(). */
        msg_fd_in = -1;
+       defer_forwarding_messages++;
 
        readfd(fd, buf, 4);
        tag = IVAL(buf, 0);
@@ -357,7 +359,9 @@ static void read_msg_fd(void)
                exit_cleanup(RERR_STREAMIO);
        }
 
+       defer_forwarding_messages--;
        msg_fd_in = fd;
+       msg2sndr_flush();
 }
 
 /* This is used by the generator to limit how many file transfers can