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 <[email protected]>
This commit is contained in:
@@ -272,7 +272,6 @@ BGopherRequest::_ProtocolLoop()
|
||||
BStackOrHeapArray<char, 4096> chunk(kGopherBufferSize);
|
||||
|
||||
while (!fQuit && !receiveEnd) {
|
||||
fSocket->WaitForReadable();
|
||||
bytesRead = fSocket->Read(chunk, kGopherBufferSize);
|
||||
|
||||
if (bytesRead < 0) {
|
||||
|
||||
Reference in New Issue
Block a user