]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Allow the generator's msg iobuf to get bigger too.
authorWayne Davison <wayne@opencoder.net>
Thu, 25 Feb 2021 20:28:18 +0000 (12:28 -0800)
committerWayne Davison <wayne@opencoder.net>
Thu, 25 Feb 2021 20:28:18 +0000 (12:28 -0800)
io.c

diff --git a/io.c b/io.c
index b50a066cf31928acb86d175d6595580a70d18b28..cc70ce88702c8505c8f1f92543fc597ce33d8771 100644 (file)
--- a/io.c
+++ b/io.c
@@ -962,9 +962,9 @@ int send_msg(enum msgcode code, const char *buf, size_t len, int convert)
 #endif
                needed = len + 4 + 3;
        if (iobuf.msg.len + needed > iobuf.msg.size) {
-               if (!am_receiver)
+               if (am_sender)
                        perform_io(needed, PIO_NEED_MSGROOM);
-               else { /* We allow the receiver to increase their iobuf.msg size to avoid a deadlock. */
+               else { /* We sometimes allow the iobuf.msg size to increase to avoid a deadlock. */
                        size_t old_size = iobuf.msg.size;
                        restore_iobuf_size(&iobuf.msg);
                        realloc_xbuf(&iobuf.msg, iobuf.msg.size * 2);