mirror of
https://github.com/curl/curl.git
synced 2026-08-04 21:56:14 +03:00
cf-socket: make socket data_pending a nop
Eliminating the socket readability check in the socket connection filters for the 'data_pending' callback. Improves performance of handling of transfers, up to ~30%, depending on parallelism and response size. Whatever `data_pending()` once was, its semantics are now: "Is there anything buffered in the connection filters that needs receive?" Any checks of the socket's readability are done via `multi_wait()` and friends. Fix the one place in HTTP/1 proxy code that checked `data_pending()` and did an early return if false. Remove that check and actually try to receive data every time. Closes #17785
This commit is contained in:
parent
a487a4e4bd
commit
21ecc7e376
5 changed files with 116 additions and 85 deletions
|
|
@ -1404,17 +1404,6 @@ static void cf_socket_adjust_pollset(struct Curl_cfilter *cf,
|
|||
}
|
||||
}
|
||||
|
||||
static bool cf_socket_data_pending(struct Curl_cfilter *cf,
|
||||
const struct Curl_easy *data)
|
||||
{
|
||||
struct cf_socket_ctx *ctx = cf->ctx;
|
||||
int readable;
|
||||
|
||||
(void)data;
|
||||
readable = SOCKET_READABLE(ctx->sock, 0);
|
||||
return readable > 0 && (readable & CURL_CSELECT_IN);
|
||||
}
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
|
||||
#ifndef SIO_IDEAL_SEND_BACKLOG_QUERY
|
||||
|
|
@ -1750,7 +1739,7 @@ struct Curl_cftype Curl_cft_tcp = {
|
|||
cf_socket_close,
|
||||
cf_socket_shutdown,
|
||||
cf_socket_adjust_pollset,
|
||||
cf_socket_data_pending,
|
||||
Curl_cf_def_data_pending,
|
||||
cf_socket_send,
|
||||
cf_socket_recv,
|
||||
cf_socket_cntrl,
|
||||
|
|
@ -1904,7 +1893,7 @@ struct Curl_cftype Curl_cft_udp = {
|
|||
cf_socket_close,
|
||||
cf_socket_shutdown,
|
||||
cf_socket_adjust_pollset,
|
||||
cf_socket_data_pending,
|
||||
Curl_cf_def_data_pending,
|
||||
cf_socket_send,
|
||||
cf_socket_recv,
|
||||
cf_socket_cntrl,
|
||||
|
|
@ -1958,7 +1947,7 @@ struct Curl_cftype Curl_cft_unix = {
|
|||
cf_socket_close,
|
||||
cf_socket_shutdown,
|
||||
cf_socket_adjust_pollset,
|
||||
cf_socket_data_pending,
|
||||
Curl_cf_def_data_pending,
|
||||
cf_socket_send,
|
||||
cf_socket_recv,
|
||||
cf_socket_cntrl,
|
||||
|
|
@ -2178,7 +2167,7 @@ struct Curl_cftype Curl_cft_tcp_accept = {
|
|||
cf_socket_close,
|
||||
cf_socket_shutdown,
|
||||
cf_socket_adjust_pollset,
|
||||
cf_socket_data_pending,
|
||||
Curl_cf_def_data_pending,
|
||||
cf_socket_send,
|
||||
cf_socket_recv,
|
||||
cf_socket_cntrl,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue