dovecot-2.2: lib-http: Added debug logging.

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 26 13:41:34 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/22424f1a32ad
changeset: 17171:22424f1a32ad
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 26 14:41:05 2014 +0100
description:
lib-http: Added debug logging.

diffstat:

 src/lib-http/http-client-queue.c |  16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diffs (41 lines):

diff -r 08f1c7af0ac0 -r 22424f1a32ad src/lib-http/http-client-queue.c
--- a/src/lib-http/http-client-queue.c	Tue Mar 25 19:59:24 2014 +0200
+++ b/src/lib-http/http-client-queue.c	Wed Mar 26 14:41:05 2014 +0100
@@ -286,6 +286,14 @@
 {
 	struct http_client_host *host = queue->host;
 
+	http_client_queue_debug(queue, "Failed to set up connection to %s%s: %s "
+		"(%u peers pending, %u requests pending)",
+		http_client_peer_addr2str(addr),
+		(addr->https_name == NULL ? "" :
+			t_strdup_printf(" (SSL=%s)", addr->https_name)), reason,
+		(array_is_created(&queue->pending_peers) ?
+		 	array_count(&queue->pending_peers): 0),
+		array_count(&queue->request_queue));
 	if (array_is_created(&queue->pending_peers) &&
 		array_count(&queue->pending_peers) > 0) {
 		struct http_client_peer *const *peer_idx;
@@ -301,8 +309,11 @@
 				break;
 			}
 		}
-		if (array_count(&queue->pending_peers) > 0)
+		if (array_count(&queue->pending_peers) > 0) {
+			http_client_queue_debug(queue,
+				"Waiting for remaining pending peers.");
 			return TRUE;
+		}
 	}
 
 	/* one of the connections failed. if we're not using soft timeouts,
@@ -312,6 +323,9 @@
 		timeout_remove(&queue->to_connect);
 
 	if (http_client_queue_is_last_connect_ip(queue)) {
+		http_client_queue_debug(queue,
+			"Failed to set up any connection; failing all queued requests");
+
 		/* all IPs failed, but retry all of them again on the
 		   next request. */
 		queue->ips_connect_idx = queue->ips_connect_start_idx =


More information about the dovecot-cvs mailing list