multi: pollset adjust, init with FIRSTSOCKET during connect

- `conn->sockfd` is set by `Curl_setup_transfer()`, but that
  is called *after* the connection has been established
- use `conn->sock[FIRSTSOCKET]` instead

Follow-up to a0f94800d5
Closes #12664
This commit is contained in:
Stefan Eissing 2024-01-09 09:29:34 +01:00 committed by Daniel Stenberg
parent 6d9bf0db7e
commit 48d86999af
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -998,9 +998,11 @@ static int connecting_getsock(struct Curl_easy *data, curl_socket_t *socks)
{
struct connectdata *conn = data->conn;
(void)socks;
if(conn && conn->sockfd != CURL_SOCKET_BAD) {
/* Not using `conn->sockfd` as `Curl_setup_transfer()` initializes
* that *after* the connect. */
if(conn && conn->sock[FIRSTSOCKET] != CURL_SOCKET_BAD) {
/* Default is to wait to something from the server */
socks[0] = conn->sockfd;
socks[0] = conn->sock[FIRSTSOCKET];
return GETSOCK_READSOCK(0);
}
return GETSOCK_BLANK;