+
+-static void msg2sndr_flush(void)
+-{
+- if (defer_forwarding_messages)
+- return;
+-
+- while (msg2sndr.head && io_multiplexing_out) {
+- struct msg_list_item *m = msg2sndr.head;
+- if (!(msg2sndr.head = m->next))
+- msg2sndr.tail = NULL;
+- stats.total_written += m->len;
+- defer_forwarding_messages = 1;
+- writefd_unbuffered(sock_f_out, m->buf, m->len);
+- defer_forwarding_messages = 0;
+- free(m);
+- }
+-}
+-
+ /**
+ * Write an message to a multiplexed stream. If this fails then rsync
+ * exits.
+@@ -1190,14 +1116,15 @@ static void mplex_write(enum msgcode cod
+ defer_forwarding_messages = 1;
+ writefd_unbuffered(sock_f_out, buf, len);
+ defer_forwarding_messages = 0;
+- msg2sndr_flush();
++ if (am_generator())
++ msg_list_flush();
+ }
+ }