]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: If remote dsync times out, log a more verbose reason.
authorTimo Sirainen <tss@iki.fi>
Sat, 12 Mar 2011 13:48:24 +0000 (15:48 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 12 Mar 2011 13:48:24 +0000 (15:48 +0200)
src/dsync/dsync-proxy-client.c

index fb18b2f1d633aef6f104dbe880794aaf10a120f8..6b002aa635463e9e31ecbfe5bb1fe0676208c357 100644 (file)
@@ -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);
 }