From: sergey.kitov Date: Tue, 13 May 2025 13:13:37 +0000 (+0300) Subject: lib-http: Pass http_client_host to http_client_host_shared_lookup. X-Git-Tag: 2.4.2~768 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faaf904672f3ae6c1d90748312ed56b2e31d3935;p=thirdparty%2Fdovecot%2Fcore.git lib-http: Pass http_client_host to http_client_host_shared_lookup. The following commit will make dns_lookup retrieving DNS settings from event. http_client_host is need to pass http_client event to dns_lookup, the event contains client-specific DNS settings. --- diff --git a/src/lib-http/http-client-host.c b/src/lib-http/http-client-host.c index d17bdb278d..c7b848ec45 100644 --- a/src/lib-http/http-client-host.c +++ b/src/lib-http/http-client-host.c @@ -140,8 +140,9 @@ http_client_host_shared_dns_callback(const struct dns_lookup_result *result, } static void -http_client_host_shared_lookup(struct http_client_host_shared *hshared) +http_client_host_shared_lookup(struct http_client_host *host) { + struct http_client_host_shared *hshared = host->shared; struct http_client_context *cctx = hshared->cctx; struct dns_client_settings dns_set; @@ -173,8 +174,9 @@ http_client_host_shared_lookup(struct http_client_host_shared *hshared) } static int -http_client_host_shared_refresh(struct http_client_host_shared *hshared) +http_client_host_shared_refresh(struct http_client_host *host) { + struct http_client_host_shared *hshared = host->shared; if (hshared->unix_local) return 0; if (hshared->explicit_ip) @@ -193,7 +195,7 @@ http_client_host_shared_refresh(struct http_client_host_shared *hshared) "need to refresh DNS lookup"); } - http_client_host_shared_lookup(hshared); + http_client_host_shared_lookup(host); if (hshared->dns_lookup != NULL) return -1; return (hshared->ips_count > 0 ? 1 : -1); @@ -468,7 +470,7 @@ void http_client_host_check_idle(struct http_client_host *host) int http_client_host_refresh(struct http_client_host *host) { - return http_client_host_shared_refresh(host->shared); + return http_client_host_shared_refresh(host); } bool http_client_host_get_ip_idx(struct http_client_host *host,