From 0d0f613f17f9e06519ce5921145e69f0252ca546 Mon Sep 17 00:00:00 2001 From: Leorize Date: Thu, 16 Jul 2020 00:10:34 -0500 Subject: [PATCH] GopherRequest: Don't wait for socket to be readable Instead we can trigger a Read() immediately, as our socket is blocking and won't return until some data has been made available. This avoids a potentially costly syscall in the loop body. Change-Id: I899f55ede41af7cb7e9311aa04006b33c40d3ee4 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3076 Reviewed-by: waddlesplash --- src/kits/network/libnetapi/GopherRequest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/kits/network/libnetapi/GopherRequest.cpp b/src/kits/network/libnetapi/GopherRequest.cpp index 6c1fca7e95..9e5765456f 100644 --- a/src/kits/network/libnetapi/GopherRequest.cpp +++ b/src/kits/network/libnetapi/GopherRequest.cpp @@ -272,7 +272,6 @@ BGopherRequest::_ProtocolLoop() BStackOrHeapArray chunk(kGopherBufferSize); while (!fQuit && !receiveEnd) { - fSocket->WaitForReadable(); bytesRead = fSocket->Read(chunk, kGopherBufferSize); if (bytesRead < 0) {