|
|
@ -497,9 +497,11 @@ mqtt_dns_found(const char* name, ip_addr_t* ipaddr, void* arg) { |
|
|
|
|
|
|
|
|
|
|
|
if (ipaddr == NULL) { |
|
|
|
if (ipaddr == NULL) { |
|
|
|
os_printf("MQTT: DNS lookup failed\n"); |
|
|
|
os_printf("MQTT: DNS lookup failed\n"); |
|
|
|
|
|
|
|
if (client != NULL) { |
|
|
|
client->timeoutTick = client->reconTimeout; |
|
|
|
client->timeoutTick = client->reconTimeout; |
|
|
|
if (client->reconTimeout < 128) client->reconTimeout <<= 1; |
|
|
|
if (client->reconTimeout < 128) client->reconTimeout <<= 1; |
|
|
|
client->connState = TCP_RECONNECT_REQ; // the timer will kick-off a reconnection
|
|
|
|
client->connState = TCP_RECONNECT_REQ; // the timer will kick-off a reconnection
|
|
|
|
|
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
DBG_MQTT("MQTT: ip %d.%d.%d.%d\n", |
|
|
|
DBG_MQTT("MQTT: ip %d.%d.%d.%d\n", |
|
|
@ -508,7 +510,7 @@ mqtt_dns_found(const char* name, ip_addr_t* ipaddr, void* arg) { |
|
|
|
*((uint8 *)&ipaddr->addr + 2), |
|
|
|
*((uint8 *)&ipaddr->addr + 2), |
|
|
|
*((uint8 *)&ipaddr->addr + 3)); |
|
|
|
*((uint8 *)&ipaddr->addr + 3)); |
|
|
|
|
|
|
|
|
|
|
|
if (client->ip.addr == 0 && ipaddr->addr != 0) { |
|
|
|
if (client != NULL && client->ip.addr == 0 && ipaddr->addr != 0) { |
|
|
|
os_memcpy(client->pCon->proto.tcp->remote_ip, &ipaddr->addr, 4); |
|
|
|
os_memcpy(client->pCon->proto.tcp->remote_ip, &ipaddr->addr, 4); |
|
|
|
uint8_t err; |
|
|
|
uint8_t err; |
|
|
|
if (client->security) |
|
|
|
if (client->security) |
|
|
|