]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: Add "host" and "port" fields to request event.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 21 Jan 2018 15:06:19 +0000 (16:06 +0100)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 12 Mar 2018 09:07:37 +0000 (11:07 +0200)
src/lib-http/http-client-request.c

index e0f9f897184b924916c83c770d142422336a25f1..d575141b40cfca5d71387e41edd7a75daf13da60 100644 (file)
@@ -53,6 +53,8 @@ static void
 http_client_request_update_event(struct http_client_request *req)
 {
        event_add_str(req->event, "method", req->method);
+       event_add_str(req->event, "host", req->origin_url.host.name);
+       event_add_int(req->event, "port", http_url_get_port(&req->origin_url));
        if (req->target != NULL)
                event_add_str(req->event, "target", req->target);
        event_set_append_log_prefix(req->event, t_strdup_printf(
@@ -334,6 +336,7 @@ void http_client_request_set_port(struct http_client_request *req,
 {
        i_assert(req->state == HTTP_REQUEST_STATE_NEW);
        req->origin_url.port = port;
+       event_add_int(req->event, "port", port);
 }
 
 void http_client_request_set_ssl(struct http_client_request *req,