X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/dca68b0aadbdc1471daac5b8796ed626e46e3128..3610c4583a6b187fa6fc98ad0025340c6f840d53:/io.c diff --git a/io.c b/io.c index 029f74bb..50eca536 100644 --- a/io.c +++ b/io.c @@ -857,6 +857,11 @@ static void writefd_unbuffered(int fd,char *buf,size_t len) if (msg_fd_in > maxfd) maxfd = msg_fd_in; } + if (fd != sock_f_out && iobuf_out_cnt && no_flush == 1) { + FD_SET(sock_f_out, &w_fds); + if (sock_f_out > maxfd) + maxfd = sock_f_out; + } tv.tv_sec = select_timeout; tv.tv_usec = 0; @@ -875,8 +880,14 @@ static void writefd_unbuffered(int fd,char *buf,size_t len) if (msg_fd_in >= 0 && FD_ISSET(msg_fd_in, &r_fds)) read_msg_fd(); - if (!FD_ISSET(fd, &w_fds)) + if (!FD_ISSET(fd, &w_fds)) { + if (fd != sock_f_out && iobuf_out_cnt) { + no_flush--; + io_flush(NORMAL_FLUSH); + no_flush++; + } continue; + } n = len - total; if (bwlimit && n > bwlimit_writemax)