mirror of
https://review.haiku-os.org/haiku
synced 2025-01-31 18:56:49 +01:00
NetServices: fix parsing raw HTTP bodies without a known size
When parsing a raw HTTP body without a known size, whether or not a request is complete depends on the end of the connection. Make sure that the parser updates to complete when all the bytes in the buffer have been read and the connection closed. Change-Id: I6f055b43ffe4a44da65da85c19b71304d804c800
This commit is contained in:
parent
3c9045fbbf
commit
477e74d187
@ -354,10 +354,13 @@ HttpRawBodyParser::ParseBody(HttpBuffer& buffer, HttpTransferFunction writeToBod
|
||||
"Could not write all available body bytes to the target.");
|
||||
}
|
||||
|
||||
if (fBodyBytesTotal && *fBodyBytesTotal == fTransferredBodySize)
|
||||
return {bytesRead, bytesRead, true};
|
||||
else
|
||||
return {bytesRead, bytesRead, false};
|
||||
if (fBodyBytesTotal) {
|
||||
if (*fBodyBytesTotal == fTransferredBodySize)
|
||||
return {bytesRead, bytesRead, true};
|
||||
else
|
||||
return {bytesRead, bytesRead, false};
|
||||
} else
|
||||
return {bytesRead, bytesRead, readEnd};
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user