Commit e03cc83491255ff69034ff6c824f9ba6062fcddd

Stefan Sperling 2020-09-24T16:47:06

handle failed connection attempts to git:// servers; patch by jrick

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/lib/fetch.c b/lib/fetch.c
index d82e0a4..3bdd5de 100644
--- a/lib/fetch.c
+++ b/lib/fetch.c
@@ -171,8 +171,10 @@ dial_git(int *fetchfd, const char *host, const char *port, const char *path,
 		if ((fd = socket(p->ai_family, p->ai_socktype,
 		    p->ai_protocol)) == -1)
 			continue;
-		if (connect(fd, p->ai_addr, p->ai_addrlen) == 0)
+		if (connect(fd, p->ai_addr, p->ai_addrlen) == 0) {
+			err = NULL;
 			break;
+		}
 		err = got_error_from_errno("connect");
 		close(fd);
 	}