Merge pull request #10724 from socram8888/fix-web-raw-timeout
Cap size of last chunk in raw read in WebServer
This commit is contained in:
commit
64b62dc45b
1 changed files with 2 additions and 1 deletions
|
|
@ -187,7 +187,8 @@ bool WebServer::_parseRequest(NetworkClient &client) {
|
|||
_currentRaw->status = RAW_WRITE;
|
||||
|
||||
while (_currentRaw->totalSize < _clientContentLength) {
|
||||
_currentRaw->currentSize = client.readBytes(_currentRaw->buf, HTTP_RAW_BUFLEN);
|
||||
size_t read_len = std::min(_clientContentLength - _currentRaw->totalSize, (size_t)HTTP_RAW_BUFLEN);
|
||||
_currentRaw->currentSize = client.readBytes(_currentRaw->buf, read_len);
|
||||
_currentRaw->totalSize += _currentRaw->currentSize;
|
||||
if (_currentRaw->currentSize == 0) {
|
||||
_currentRaw->status = RAW_ABORTED;
|
||||
|
|
|
|||
Loading…
Reference in a new issue