mirror of
https://github.com/arendst/Tasmota.git
synced 2026-10-26 22:11:22 +00:00
* AsyncHttpClientLight: time out reading a body when the server goes silent writeToStreamDataBlock() waited for the rest of a body for as long as connected() held. A server that stops sending part way through without closing leaves connected() true, so the worker never finishes and the caller, waiting in runJob(), never returns. Give up after _tcpTimeout without data and return HTTPC_ERROR_READ_TIMEOUT, as HttpClientLight now does (#25139). * AsyncHttpClientLight: notice when the server closes after the last byte AsyncTcpAdapter only saw the peer close inside read(), and callers only read when available() > 0. A body without Content-Length that ends with the server closing left connected() true for ever, so writeToStreamDataBlock() never returned. connected() now peeks at the socket, as WiFiClient::connected() does: data still buffered keeps it connected, an orderly close after it does not. * AsyncHttpClientLight: address review of the read timeout - connected() only reports a peer close and no longer calls stop(): it can be called from another task than the worker using the socket. - writeToStreamDataBlock() closes the connection on a read timeout, as the chunked readers do, so a stalled connection is not reused. - readBodyToStreamString(): the identity branch used by async GET/POST now times out after _tcpTimeout without data, and notices a close: with no Content-Length it ends the body, with one it is a lost connection.