mirror of
https://github.com/openssl/openssl.git
synced 2025-02-23 14:42:15 +08:00
Make BIO_do_connect() and friends handle multiple IP addresses
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11971)
This commit is contained in:
parent
60d3b5b9ff
commit
dc18e4ddfb
@ -188,8 +188,17 @@ static int conn_state(BIO *b, BIO_CONNECT *c)
|
||||
|
||||
case BIO_CONN_S_BLOCKED_CONNECT:
|
||||
i = BIO_sock_error(b->num);
|
||||
if (i) {
|
||||
if (i != 0) {
|
||||
BIO_clear_retry_flags(b);
|
||||
if ((c->addr_iter = BIO_ADDRINFO_next(c->addr_iter)) != NULL) {
|
||||
/*
|
||||
* if there are more addresses to try, do that first
|
||||
*/
|
||||
BIO_closesocket(b->num);
|
||||
c->state = BIO_CONN_S_CREATE_SOCKET;
|
||||
ERR_clear_error();
|
||||
break;
|
||||
}
|
||||
ERR_raise_data(ERR_LIB_SYS, i,
|
||||
"calling connect(%s, %s)",
|
||||
c->param_hostname, c->param_service);
|
||||
|
Loading…
Reference in New Issue
Block a user