MQTT: trigger conn failure callback if DNS success but connection failed (#3477)

This commit is contained in:
Johan Ström 2021-12-06 13:38:48 +01:00 committed by GitHub
parent 1965a12efc
commit b91368594d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -1021,7 +1021,12 @@ static void socket_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
NODE_DBG(IPSTR, IP2STR(&(ipaddr->addr))); NODE_DBG(IPSTR, IP2STR(&(ipaddr->addr)));
NODE_DBG("\n"); NODE_DBG("\n");
mqtt_socket_do_connect(mud); if(mqtt_socket_do_connect(mud) != ESPCONN_OK) {
NODE_DBG("socket_dns_found, got DNS but connect failed\n");
mqtt_connack_fail(mud, MQTT_CONN_FAIL_DNS);
mqtt_socket_disconnected(arg);
return;
}
} }
#include "pm/swtimer.h" #include "pm/swtimer.h"