lib: replace conn [write]sockfd members by index

The `connectdata` members `sockfd` and `writesockfd` needed to by either
CURL_SOCKET_BAD or a copy of one of `conn->sock[2]`. When equal to one,
that index was used to send/recv/poll the proper socket or connection
filter chain.

Replace those with `send_idx` and `recv_idx` which are either -1, 0 or 1
to indicate which socket/filter to send/receive on.

Closes #18179
This commit is contained in:
Stefan Eissing 2025-08-05 13:11:53 +02:00 committed by Daniel Stenberg
parent aec28f3ad3
commit 6d5570c4dd
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
9 changed files with 120 additions and 92 deletions

View file

@ -2704,8 +2704,6 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
if(result)
goto fail;
info_version = "HTTP/2";
/* There is no ALPN here, but the connection is now definitely h2 */
conn->httpversion_seen = 20;
}
else
info_version = "HTTP/1.x";