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:
@@ -584,7 +584,6 @@ BHttpRequest::_MakeRequest()
|
|||||||
|
|
||||||
while (!fQuit && !(receiveEnd && parseEnd)) {
|
while (!fQuit && !(receiveEnd && parseEnd)) {
|
||||||
if ((!receiveEnd) && (fInputBuffer.Size() == previousBufferSize)) {
|
if ((!receiveEnd) && (fInputBuffer.Size() == previousBufferSize)) {
|
||||||
fSocket->WaitForReadable();
|
|
||||||
BStackOrHeapArray<char, 4096> chunk(kHttpBufferSize);
|
BStackOrHeapArray<char, 4096> chunk(kHttpBufferSize);
|
||||||
bytesRead = fSocket->Read(chunk, kHttpBufferSize);
|
bytesRead = fSocket->Read(chunk, kHttpBufferSize);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user