Commit 6cf25a397e88acc37e86e978b24b6470d6764c9d

Edward Thomson 2017-04-26T09:09:53

Merge pull request #4219 from pks-t/pks/socket-stream-addrinfo-loop socket_stream: continue to next addrinfo on socket creation failure

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/socket_stream.c b/src/socket_stream.c
index fca4117..c0a1684 100644
--- a/src/socket_stream.c
+++ b/src/socket_stream.c
@@ -106,10 +106,8 @@ int socket_connect(git_stream *stream)
 	for (p = info; p != NULL; p = p->ai_next) {
 		s = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
 
-		if (s == INVALID_SOCKET) {
-			net_set_error("error creating socket");
-			break;
-		}
+		if (s == INVALID_SOCKET)
+			continue;
 
 		if (connect(s, p->ai_addr, (socklen_t)p->ai_addrlen) == 0)
 			break;