HttpRequest: Don't wait for socket to be readable

The socket is a blocking one, which means Read() will block unless data
is available, thus WaitForReadable() is useless in this context.

Testing also shows a 2x performance increase from removing this call due
to poll() performance being botched when KDEBUG_LEVEL >= 2.

Change-Id: I3170f865e961112b420c1548726bb6fd38e94cb2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3078
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Leorize
2020-07-25 18:13:20 +00:00
committed by waddlesplash
parent 846c12f5df
commit 7bac04e684
@@ -584,7 +584,6 @@ BHttpRequest::_MakeRequest()
while (!fQuit && !(receiveEnd && parseEnd)) {
if ((!receiveEnd) && (fInputBuffer.Size() == previousBufferSize)) {
fSocket->WaitForReadable();
BStackOrHeapArray<char, 4096> chunk(kHttpBufferSize);
bytesRead = fSocket->Read(chunk, kHttpBufferSize);