mirror of
https://github.com/arendst/Tasmota.git
synced 2026-10-26 22:11:22 +00:00
writeToStreamDataBlock() looped for as long as connected() held, waiting for the rest of the body with no time limit. A server that stops sending part way through a body without closing the connection - a computer that sleeps, a cable pulled, a network that drops between the two ends - leaves connected() true for ever, so the read never returned. Called from the main loop, as Berry's webclient get_string() is, it left the device answering nothing, not even its web page, until it was power-cycled. Give up after _tcpTimeout without data, returning HTTPC_ERROR_READ_TIMEOUT, as handleHeaderResponse() already does for the headers. A body that keeps arriving, however slowly, is unaffected: each piece resets the clock.