X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/4dde3347fb614270f6aa6812598185aa0ccca3ef..a0f1ed55cd5ae7393b904b2e2bd31c2ee0b59d40:/io.c diff --git a/io.c b/io.c index b400ba29..a85bcfaf 100644 --- a/io.c +++ b/io.c @@ -1264,7 +1264,7 @@ void stop_flist_forward(void) static void read_a_msg(void) { char *data, line[BIGPATHBUFLEN]; - int tag; + int tag, val; size_t msg_bytes; data = perform_io(4, PIO_INPUT_AND_CONSUME); @@ -1306,6 +1306,17 @@ static void read_a_msg(void) if (!am_generator) send_msg(MSG_IO_ERROR, data, 4, 0); break; + case MSG_IO_TIMEOUT: + if (msg_bytes != 4 || am_sender || am_generator) + goto invalid_msg; + data = perform_io(4, PIO_INPUT_AND_CONSUME); + val = IVAL(data, 0); + if (!io_timeout || io_timeout > val) { + if (INFO_GTE(MISC, 2)) + rprintf(FINFO, "Setting --timeout=%d to match server\n", val); + io_timeout = val; + } + break; case MSG_NOOP: if (am_sender) maybe_send_keepalive();