Skip to content

Commit a0b391b

Browse files
committed
Remove extra EOF check after receiving zero bytes
When we receive zero bytes, we already know that this is EOF, an extra check can attempt to read from the socket leading to timeout on Windows
1 parent 0003c79 commit a0b391b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/poco/Net/src/HTTPChunkedStream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int HTTPChunkedStreamBuf::readChar()
138138
char buffer = 0;
139139
int n = _session.read(&buffer, 1);
140140

141-
if (n == 0 && _session.peek() == eof) {
141+
if (n == 0) {
142142
throw IncompleteChunkedTransfer();
143143
}
144144

@@ -222,7 +222,7 @@ int HTTPChunkedStreamBuf::readChunkEncodedStream(char* buffer, std::streamsize l
222222

223223
if (n > 0) _chunk -= n;
224224

225-
if (n == 0 && _session.peek() == eof) {
225+
if (n == 0 && length > 0) {
226226
throw IncompleteChunkedTransfer();
227227
}
228228

0 commit comments

Comments
 (0)