File tree
Expand file treeCollapse file tree1 file changed
+6
-2
lines changed Expand file treeCollapse file tree1 file changed
+6
-2
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -186,8 +186,12 @@ bool WebServer::_parseRequest(NetworkClient &client) {
|
186 | 186 | _currentHandler->raw(*this, _currentUri, *_currentRaw);
|
187 | 187 | _currentRaw->status = RAW_WRITE;
|
188 | 188 |
|
189 |
| -while (_currentRaw->totalSize < _clientContentLength) { |
190 |
| -_currentRaw->currentSize = client.readBytes(_currentRaw->buf, HTTP_RAW_BUFLEN); |
| 189 | +while (1) { |
| 190 | +size_t read_len = std::min(_clientContentLength - _currentRaw->totalSize, (size_t) HTTP_RAW_BUFLEN); |
| 191 | +if (read_len == 0) { |
| 192 | +break; |
| 193 | +} |
| 194 | +_currentRaw->currentSize = client.readBytes(_currentRaw->buf, read_len); |
191 | 195 | _currentRaw->totalSize += _currentRaw->currentSize;
|
192 | 196 | if (_currentRaw->currentSize == 0) {
|
193 | 197 | _currentRaw->status = RAW_ABORTED;
|
|
You can’t perform that action at this time.
0 commit comments