From: Timo Sirainen Date: Mon, 25 Oct 2010 21:13:05 +0000 (+0100) Subject: dsync: Added more idle timeout resets to proxying. X-Git-Tag: 2.0.7~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=41a8595f253ea3828d32ff699fbd4d627cdbf844;p=thirdparty%2Fdovecot%2Fcore.git dsync: Added more idle timeout resets to proxying. --- diff --git a/src/dsync/dsync-proxy-client.c b/src/dsync/dsync-proxy-client.c index f676bfd641..165a3cf819 100644 --- a/src/dsync/dsync-proxy-client.c +++ b/src/dsync/dsync-proxy-client.c @@ -153,6 +153,7 @@ proxy_client_worker_read_to_eof(struct proxy_client_dsync_worker *worker) io_remove(&worker->io); proxy_client_worker_msg_get_finish(worker); } + timeout_reset(worker->to); } static void @@ -328,9 +329,9 @@ static void proxy_client_worker_input(struct proxy_client_dsync_worker *worker) if (worker->to_input != NULL) timeout_remove(&worker->to_input); - timeout_reset(worker->to); if (worker->worker.input_callback != NULL) { worker->worker.input_callback(worker->worker.input_context); + timeout_reset(worker->to); return; } @@ -348,13 +349,14 @@ static void proxy_client_worker_input(struct proxy_client_dsync_worker *worker) don't get back here. */ timeout_remove(&worker->to_input); } + timeout_reset(worker->to); } -static int proxy_client_worker_output(struct proxy_client_dsync_worker *worker) +static int +proxy_client_worker_output_real(struct proxy_client_dsync_worker *worker) { int ret; - timeout_reset(worker->to); if ((ret = o_stream_flush(worker->output)) < 0) return 1; @@ -371,6 +373,15 @@ static int proxy_client_worker_output(struct proxy_client_dsync_worker *worker) return ret; } +static int proxy_client_worker_output(struct proxy_client_dsync_worker *worker) +{ + int ret; + + ret = proxy_client_worker_output_real(worker); + timeout_reset(worker->to); + return ret; +} + static void proxy_client_worker_timeout(void *context ATTR_UNUSED) { i_error("proxy client timed out"); @@ -962,7 +973,8 @@ proxy_client_worker_msg_copy(struct dsync_worker *_worker, aqueue_append(worker->request_queue, &request); } -static void proxy_client_send_stream(struct proxy_client_dsync_worker *worker) +static void +proxy_client_send_stream_real(struct proxy_client_dsync_worker *worker) { dsync_worker_save_callback_t *callback; const unsigned char *data; @@ -1014,6 +1026,12 @@ static void proxy_client_send_stream(struct proxy_client_dsync_worker *worker) callback(worker->save_context); } +static void proxy_client_send_stream(struct proxy_client_dsync_worker *worker) +{ + proxy_client_send_stream_real(worker); + timeout_reset(worker->to); +} + static void proxy_client_worker_msg_save(struct dsync_worker *_worker, const struct dsync_message *msg,