Skip to content

Commit

Permalink
MQTT: trigger conn failure callback if DNS success but connection fai…
Browse files Browse the repository at this point in the history
…led (#3477)
  • Loading branch information
stromnet authored Dec 6, 2021
1 parent 1965a12 commit b913685
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/modules/mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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("\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"
Expand Down

0 comments on commit b913685

Please sign in to comment.