Fixed mux closed

This commit is contained in:
SRGDamia1
2017-10-26 13:26:02 -04:00
parent b67fcf8ffb
commit 5cba94408d
3 changed files with 3 additions and 3 deletions

View File

@@ -481,9 +481,9 @@ public:
}
data = "";
} else if (data.endsWith(GF("CLOSED"))) {
int nl = data.lastIndexOf(GSM_NL, data.length()-8);
int coma = data.indexOf(',', nl+2);
int mux = data.substring(nl+2, coma).toInt();
int muxStart = max(0,data.lastIndexOf(GSM_NL, data.length()-8));
int coma = data.indexOf(',', muxStart);
int mux = data.substring(muxStart, coma).toInt();
if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) {
sockets[mux]->sock_connected = false;
}