cfilters:Curl_conn_get_select_socks: use the first non-connected filter

When there are filters addded for both socket and SSL, the code
previously checked the SSL sockets during connect when it *should* first
check the socket layer until that has connected.

Fixes #10157
Fixes #10146
Closes #10160

Reviewed-by: Stefan Eissing
This commit is contained in:
Daniel Stenberg 2022-12-26 09:59:20 +01:00
parent 901392cbb7
commit 728400f875
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -437,6 +437,10 @@ int Curl_conn_get_select_socks(struct Curl_easy *data, int sockindex,
DEBUGASSERT(data);
DEBUGASSERT(data->conn);
cf = data->conn->cfilter[sockindex];
/* if the next one is not yet connected, that's the one we want */
while(cf && cf->next && !cf->next->connected)
cf = cf->next;
if(cf) {
return cf->cft->get_select_socks(cf, data, socks);
}