[PATCH] connect: display connection progress

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <junkio@...>
Cc: <git@...>
Date: Sunday, May 6, 2007 - 3:52 pm

Make git notify the user about host resolution/connection attempts.  This
is useful both as a progress indicator on slow links, and helps reassure the
user there are no DNS/firewall problems.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>

---

I find the following useful.
This currently only covers native git protocol. I expect it would
be easy to extend this to other protocols, if there's interest.
Opinions?

diff --git a/connect.c b/connect.c
index da89c9c..f026713 100644
--- a/connect.c
+++ b/connect.c
@@ -425,9 +425,11 @@ static int git_tcp_connect_sock(char *host)
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_protocol = IPPROTO_TCP;
 
+	fprintf(stderr, "Looking up %s ... ", host);
 	gai = getaddrinfo(host, port, &hints, &ai);
 	if (gai)
 		die("Unable to look up %s (port %s) (%s)", host, port, gai_strerror(gai));
+	fprintf(stderr, "done.\nConnecting to %s (port %s) ... ", host, port);
 
 	for (ai0 = ai; ai; ai = ai->ai_next) {
 		sockfd = socket(ai->ai_family,
@@ -450,6 +452,8 @@ static int git_tcp_connect_sock(char *host)
 	if (sockfd < 0)
 		die("unable to connect a socket (%s)", strerror(saved_errno));
 
+	fprintf(stderr, "done.\n");
+
 	return sockfd;
 }
 
-- 
MST
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] connect: display connection progress, Michael S. Tsirkin, (Sun May 6, 3:52 pm)
Re: [PATCH] connect: display connection progress, Alex Riesen, (Sun May 6, 6:21 pm)
Re: [PATCH] connect: display connection progress, Michael S. Tsirkin, (Mon May 7, 12:54 am)
Re: [PATCH] connect: display connection progress, Alex Riesen, (Mon May 7, 3:51 am)
Re: [PATCH] connect: display connection progress, Junio C Hamano, (Sun May 6, 4:41 pm)
[PATCHv2] connect: display connection progress, Michael S. Tsirkin, (Thu May 10, 5:51 am)
Re: [PATCHv2] connect: display connection progress, Alex Riesen, (Thu May 10, 7:39 am)
Re: [PATCHv2] connect: display connection progress, Linus Torvalds, (Thu May 10, 12:05 pm)
Re: [PATCHv2] connect: display connection progress, Alex Riesen, (Thu May 10, 1:38 pm)
Re: [PATCHv2] connect: display connection progress, Michael S. Tsirkin, (Thu May 10, 8:08 am)
Re: [PATCHv2] connect: display connection progress, Junio C Hamano, (Thu May 10, 3:29 pm)
Re: [PATCHv2] connect: display connection progress, Alex Riesen, (Thu May 10, 8:19 am)
Re: [PATCHv2] connect: display connection progress, Michael S. Tsirkin, (Thu May 10, 8:25 am)
Re: [PATCHv2] connect: display connection progress, Alex Riesen, (Thu May 10, 9:33 am)
Re: [PATCHv2] connect: display connection progress, Michael S. Tsirkin, (Thu May 10, 9:46 am)
Re: [PATCHv2] connect: display connection progress, Alex Riesen, (Thu May 10, 10:16 am)
Re: [PATCHv2] connect: display connection progress, Michael S. Tsirkin, (Thu May 10, 10:39 am)
Re: [PATCHv2] connect: display connection progress, Alex Riesen, (Thu May 10, 10:52 am)
Re: [PATCHv2] connect: display connection progress, Michael S. Tsirkin, (Thu May 10, 11:02 am)
Re: [PATCHv2] connect: display connection progress, Alex Riesen, (Thu May 10, 1:40 pm)
Re: [PATCH] connect: display connection progress, Michael S. Tsirkin, (Mon May 7, 12:20 am)