version 1.312, 2019/01/24 17:00:29 |
version 1.313, 2019/02/01 03:52:23 |
|
|
struct sockaddr_storage *hostaddr, u_short port, int family, |
struct sockaddr_storage *hostaddr, u_short port, int family, |
int connection_attempts, int *timeout_ms, int want_keepalive) |
int connection_attempts, int *timeout_ms, int want_keepalive) |
{ |
{ |
int on = 1; |
int on = 1, saved_timeout_ms = *timeout_ms; |
int oerrno, sock = -1, attempt; |
int oerrno, sock = -1, attempt; |
char ntop[NI_MAXHOST], strport[NI_MAXSERV]; |
char ntop[NI_MAXHOST], strport[NI_MAXSERV]; |
struct addrinfo *ai; |
struct addrinfo *ai; |
|
|
continue; |
continue; |
} |
} |
|
|
|
*timeout_ms = saved_timeout_ms; |
if (timeout_connect(sock, ai->ai_addr, ai->ai_addrlen, |
if (timeout_connect(sock, ai->ai_addr, ai->ai_addrlen, |
timeout_ms) >= 0) { |
timeout_ms) >= 0) { |
/* Successful connection. */ |
/* Successful connection. */ |