Mercurial > dovecot > core-2.2
changeset 16574:a6b00756ab2c
lib-http: Added more debug messages.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 27 Jun 2013 23:07:20 +0300 |
parents | e405105a0c24 |
children | eaa712530f3f |
files | src/lib-http/http-client-connection.c src/lib-http/http-client-peer.c |
diffstat | 2 files changed, 19 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-http/http-client-connection.c Thu Jun 27 22:49:50 2013 +0300 +++ b/src/lib-http/http-client-connection.c Thu Jun 27 23:07:20 2013 +0300 @@ -111,6 +111,8 @@ struct http_client_connection *conn = *_conn; struct http_client_request **req; + http_client_connection_debug(conn, "Aborting connection: %s", error); + conn->connected = FALSE; conn->closing = TRUE; @@ -146,6 +148,9 @@ } } + http_client_connection_debug(conn, + "Aborting connection with temporary error: %s", error); + conn->connected = FALSE; conn->closing = TRUE; @@ -341,6 +346,7 @@ "SSL handshaking to %s failed: Connection timed out in %u.%03u secs", _conn->name, msecs/1000, msecs%1000); } + http_client_connection_debug(conn, "%s", error); http_client_connection_retry_requests(conn, HTTP_CLIENT_REQUEST_ERROR_TIMED_OUT, error); break; @@ -349,6 +355,7 @@ error = _conn->input == NULL ? "Connection lost" : t_strdup_printf("Connection lost: %s", strerror(_conn->input->stream_errno)); + http_client_connection_debug(conn, "%s", error); http_client_connection_retry_requests(conn, HTTP_CLIENT_REQUEST_ERROR_CONNECTION_LOST, error); default: @@ -784,6 +791,7 @@ if (conn->peer->addr.https_name != NULL) { if (http_client_connection_ssl_init(conn, &error) < 0) { http_client_peer_connection_failure(conn->peer, error); + http_client_connection_debug(conn, "%s", error); http_client_connection_unref(&conn); } return; @@ -833,6 +841,7 @@ conn->connect_start_timestamp = ioloop_timeval; if (connection_client_connect(&conn->conn) < 0) { conn->connect_errno = errno; + http_client_connection_debug(conn, "Connect failed: %m"); conn->to_input = timeout_add_short(0, http_client_connection_delayed_connect_error, conn); return;
--- a/src/lib-http/http-client-peer.c Thu Jun 27 22:49:50 2013 +0300 +++ b/src/lib-http/http-client-peer.c Thu Jun 27 23:07:20 2013 +0300 @@ -135,8 +135,12 @@ if (num_urgent == 0 && working_conn_count >= peer->client->set.max_parallel_connections) { /* no */ - if (conn == NULL) + if (conn == NULL) { + http_client_peer_debug(peer, + "Only non-urgent requests, and we already have " + "%u pending connections", working_conn_count); return FALSE; + } /* pipeline it */ return http_client_connection_next_request(conn); } @@ -152,6 +156,11 @@ } else { new_connections = (num_urgent > connecting ? num_urgent - connecting : 0); } + http_client_peer_debug(peer, + "Creating %u new connections to handle requests " + "(already %u usable, connecting to %u, closing %u)", + new_connections, working_conn_count - connecting, + connecting, closing); http_client_peer_connect(peer, new_connections); /* now we wait until it is connected */