]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: Improved "DATA output timeout" error message.
authorTimo Sirainen <tss@iki.fi>
Thu, 8 Sep 2011 10:41:20 +0000 (13:41 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 8 Sep 2011 10:41:20 +0000 (13:41 +0300)
src/lmtp/lmtp-proxy.c

index 4e7faf53abfcca403b16cff39750504cc6094c1c..4cfe986403db2d8a464f4ac7ced7842745f8ea42 100644 (file)
@@ -336,6 +336,8 @@ static bool lmtp_proxy_disconnect_hanging_output(struct lmtp_proxy *proxy)
 {
        struct lmtp_proxy_connection *const *conns;
        uoff_t min_offset;
+       size_t size;
+       const char *errstr;
 
        min_offset = lmtp_proxy_find_lowest_offset(proxy);
        if (min_offset == (uoff_t)-1)
@@ -348,9 +350,13 @@ static bool lmtp_proxy_disconnect_hanging_output(struct lmtp_proxy *proxy)
 
                if (conn->data_input != NULL &&
                    conn->data_input->v_offset == min_offset) {
-                       lmtp_client_fail(conn->client,
-                                        ERRSTR_TEMP_REMOTE_FAILURE
-                                        " (DATA output timeout)");
+                       (void)i_stream_get_data(conn->data_input, &size);
+                       errstr = t_strdup_printf(ERRSTR_TEMP_REMOTE_FAILURE
+                               " (DATA output stalled for %u secs, "
+                               "%"PRIuUOFF_T"B sent, %"PRIuSIZE_T"B buffered)",
+                               proxy->max_timeout_msecs/1000,
+                               min_offset, size);
+                       lmtp_client_fail(conn->client, errstr);
                }
        }
        return TRUE;