client->timeout_msecs = set->timeout_msecs;
client->idle_timeout_msecs = set->idle_timeout_msecs;
client->clist = connection_list_init(&dns_client_set, &dns_client_vfuncs);
- client->ioloop = set->ioloop == NULL ? current_ioloop : set->ioloop;
+ client->ioloop = current_ioloop;
client->path = i_strdup(set->dns_client_socket_path);
client->conn.event_parent = event_parent;
connection_init_client_unix(client->clist, &client->conn, client->path);
/* Non-zero enables caching for the client, is not supported with
dns_lookup() or dns_lookup_ptr(). Note that DNS TTL is ignored. */
unsigned int cache_ttl_secs;
-
- /* ioloop to run the lookup on (defaults to current_ioloop) */
- struct ioloop *ioloop;
};
struct dns_lookup_result {
{
const struct dns_client_settings set = {
.dns_client_socket_path = TEST_SOCKET_NAME,
- .ioloop = test_server.loop,
.timeout_msecs = 1000,
};
struct dns_lookup *lookup;
{
const struct dns_client_settings set = {
.dns_client_socket_path = TEST_SOCKET_NAME,
- .ioloop = test_server.loop,
.timeout_msecs = 1000,
};
struct dns_lookup *lookup;
const struct dns_client_settings set = {
.dns_client_socket_path = TEST_SOCKET_NAME,
- .ioloop = test_server.loop,
.timeout_msecs = 1000,
};
struct dns_lookup *lookup;
const struct dns_client_settings set = {
.dns_client_socket_path = TEST_SOCKET_NAME,
- .ioloop = test_server.loop,
.timeout_msecs = 1000,
};
struct dns_lookup *lookup;
create_dns_server(&test_server);
const struct dns_client_settings set = {
.dns_client_socket_path = TEST_SOCKET_NAME,
- .ioloop = test_server.loop,
.timeout_msecs = 1000,
.cache_ttl_secs = 4,
};
http_client_host_shared_dns_callback,
hshared, &hshared->dns_lookup);
} else if (cctx->dns_client_socket_path != NULL) {
+ struct ioloop *prev_ioloop = current_ioloop;
i_assert(cctx->dns_lookup_timeout_msecs > 0);
e_debug(hshared->event, "Performing asynchronous DNS lookup");
i_zero(&dns_set);
dns_set.dns_client_socket_path = cctx->dns_client_socket_path;
dns_set.timeout_msecs = cctx->dns_lookup_timeout_msecs;
- dns_set.ioloop = cctx->ioloop;
+ io_loop_set_current(cctx->ioloop);
(void)dns_lookup(hshared->name, &dns_set, hshared->event,
http_client_host_shared_dns_callback,
hshared, &hshared->dns_lookup);
+ io_loop_set_current(prev_ioloop);
} else {
struct ip_addr *ips;
unsigned int ips_count;