mirror of
https://github.com/jeelabs/esp-link.git
synced 2026-03-08 02:06:48 +01:00
This commit is contained in:
10
mqtt/mqtt.c
10
mqtt/mqtt.c
@@ -497,9 +497,11 @@ mqtt_dns_found(const char* name, ip_addr_t* ipaddr, void* arg) {
|
||||
|
||||
if (ipaddr == NULL) {
|
||||
os_printf("MQTT: DNS lookup failed\n");
|
||||
client->timeoutTick = client->reconTimeout;
|
||||
if (client->reconTimeout < 128) client->reconTimeout <<= 1;
|
||||
client->connState = TCP_RECONNECT_REQ; // the timer will kick-off a reconnection
|
||||
if (client != NULL) {
|
||||
client->timeoutTick = client->reconTimeout;
|
||||
if (client->reconTimeout < 128) client->reconTimeout <<= 1;
|
||||
client->connState = TCP_RECONNECT_REQ; // the timer will kick-off a reconnection
|
||||
}
|
||||
return;
|
||||
}
|
||||
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 + 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);
|
||||
uint8_t err;
|
||||
if (client->security)
|
||||
|
||||
@@ -177,11 +177,8 @@ serbridgeRecvCb(void *arg, char *data, unsigned short len)
|
||||
(len == 2 && strncmp(data, "?\n", 2) == 0) ||
|
||||
(len == 3 && strncmp(data, "?\r\n", 3) == 0)) {
|
||||
startPGM = true;
|
||||
conn->conn_mode = cmPGM;
|
||||
|
||||
// Don't actually reboot the target until we've actually received
|
||||
// serial data to send to the target.
|
||||
conn->conn_mode = cmPGMInit;
|
||||
return;
|
||||
// If the connection starts with a telnet negotiation we will do telnet
|
||||
}
|
||||
else if (len >= 3 && strncmp(data, (char[]){IAC, WILL, ComPortOpt}, 3) == 0) {
|
||||
|
||||
Reference in New Issue
Block a user