]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-client-connection - Use the default connection label.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 28 Feb 2019 08:41:34 +0000 (09:41 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Fri, 1 Mar 2019 23:56:58 +0000 (00:56 +0100)
src/lib-http/http-client-connection.c
src/lib-http/http-client-private.h

index 48924b2d25650b62152a8527e0744ae961bca9ef..29070a0c7f5d2d090ba0bc6260f3eedae6560c00 100644 (file)
@@ -1537,7 +1537,8 @@ static const struct connection_settings http_client_connection_set = {
        .input_max_size = (size_t)-1,
        .output_max_size = (size_t)-1,
        .client = TRUE,
-       .delayed_unix_client_connected_callback = TRUE
+       .delayed_unix_client_connected_callback = TRUE,
+       .log_connection_id = TRUE,
 };
 
 static const struct connection_vfuncs http_client_connection_vfuncs = {
@@ -1710,15 +1711,14 @@ http_client_connection_create(struct http_client_peer *peer)
                i_array_init(&conn->request_wait_list, 16);
        conn->io_wait_timer = io_wait_timer_add_to(cctx->ioloop);
 
-       conn->label = i_strdup_printf("%s [%d]",
-               http_client_peer_shared_label(pshared), conn->id);
        conn->event = event_create(ppool->peer->cctx->event);
-       event_set_append_log_prefix(conn->event,
-               t_strdup_printf("conn %s: ", conn->label));
 
        conn->conn.event_parent = conn->event;
        connection_init(cctx->conn_list, &conn->conn, NULL);
 
+       event_set_append_log_prefix(
+               conn->event, t_strdup_printf("conn %s: ", conn->conn.label));
+
        switch (pshared->addr.type) {
        case HTTP_CLIENT_PEER_ADDR_HTTPS_TUNNEL:
                http_client_connection_connect_tunnel
@@ -1847,7 +1847,6 @@ bool http_client_connection_unref(struct http_client_connection **_conn)
        io_wait_timer_remove(&conn->io_wait_timer);
        
        event_unref(&conn->event);
-       i_free(conn->label);
        i_free(conn);
 
        http_client_peer_pool_unref(&ppool);
index 4aee291415266659996697f5617b6e50cac625be..4a4ea80ca12fe751b9db612a09074d04763e8bbb 100644 (file)
@@ -168,7 +168,6 @@ struct http_client_connection {
        struct http_client_peer_pool *ppool;
        struct http_client_peer *peer;
 
-       char *label;
        unsigned int id; // DEBUG: identify parallel connections
 
        int connect_errno;