summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2013-11-09 10:49:59 -0800
committerWayne Davison <wayned@samba.org>2013-11-09 10:49:59 -0800
commit18217a94c488b29aa8048d8626461cf82fd4ebae (patch)
treee880230dd2a4fab84c5fb86ba0f5e988e25e57ee
parent090ef59b29403fbe77a7a3aa2042efd8a628c673 (diff)
downloadrsync-18217a94c488b29aa8048d8626461cf82fd4ebae.tar.gz
Fix timeout checking in safe_read().
-rw-r--r--io.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/io.c b/io.c
index 28f5fe8d..2a87919f 100644
--- a/io.c
+++ b/io.c
@@ -155,7 +155,7 @@ static void read_a_msg(void);
static void drain_multiplex_messages(void);
static void sleep_for_bwlimit(int bytes_written);
-static void check_timeout(BOOL allow_keepalive)
+static void check_timeout(BOOL allow_keepalive, int keepalive_flags)
{
time_t t, chk;
@@ -177,7 +177,7 @@ static void check_timeout(BOOL allow_keepalive)
if (allow_keepalive) {
/* This may put data into iobuf.msg w/o flushing. */
- maybe_send_keepalive(t, 0);
+ maybe_send_keepalive(t, keepalive_flags);
}
if (!last_io_in)
@@ -255,8 +255,7 @@ static size_t safe_read(int fd, char *buf, size_t len)
who_am_i());
exit_cleanup(RERR_FILEIO);
}
- if (io_timeout)
- maybe_send_keepalive(time(NULL), MSK_ALLOW_FLUSH);
+ check_timeout(1, MSK_ALLOW_FLUSH);
continue;
}
@@ -752,7 +751,7 @@ static char *perform_io(size_t needed, int flags)
send_extra_file_list(sock_f_out, -1);
extra_flist_sending_enabled = !flist_eof;
} else
- check_timeout((flags & PIO_NEED_INPUT) != 0);
+ check_timeout((flags & PIO_NEED_INPUT) != 0, 0);
FD_ZERO(&r_fds); /* Just in case... */
FD_ZERO(&w_fds);
}