Closed biank88 closed 6 years ago
Yes, it seems like that loop is a problem. Connection lost will stuck program in that loop if the router is disconnect only during execution of client->POST (didn't test with GET). Adding timeout seems to help.
uint32_t timeout_ms = 950;
uint32_t t = millis();
do{
line = readStringUntil('\n');
}while(millis() - t < timeout_ms and line.length() == 0);
950ms timeout will not do much since it will still have to wait for readStringUntil default timeout.
Thanks for this. I'll test it more on my side and update as needed.
https://github.com/electronicsguy/ESP8266/blob/0e3edc3390056793d5ef48f4c95d1bd30c83e589/HTTPSRedirect/HTTPSRedirect.cpp#L320
Problem The number of empty lines has no bound, in particular, an empty
line
might be created as a result of a timeout during a connection loss.