mirror of
https://github.com/curl/curl.git
synced 2026-06-01 22:14:17 +03:00
multi: fix polling with pending input
When multi creates the pollset of a transfer, it checks now if a connection (FIRST/SECONDARY) socket waits on POLLIN and has input data pending in filters (relevant to OpenSSL's new read ahead). If so, it triggers a timeout on the transfer via EXPIRE_RUN_NOW. This fixes sporadic stalls in test 988 when running event based. Closes #17636
This commit is contained in:
parent
739c09c8a4
commit
62349e45a8
3 changed files with 32 additions and 0 deletions
12
lib/multi.c
12
lib/multi.c
|
|
@ -1038,6 +1038,18 @@ void Curl_multi_getsock(struct Curl_easy *data,
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Waiting to receive with buffered input.
|
||||
* Make transfer run again at next opportunity. */
|
||||
if((Curl_pollset_want_read(data, ps, data->conn->sock[FIRSTSOCKET]) &&
|
||||
Curl_conn_data_pending(data, FIRSTSOCKET)) ||
|
||||
(Curl_pollset_want_read(data, ps, data->conn->sock[SECONDARYSOCKET]) &&
|
||||
Curl_conn_data_pending(data, SECONDARYSOCKET))) {
|
||||
CURL_TRC_M(data, "%s pollset[] has POLLIN, but there is still "
|
||||
"buffered input to consume -> EXPIRE_RUN_NOW", caller);
|
||||
Curl_expire(data, 0, EXPIRE_RUN_NOW);
|
||||
}
|
||||
|
||||
switch(ps->num) {
|
||||
case 0:
|
||||
CURL_TRC_M(data, "%s pollset[], timeouts=%zu, paused %d/%d (r/w)",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue