]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Added more idle timeout resets to proxying.
authorTimo Sirainen <tss@iki.fi>
Mon, 25 Oct 2010 21:13:05 +0000 (22:13 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 25 Oct 2010 21:13:05 +0000 (22:13 +0100)
src/dsync/dsync-proxy-client.c

index f676bfd641d7274e087e2fe1d58eeff3f1c12fa1..165a3cf819ca217293bffb30390458591baaa881 100644 (file)
@@ -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,