From: Wayne Davison Date: Thu, 28 May 2020 07:41:39 +0000 (-0700) Subject: Use MSG_FLUSH in a couple more spots. X-Git-Tag: v3.2.0pre1~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f60bd811e9cbfa3e75ac59b46fce5744278f1204;p=thirdparty%2Frsync.git Use MSG_FLUSH in a couple more spots. --- diff --git a/clientserver.c b/clientserver.c index e5a631a3..a6c24cf3 100644 --- a/clientserver.c +++ b/clientserver.c @@ -965,7 +965,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char } if (*err_msg) rprintf(FERROR, "%s\n", err_msg); - io_flush(FULL_FLUSH); + io_flush(MSG_FLUSH); } else option_error(); msleep(400); diff --git a/io.c b/io.c index 947daa63..e6cfbbda 100644 --- a/io.c +++ b/io.c @@ -1982,14 +1982,14 @@ static void sleep_for_bwlimit(int bytes_written) total_written = (sleep_usec - elapsed_usec) * bwlimit / (ONE_SEC/1024); } -void io_flush(int flush_it_all) +void io_flush(int flush_type) { if (iobuf.out.len > iobuf.out_empty_len) { - if (flush_it_all == FULL_FLUSH) /* flush everything in the output buffers */ + if (flush_type == FULL_FLUSH) /* flush everything in the output buffers */ perform_io(iobuf.out.size - iobuf.out_empty_len, PIO_NEED_OUTROOM); - else if (flush_it_all == NORMAL_FLUSH) /* flush at least 1 byte */ + else if (flush_type == NORMAL_FLUSH) /* flush at least 1 byte */ perform_io(iobuf.out.size - iobuf.out.len + 1, PIO_NEED_OUTROOM); - /* MSG_FLUSH: flush iobuf.msg only */ + /* MSG_FLUSH: flush iobuf.msg only */ } if (iobuf.msg.len) perform_io(iobuf.msg.size, PIO_NEED_MSGROOM); diff --git a/options.c b/options.c index 1650780e..6a7e7aac 100644 --- a/options.c +++ b/options.c @@ -1200,7 +1200,7 @@ void option_error(void) } rprintf(FERROR, RSYNC_NAME ": %s", err_buf); - io_flush(FULL_FLUSH); + io_flush(MSG_FLUSH); msleep(20); }