]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: Remove redundant debug logging checks
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 4 Dec 2017 10:58:47 +0000 (12:58 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 13 Dec 2017 11:22:17 +0000 (13:22 +0200)
src/lib-http/http-client-connection.c
src/lib-http/http-client-host.c
src/lib-http/http-client-peer.c
src/lib-http/http-client-queue.c
src/lib-http/http-client-request.c
src/lib-http/http-client.c

index 4fb30d0532a0010cac692f7d389f9c7cfd903bc8..a0285689a5f1c75c0f2607ded200961bd99158cd 100644 (file)
@@ -32,11 +32,9 @@ http_client_connection_debug(struct http_client_connection *conn,
 {
        va_list args;
 
-       if (conn->debug || conn->ppool->peer->cctx->set.debug) {
-               va_start(args, format); 
-               e_debug(conn->event, "%s", t_strdup_vprintf(format, args));
-               va_end(args);
-       }
+       va_start(args, format);
+       e_debug(conn->event, "%s", t_strdup_vprintf(format, args));
+       va_end(args);
 }
 
 /*
@@ -1400,8 +1398,7 @@ http_client_connection_ssl_init(struct http_client_connection *conn,
                ssl_set.verbose_invalid_cert = TRUE;
        }
 
-       if (set->debug)
-               http_client_connection_debug(conn, "Starting SSL handshake");
+       http_client_connection_debug(conn, "Starting SSL handshake");
 
        if (io_stream_create_ssl_client(ssl_ctx,
                                        pshared->addr.a.tcp.https_name, &ssl_set,
index 4f7a8ab92000f7fbe4fc5a923dd1d728519cb426..88d12f04976c65cef29bd128c2b550193d8be317 100644 (file)
@@ -56,11 +56,9 @@ http_client_host_debug(struct http_client_host *host,
 {
        va_list args;
 
-       if (host->client->set.debug) {
-               va_start(args, format); 
-               e_debug(host->shared->event, "%s", t_strdup_vprintf(format, args));
-               va_end(args);
-       }
+       va_start(args, format);
+       e_debug(host->shared->event, "%s", t_strdup_vprintf(format, args));
+       va_end(args);
 }
 
 /*
index 5eda3c47011b694dfa984585c67f295ce3ad0401..63b854c85cc282bb0dd4e726d674be43c82f85cd 100644 (file)
@@ -81,14 +81,11 @@ static inline void
 http_client_peer_debug(struct http_client_peer *peer,
        const char *format, ...)
 {
-       struct http_client *client = peer->client;
        va_list args;
 
-       if (client->set.debug) {
-               va_start(args, format);
-               e_debug(peer->event, "%s", t_strdup_vprintf(format, args));
-               va_end(args);
-       }
+       va_start(args, format);
+       e_debug(peer->event, "%s", t_strdup_vprintf(format, args));
+       va_end(args);
 }
 
 /*
index e8d2f265a4335ea90bc31608ee54198101a92f41..99b146f53609428d29c65526cee629970aa21252 100644 (file)
@@ -42,13 +42,10 @@ http_client_queue_debug(struct http_client_queue *queue,
 {
        va_list args;
 
-       if (queue->client->set.debug) {
-
-               // FIXME: find some other method of distinguishing clients
-               va_start(args, format); 
-               e_debug(queue->event, "%s", t_strdup_vprintf(format, args));
-               va_end(args);
-       }
+       // FIXME: find some other method of distinguishing clients
+       va_start(args, format);
+       e_debug(queue->event, "%s", t_strdup_vprintf(format, args));
+       va_end(args);
 }
 
 /*
@@ -776,14 +773,12 @@ http_client_queue_set_request_timer(struct http_client_queue *queue,
        i_assert(time->tv_sec > 0);
        timeout_remove(&queue->to_request);     
 
-       if (queue->client->set.debug) {
-               http_client_queue_debug(queue,
-                       "Set request timeout to %s.%03lu (now: %s.%03lu)",
-                       t_strflocaltime("%Y-%m-%d %H:%M:%S", time->tv_sec),
-                       ((unsigned long)time->tv_usec)/1000,
-                       t_strflocaltime("%Y-%m-%d %H:%M:%S", ioloop_timeval.tv_sec),
-                       ((unsigned long)ioloop_timeval.tv_usec)/1000);
-       }
+       http_client_queue_debug(queue,
+               "Set request timeout to %s.%03lu (now: %s.%03lu)",
+               t_strflocaltime("%Y-%m-%d %H:%M:%S", time->tv_sec),
+               ((unsigned long)time->tv_usec)/1000,
+               t_strflocaltime("%Y-%m-%d %H:%M:%S", ioloop_timeval.tv_sec),
+               ((unsigned long)ioloop_timeval.tv_usec)/1000);
 
        /* set timer */
        queue->to_request = timeout_add_absolute
index 46e354fcf0ac37816a1e473a9391ffe9590846b7..b9692ecc272de83f0276c0061ad37fb6c04de866 100644 (file)
@@ -44,11 +44,9 @@ http_client_request_debug(struct http_client_request *req,
 {
        va_list args;
 
-       if (req->client->set.debug) {
-               va_start(args, format);
-               e_debug(req->event, "%s", t_strdup_vprintf(format, args));
-               va_end(args);
-       }
+       va_start(args, format);
+       e_debug(req->event, "%s", t_strdup_vprintf(format, args));
+       va_end(args);
 }
 
 /*
index b88dd7c341076be385a88c54ab418e3cdccb4e69..6601503ef7fc2ef775641bffbf594532b1b60729 100644 (file)
@@ -102,8 +102,7 @@ http_client_debug(struct http_client *client,
        va_list args;
 
        va_start(args, format); 
-       if (client->set.debug)
-               e_debug(client->event, "%s", t_strdup_vprintf(format, args));
+       e_debug(client->event, "%s", t_strdup_vprintf(format, args));
        va_end(args);
 }