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
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);
}