transfer: avoid polling socket every transfer loop

Improve download performance, minimal effort.

Do not poll the socket for pending data every transfer loop iteration.
This gives 10-20% performance gains on large HTTP/1.1 downloads (on my
machine).

Closes #14098
This commit is contained in:
Stefan Eissing 2024-07-04 11:14:05 +02:00 committed by Daniel Stenberg
parent 2583d11f22
commit b8e098a057
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -336,7 +336,7 @@ static CURLcode readwrite_data(struct Curl_easy *data,
if((k->keepon & KEEP_RECV_PAUSE) || !(k->keepon & KEEP_RECV))
break;
} while(maxloops-- && data_pending(data));
} while(maxloops--);
if((maxloops <= 0) || data_pending(data)) {
/* did not read until EAGAIN or there is still pending data, mark as