multi: fix pollset during RESOLVING phase

- add a DEBUGASSERT for when a transfer's pollset should not be empty.
- move write unpausing from transfer loop into curl_easy_pause. This
  make sure that the url_updatesocket() finds the correct state when
  updating socket events.
- fix HTTP/2 proxy during connect phase to set sockets correctly
- fix test2600 to simulate a socket set
- move write unpausing from transfer loop into curl_easy_pause. This
  make sure that the url_updatesocket() finds the correct state when
  updating socket events.
- waiting for the resolver to deliver might not involve any sockets to
  wait for. Do not generate a warning.

Fixes #14047
Closes #14074
This commit is contained in:
Stefan Eissing 2024-07-01 14:56:27 +02:00 committed by Daniel Stenberg
parent 75763a3e88
commit 480883cf27
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 28 additions and 12 deletions

View file

@ -1144,7 +1144,9 @@ static void multi_getsock(struct Curl_easy *data,
case MSTATE_RESOLVING:
Curl_pollset_add_socks(data, ps, Curl_resolv_getsock);
/* connection filters are not involved in this phase */
/* connection filters are not involved in this phase. It's ok if we get no
* sockets to wait for. Resolving can wake up from other sources. */
expect_sockets = FALSE;
break;
case MSTATE_CONNECTING:
@ -1195,8 +1197,10 @@ static void multi_getsock(struct Curl_easy *data,
break;
}
if(expect_sockets && !ps->num && !Curl_xfer_is_blocked(data)) {
if(expect_sockets && !ps->num &&
!(data->req.keepon & (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE))) {
infof(data, "WARNING: no socket in pollset, transfer may stall!");
DEBUGASSERT(0);
}
}