Commit 6cf25a39 by Edward Thomson Committed by GitHub

Merge pull request #4219 from pks-t/pks/socket-stream-addrinfo-loop

socket_stream: continue to next addrinfo on socket creation failure
parents cecd41fb 954e06a8
...@@ -106,10 +106,8 @@ int socket_connect(git_stream *stream) ...@@ -106,10 +106,8 @@ int socket_connect(git_stream *stream)
for (p = info; p != NULL; p = p->ai_next) { for (p = info; p != NULL; p = p->ai_next) {
s = socket(p->ai_family, p->ai_socktype, p->ai_protocol); s = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
if (s == INVALID_SOCKET) { if (s == INVALID_SOCKET)
net_set_error("error creating socket"); continue;
break;
}
if (connect(s, p->ai_addr, (socklen_t)p->ai_addrlen) == 0) if (connect(s, p->ai_addr, (socklen_t)p->ai_addrlen) == 0)
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment