[344] Only do async dns on glibc.
This commit is contained in:
parent
ee543a25f5
commit
3d40ffe18b
@ -155,7 +155,7 @@ struct mosquitto {
|
||||
#ifndef WITH_BROKER
|
||||
mosq_sock_t sockpairR, sockpairW;
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
#ifdef __GLIBC__
|
||||
struct gaicb *adns; /* For getaddrinfo_a */
|
||||
#endif
|
||||
enum _mosquitto_protocol protocol;
|
||||
|
@ -271,7 +271,7 @@ static unsigned int psk_client_callback(SSL *ssl, const char *hint,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(WITH_BROKER) && defined(__linux__)
|
||||
#if defined(WITH_BROKER) && defined(__GLIBC__)
|
||||
/* Async connect, part 1 (dns lookup) */
|
||||
int _mosquitto_try_connect_step1(struct mosquitto *mosq, const char *host)
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ int mqtt3_bridge_new(struct mosquitto_db *db, struct _mqtt3_bridge *bridge)
|
||||
return MOSQ_ERR_NOMEM;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
#ifdef __GLIBC__
|
||||
new_context->bridge->restart_t = 1; /* force quick restart of bridge */
|
||||
return mqtt3_bridge_connect_step1(db, new_context);
|
||||
#else
|
||||
|
@ -247,7 +247,7 @@ int mosquitto_main_loop(struct mosquitto_db *db, mosq_sock_t *listensock, int li
|
||||
if((context->bridge->start_type == bst_lazy && context->bridge->lazy_reconnect)
|
||||
|| (context->bridge->start_type == bst_automatic && now > context->bridge->restart_t)){
|
||||
|
||||
#ifdef __linux__
|
||||
#ifdef __GLIBC__
|
||||
if(context->adns){
|
||||
/* Waiting on DNS lookup */
|
||||
rc = gai_error(context->adns);
|
||||
|
Loading…
Reference in New Issue
Block a user