Ensure that ALL variants of read respect timeout

This commit is contained in:
Sara Damiano
2019-05-20 13:12:09 -04:00
parent b96c866bad
commit 7f7a7563cf
12 changed files with 27 additions and 17 deletions

View File

@@ -520,7 +520,8 @@ TINY_GSP_MODEM_STREAM_UTILITIES()
DBG("### Got: ", len, "->", sockets[mux]->rx.free());
}
while (len--) {
while (!stream.available()) { TINY_GSM_YIELD(); }
uint32_t startMillis = millis();
while (!stream.available() && (millis() - startMillis < sockets[mux]->_timeout)) { TINY_GSM_YIELD(); }
sockets[mux]->rx.put(stream.read());
}
if (len_orig > sockets[mux]->available()) { // TODO