Skip to content

Commit 6cf25a3

Browse files
authored
Merge pull request libgit2#4219 from pks-t/pks/socket-stream-addrinfo-loop
socket_stream: continue to next addrinfo on socket creation failure
2 parents cecd41f + 954e06a commit 6cf25a3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/socket_stream.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,8 @@ int socket_connect(git_stream *stream)
106106
for (p = info; p != NULL; p = p->ai_next) {
107107
s = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
108108

109-
if (s == INVALID_SOCKET) {
110-
net_set_error("error creating socket");
111-
break;
112-
}
109+
if (s == INVALID_SOCKET)
110+
continue;
113111

114112
if (connect(s, p->ai_addr, (socklen_t)p->ai_addrlen) == 0)
115113
break;

0 commit comments

Comments
 (0)