]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http, global: Replace http_client_settings.event_parent with http_client_init...
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 27 Jun 2023 19:36:43 +0000 (22:36 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:09 +0000 (12:34 +0200)
13 files changed:
src/auth/auth-policy.c
src/auth/db-oauth2.c
src/lib-http/http-client.c
src/lib-http/http-client.h
src/lib-http/test-http-client-errors.c
src/lib-http/test-http-client-request.c
src/lib-http/test-http-client.c
src/lib-http/test-http-payload.c
src/lib-lua/dlua-dovecot-http.c
src/plugins/fts-solr/solr-connection.c
src/plugins/fts/fts-parser-tika.c
src/plugins/push-notification/push-notification-driver-ox.c
src/stats/event-exporter-transport-http-post.c

index 9ac27b4d93ca27744005ff84af666b960c145618..747ad32110b836281bf3d0e5f20721857e55fdb8 100644 (file)
@@ -156,8 +156,7 @@ void auth_policy_init(void)
        http_client_set.request_absolute_timeout_msecs =
                global_auth_settings->policy_server_timeout_msecs;
 
-       http_client_set.event_parent = auth_event;
-       http_client = http_client_init(&http_client_set);
+       http_client = http_client_init(&http_client_set, auth_event);
 
        /* prepare template */
 
index 8471b0fa1e65ce03c565fd136e7735ee0a10a28e..a505681b3c4c40cd538d24f92abf01a53afb9fee 100644 (file)
@@ -251,9 +251,8 @@ struct db_oauth2 *db_oauth2_init(const char *config_path)
        http_set.max_pipelined_requests = db->set.max_pipelined_requests;
        http_set.no_auto_redirect = FALSE;
        http_set.no_auto_retry = TRUE;
-       http_set.event_parent = auth_event;
 
-       db->client = http_client_init(&http_set);
+       db->client = http_client_init(&http_set, auth_event);
        http_client_set_ssl_settings(db->client, ssl_set);
        pool_unref(&ssl_pool);
 
index 072b1f95a17b33485a4b9332de52d5dc40f58b4d..f6f9d72fec9c00b7f80891a0c7e087a4734c1709 100644 (file)
@@ -105,7 +105,8 @@ http_client_context_remove_client(struct http_client_context *cctx,
 
 struct http_client *
 http_client_init_shared(struct http_client_context *cctx,
-                       const struct http_client_settings *set)
+                       const struct http_client_settings *set,
+                       struct event *event_parent)
 {
        static unsigned int id = 0;
        struct http_client *client;
@@ -130,8 +131,8 @@ http_client_init_shared(struct http_client_context *cctx,
                log_prefix = "http-client: ";
        }
 
-       if (set->event_parent != NULL)
-               client->event = event_create(set->event_parent);
+       if (event_parent != NULL)
+               client->event = event_create(event_parent);
        else {
                i_assert(cctx->event != NULL);
                client->event = event_create(cctx->event);
@@ -220,15 +221,18 @@ http_client_init_shared(struct http_client_context *cctx,
        return client;
 }
 
-struct http_client *http_client_init(const struct http_client_settings *set)
+struct http_client *http_client_init(const struct http_client_settings *set,
+                                    struct event *event_parent)
 {
-       return http_client_init_shared(http_client_get_global_context(), set);
+       return http_client_init_shared(http_client_get_global_context(), set,
+                                      event_parent);
 }
 
 struct http_client *
-http_client_init_private(const struct http_client_settings *set)
+http_client_init_private(const struct http_client_settings *set,
+                        struct event *event_parent)
 {
-       return http_client_init_shared(NULL, set);
+       return http_client_init_shared(NULL, set, event_parent);
 }
 
 void http_client_deinit(struct http_client **_client)
index f78e405c58cbc52dc4168442a6947580c815d495..7bf479d2c7a851edbf65ce8ec01d77aa2e746d97 100644 (file)
@@ -123,11 +123,6 @@ struct http_client_settings {
           defaults are used when these settings are 0. */
        size_t socket_send_buffer_size;
        size_t socket_recv_buffer_size;
-
-       /* Event to use as parent for the http client event. For specific
-          requests this can be overridden with http_client_request_set_event().
-        */
-       struct event *event_parent;
 };
 
 /*
@@ -463,14 +458,18 @@ void http_client_request_start_tunnel(struct http_client_request *req,
  * Client
  */
 
-/* Create a client using the global shared client context. */
-struct http_client *http_client_init(const struct http_client_settings *set);
+/* Create a client using the global shared client context. The parent event can
+   be overriden for specific requests with http_client_request_set_event(). */
+struct http_client *http_client_init(const struct http_client_settings *set,
+                                    struct event *event_parent);
 /* Create a client without a shared context. */
 struct http_client *
-http_client_init_private(const struct http_client_settings *set);
+http_client_init_private(const struct http_client_settings *set,
+                        struct event *event_parent);
 struct http_client *
 http_client_init_shared(struct http_client_context *cctx,
-                       const struct http_client_settings *set) ATTR_NULL(1);
+                       const struct http_client_settings *set,
+                       struct event *event_parent) ATTR_NULL(1);
 void http_client_deinit(struct http_client **_client);
 
 /* Switch this client to the current ioloop */
index 27ded81023c252818d9d1aae42b14c1d0a5f422f..c85eb8ecc36db486d2fc3784772c81d53b59378d 100644 (file)
@@ -137,7 +137,7 @@ test_client_invalid_url(const struct http_client_settings *client_set)
        ctx = i_new(struct _invalid_url, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request_url_str(
                http_client, "GET", "imap://example.com/INBOX",
@@ -203,7 +203,7 @@ test_client_host_lookup_failed(const struct http_client_settings *client_set)
        ctx = i_new(struct _host_lookup_failed, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", "test.invalid.",
@@ -297,7 +297,7 @@ test_client_connection_refused(const struct http_client_settings *client_set)
                        test_client_connection_refused_timeout, ctx);
        }
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", net_ip2addr(&bind_ip),
@@ -406,7 +406,7 @@ test_client_connection_lost_prematurely(
        ctx->to = timeout_add_short(
                250, test_client_connection_lost_prematurely_timeout, ctx);
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", net_ip2addr(&bind_ip),
@@ -475,7 +475,7 @@ test_client_connection_timed_out(const struct http_client_settings *client_set)
        ctx = i_new(struct _connection_timed_out, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", "192.168.0.0", "/connection-timed-out.txt",
@@ -590,7 +590,7 @@ test_client_invalid_redirect(const struct http_client_settings *client_set)
 {
        struct http_client_request *hreq;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", net_ip2addr(&bind_ip),
@@ -676,7 +676,7 @@ test_client_unseekable_redirect(const struct http_client_settings *client_set)
        struct http_client_request *hreq;
        struct istream *input;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        input = i_stream_create_from_data("FROP", 4);
        input->seekable = FALSE;
@@ -744,7 +744,7 @@ test_client_unseekable_retry(const struct http_client_settings *client_set)
        struct http_client_request *hreq;
        struct istream *input;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        input = i_stream_create_from_data("FROP", 4);
        input->seekable = FALSE;
@@ -821,7 +821,7 @@ test_client_broken_payload(const struct http_client_settings *client_set)
 
        test_expect_errors(1);
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        input = i_stream_create_error_str(EIO, "Moehahahaha!!");
        i_stream_set_name(input, "PURE EVIL");
@@ -971,7 +971,7 @@ test_client_retry_payload(const struct http_client_settings *client_set)
        ctx = i_new(struct _retry_payload_ctx, 1);
        ctx->count = 1;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        input = i_stream_create_from_data(payload, sizeof(payload)-1);
 
@@ -1093,7 +1093,7 @@ test_client_connection_lost(const struct http_client_settings *client_set)
        ctx = i_new(struct _connection_lost_ctx, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        input = i_stream_create_from_data(payload, sizeof(payload)-1);
 
@@ -1219,7 +1219,7 @@ test_client_connection_lost_100(
        ctx = i_new(struct _connection_lost_100_ctx, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        input = i_stream_create_from_data(payload, sizeof(payload)-1);
 
@@ -1355,7 +1355,7 @@ test_client_connection_lost_sub_ioloop(
        ctx = i_new(struct _connection_lost_sub_ioloop_ctx, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        input = i_stream_create_from_data(payload, sizeof(payload)-1);
 
@@ -1460,7 +1460,7 @@ test_client_early_success(const struct http_client_settings *client_set)
        ctx = i_new(struct _early_success_ctx, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", net_ip2addr(&bind_ip),
@@ -1568,7 +1568,7 @@ test_client_bad_response(const struct http_client_settings *client_set)
        ctx = i_new(struct _bad_response_ctx, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", net_ip2addr(&bind_ip),
@@ -1648,7 +1648,7 @@ test_client_request_timed_out1(const struct http_client_settings *client_set)
        ctx = i_new(struct _request_timed_out1_ctx, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", net_ip2addr(&bind_ip),
@@ -1712,7 +1712,7 @@ test_client_request_timed_out2(const struct http_client_settings *client_set)
        ctx->to = timeout_add(2000,
                test_client_request_timed_out2_timeout, ctx);
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", net_ip2addr(&bind_ip),
@@ -1872,7 +1872,7 @@ test_client_request_aborted_early(const struct http_client_settings *client_set)
 
        ctx = i_new(struct _request_aborted_early_ctx, 1);
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = ctx->req1 = http_client_request(
                http_client, "GET", net_ip2addr(&bind_ip),
@@ -1963,7 +1963,7 @@ test_client_request_failed_blocking(
 
        ctx = i_new(struct _request_failed_blocking_ctx, 1);
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = ctx->req = http_client_request(
                http_client, "GET", net_ip2addr(&bind_ip),
@@ -2062,7 +2062,7 @@ test_client_client_deinit_early(const struct http_client_settings *client_set)
 
        ctx = i_new(struct _client_deinit_early_ctx, 1);
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", net_ip2addr(&bind_ip),
@@ -2171,7 +2171,7 @@ test_client_retry_with_delay(const struct http_client_settings *client_set)
        ctx = i_new(struct _client_retry_with_delay_ctx, 1);
        ctx->time = ioloop_timeval;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        ctx->req = hreq = http_client_request(
                http_client, "GET", net_ip2addr(&bind_ip),
@@ -2233,7 +2233,7 @@ test_client_dns_service_failure(const struct http_client_settings *client_set)
        ctx = i_new(struct _dns_service_failure, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", "example.com", "/dns-service-failure.txt",
@@ -2315,7 +2315,7 @@ test_client_dns_timeout(const struct http_client_settings *client_set)
        ctx = i_new(struct _dns_timeout, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", "example.com", "/dns-timeout.txt",
@@ -2404,7 +2404,7 @@ test_client_dns_lookup_failure(const struct http_client_settings *client_set)
        ctx = i_new(struct _dns_lookup_failure, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", "example.com", "/dns-lookup-failure.txt",
@@ -2570,7 +2570,7 @@ test_client_dns_lookup_ttl(const struct http_client_settings *client_set)
        ctx = i_new(struct _dns_lookup_ttl, 1);
        ctx->count = 2;
 
-       ctx->client = http_client = http_client_init(client_set);
+       ctx->client = http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                ctx->client, "GET", "example.com",
@@ -2693,7 +2693,7 @@ test_client_peer_reuse_failure(const struct http_client_settings *client_set)
        ctx = i_new(struct _peer_reuse_failure, 1);
        ctx->first = TRUE;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", net_ip2addr(&bind_ip), "/peer-reuse.txt",
@@ -2852,7 +2852,7 @@ test_client_reconnect_failure(const struct http_client_settings *client_set)
 
        ctx = i_new(struct _reconnect_failure_ctx, 1);
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", "example.com", "/reconnect-failure-1.txt",
@@ -2973,7 +2973,7 @@ test_client_multi_ip_attempts1(const struct http_client_settings *client_set)
        ctx = i_new(struct _multi_ip_attempts, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", "test1.local", "/multi-ip-attempts.txt",
@@ -2999,7 +2999,7 @@ test_client_multi_ip_attempts2(const struct http_client_settings *client_set)
        ctx = i_new(struct _multi_ip_attempts, 1);
        ctx->count = 2;
 
-       http_client = http_client_init(client_set);
+       http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                http_client, "GET", "test2.local", "/multi-ip-attempts.txt",
@@ -3188,7 +3188,7 @@ test_client_idle_connections(const struct http_client_settings *client_set)
        ctx->max = client_set->max_parallel_connections;
        ctx->count = client_set->max_parallel_connections;
 
-       ctx->client = http_client = http_client_init(client_set);
+       ctx->client = http_client = http_client_init(client_set, NULL);
 
        for (i = 0; i < ctx->count; i++) {
                hreq = http_client_request(
@@ -3386,7 +3386,7 @@ test_client_idle_hosts(const struct http_client_settings *client_set)
        ctx = i_new(struct _idle_hosts, 1);
        ctx->count = 2;
 
-       ctx->client = http_client = http_client_init(client_set);
+       ctx->client = http_client = http_client_init(client_set, NULL);
 
        hreq = http_client_request(
                ctx->client, "GET", "hosta",
index 5b6fa93f53d835c21c05e890dd483c9f22a6905c..75621df0be422187fc9d627d56e2be8541a77985 100644 (file)
@@ -19,7 +19,7 @@ static void test_http_client_request_headers(void)
 
        test_begin("http client request headers");
        i_zero(&set);
-       client = http_client_init(&set);
+       client = http_client_init(&set, NULL);
        req = http_client_request(client, "GET", "host", "target",
                                  test_http_client_request_callback, NULL);
 
index dede167529322169c7306a37bf15e8d9bd885e73..184b9116672c29ff1ca392e489354b9cdce146e3 100644 (file)
@@ -396,15 +396,17 @@ int main(int argc, char *argv[])
        http_set.request_timeout_msecs = 10*1000;
        http_set.max_attempts = 1;
        http_set.rawlog_dir = "/tmp/http-test";
-       http_set.event_parent = event_create(NULL);
-       event_set_forced_debug(http_set.event_parent, TRUE);
 
        http_cctx = http_client_context_create();
 
-       http_client1 = http_client_init_shared(http_cctx, &http_set);
-       http_client2 = http_client_init_shared(http_cctx, &http_set);
-       http_client3 = http_client_init_shared(http_cctx, &http_set);
-       http_client4 = http_client_init_shared(http_cctx, &http_set);
+       struct event *event = event_create(NULL);
+       event_set_forced_debug(event, TRUE);
+       http_client1 = http_client_init_shared(http_cctx, &http_set, event);
+       http_client2 = http_client_init_shared(http_cctx, &http_set, event);
+       http_client3 = http_client_init_shared(http_cctx, &http_set, event);
+       http_client4 = http_client_init_shared(http_cctx, &http_set, event);
+       event_unref(&event);
+
        http_client_set_ssl_settings(http_client1, &ssl_set);
        http_client_set_ssl_settings(http_client2, &ssl_set);
        http_client_set_ssl_settings(http_client3, &ssl_set);
@@ -463,7 +465,6 @@ int main(int argc, char *argv[])
        http_client_deinit(&http_client4);
 
        http_client_context_unref(&http_cctx);
-       event_unref(&http_set.event_parent);
 
        if (dns_client != NULL)
                dns_client_deinit(&dns_client);
index d48e46186a46e93a873a39f4afd7464315ed56c3..bdcf20e871dd17e147280b7d513b703e7c76a959 100644 (file)
@@ -1011,8 +1011,8 @@ test_client_create_clients(const struct http_client_settings *client_set,
        http_clients = i_new(struct http_client *, tset.parallel_clients);
        for (i = 0; i < tset.parallel_clients; i++) {
                http_clients[i] = (tset.parallel_clients_global ?
-                                  http_client_init(client_set) :
-                                  http_client_init_shared(http_context, client_set));
+                                  http_client_init(client_set, client_event) :
+                                  http_client_init_shared(http_context, client_set, client_event));
                http_client_set_ssl_settings(http_clients[i], ssl_client_set);
                if (old_test_http_client_connection_connected == NULL) {
                        old_test_http_client_connection_connected =
@@ -1779,7 +1779,6 @@ test_init_client_settings(struct http_client_settings *client_set_r)
        client_set_r->max_redirects = 0;
        client_set_r->max_attempts = 1;
        client_set_r->max_idle_time_msecs =  5* 1000;
-       client_set_r->event_parent = client_event;
 
        if (small_socket_buffers) {
                client_set_r->socket_send_buffer_size = 40960;
index e74723f3c5770f2a01287f028dfeaf179cde5cd9..dc9986c964f58f6e08f826bb91cc1e11e067a373 100644 (file)
@@ -442,11 +442,13 @@ static void dlua_push_http_client(lua_State *L, struct http_client *client)
        }
 
 static int parse_client_settings(lua_State *L, struct http_client_settings *set,
+                                struct event **event_parent_r,
                                 const char **error_r)
 {
        const struct master_service_settings *master_set =
                master_service_get_service_settings(master_service);
 
+       *event_parent_r = NULL;
        if (!lua_istable(L, -1)) {
                *error_r = t_strdup_printf("Table expected");
                return -1;
@@ -473,7 +475,7 @@ static int parse_client_settings(lua_State *L, struct http_client_settings *set,
                        set->proxy_username = parsed_url->user;
                        set->proxy_password = parsed_url->password;
                } else if (strcmp(key, "event_parent") == 0) {
-                       set->event_parent = dlua_check_event(L, -1);
+                       *event_parent_r = dlua_check_event(L, -1);
                } CLIENT_SETTING_STR(dns_client_socket_path)
                CLIENT_SETTING_STR(user_agent)
                CLIENT_SETTING_STR(rawlog_dir)
@@ -507,9 +509,9 @@ static int parse_client_settings(lua_State *L, struct http_client_settings *set,
                        t_strconcat(master_set->base_dir, "/dns-client", NULL);
        }
 
-       if (set->event_parent == NULL) {
+       if (*event_parent_r == NULL) {
                struct dlua_script *script = dlua_script_from_state(L);
-               set->event_parent = script->event;
+               *event_parent_r = script->event;
        }
 
        return 0;
@@ -522,14 +524,15 @@ static int dlua_http_client_new(lua_State *L)
 
        struct http_client *client;
        struct http_client_settings http_set;
+       struct event *event_parent;
        const char *error;
 
        i_zero(&http_set);
 
-       if (parse_client_settings(L, &http_set, &error) < 0)
+       if (parse_client_settings(L, &http_set, &event_parent, &error) < 0)
                luaL_error(L, "Invalid HTTP client setting: %s", error);
 
-       client = http_client_init(&http_set);
+       client = http_client_init(&http_set, event_parent);
        dlua_push_http_client(L, client);
        return 1;
 }
index a634570d48b95826539fefc10c8bc2d9131f8151..6138278332dab2fe59b575505255b59025452c14 100644 (file)
@@ -105,7 +105,6 @@ int solr_connection_init(const struct fts_solr_settings *solr_set,
                http_set.connect_timeout_msecs = 5*1000;
                http_set.request_timeout_msecs = 60*1000;
                http_set.rawlog_dir = solr_set->rawlog_dir;
-               http_set.event_parent = conn->event;
 
                /* FIXME: We should initialize a shared client instead. However,
                          this is currently not possible due to an obscure bug
@@ -113,7 +112,7 @@ int solr_connection_init(const struct fts_solr_settings *solr_set,
                          conflicts with other HTTP applications like FTS Tika.
                          Using a private client will provide a quick fix for
                          now. */
-               solr_http_client = http_client_init_private(&http_set);
+               solr_http_client = http_client_init_private(&http_set, conn->event);
        }
 
        *conn_r = conn;
index 8ee45a14e639f71338f233723fab4e8e5fcb1b6c..cb495f726fd2a69d2027329395388880ae277a47 100644 (file)
@@ -73,7 +73,6 @@ tika_get_http_client_url(struct fts_parser_context *parser_context, struct http_
                http_set.max_attempts = 3;
                http_set.connect_timeout_msecs = 5*1000;
                http_set.request_timeout_msecs = 60*1000;
-               http_set.event_parent = user->event;
 
                /* FIXME: We should initialize a shared client instead. However,
                          this is currently not possible due to an obscure bug
@@ -81,7 +80,7 @@ tika_get_http_client_url(struct fts_parser_context *parser_context, struct http_
                          conflicts with other HTTP applications like FTS Solr.
                          Using a private client will provide a quick fix for
                          now. */
-               tika_http_client = http_client_init_private(&http_set);
+               tika_http_client = http_client_init_private(&http_set, user->event);
        }
        *http_url_r = tuser->http_url;
        return 0;
index 4d8237846511a6bf27d27114ec7d32b388ebe088..393abe27e7c0e937a944009d84580192828cdc0c 100644 (file)
@@ -71,9 +71,8 @@ push_notification_driver_ox_init_global(
                i_zero(&http_set);
                http_set.max_attempts = config->http_max_retries+1;
                http_set.request_timeout_msecs = config->http_timeout_msecs;
-               http_set.event_parent = user->event;
 
-               ox_global->http_client = http_client_init(&http_set);
+               ox_global->http_client = http_client_init(&http_set, user->event);
        }
 }
 
index b6d978ef0759876db3549f2ac340c673b593a9b6..c917d6f8c599840bda4190bbb5f127e01e2b06a7 100644 (file)
@@ -54,7 +54,7 @@ void event_export_transport_http_post(const struct exporter *exporter,
                struct http_client_settings set = {
                        .dns_client_socket_path = "dns-client",
                };
-               exporter_http_client = http_client_init(&set);
+               exporter_http_client = http_client_init(&set, NULL);
        }
 
        req = http_client_request_url_str(exporter_http_client, "POST",