From: Timo Sirainen Date: Sat, 12 Mar 2011 13:48:24 +0000 (+0200) Subject: dsync: If remote dsync times out, log a more verbose reason. X-Git-Tag: 2.0.12~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6b63ea77e1240331251fd324371cbb685bf7efd;p=thirdparty%2Fdovecot%2Fcore.git dsync: If remote dsync times out, log a more verbose reason. --- diff --git a/src/dsync/dsync-proxy-client.c b/src/dsync/dsync-proxy-client.c index fb18b2f1d6..6b002aa635 100644 --- a/src/dsync/dsync-proxy-client.c +++ b/src/dsync/dsync-proxy-client.c @@ -387,7 +387,21 @@ static int proxy_client_worker_output(struct proxy_client_dsync_worker *worker) static void proxy_client_worker_timeout(struct proxy_client_dsync_worker *worker) { - i_error("proxy client timed out"); + const char *reason; + + if (worker->save_io != NULL) + reason = " (waiting for more input from mail being saved)"; + else if (worker->save_input != NULL) { + size_t bytes = o_stream_get_buffer_used_size(worker->output); + + reason = t_strdup_printf(" (waiting for output stream to flush, " + "%"PRIuSIZE_T" bytes left)", bytes); + } else if (worker->msg_get_data.input != NULL) { + reason = " (waiting for MSG-GET message from remote)"; + } else { + reason = ""; + } + i_error("proxy client timed out%s", reason); proxy_client_fail(worker); }