git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] connect: display connection progress
@ 2007-05-06 19:52 Michael S. Tsirkin
  2007-05-06 20:41 ` Junio C Hamano
  2007-05-06 22:21 ` [PATCH] " Alex Riesen
  0 siblings, 2 replies; 21+ messages in thread
From: Michael S. Tsirkin @ 2007-05-06 19:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2007-05-10 19:29 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-06 19:52 [PATCH] connect: display connection progress Michael S. Tsirkin
2007-05-06 20:41 ` Junio C Hamano
2007-05-07  4:20   ` Michael S. Tsirkin
2007-05-10  9:51   ` [PATCHv2] " Michael S. Tsirkin
2007-05-10 11:39     ` Alex Riesen
2007-05-10 12:08       ` Michael S. Tsirkin
2007-05-10 12:19         ` Alex Riesen
2007-05-10 12:25           ` Michael S. Tsirkin
2007-05-10 13:33             ` Alex Riesen
2007-05-10 13:46               ` Michael S. Tsirkin
2007-05-10 14:16                 ` Alex Riesen
2007-05-10 14:39                   ` Michael S. Tsirkin
2007-05-10 14:52                     ` Alex Riesen
2007-05-10 15:02                       ` Michael S. Tsirkin
2007-05-10 17:40                         ` Alex Riesen
2007-05-10 19:29         ` Junio C Hamano
2007-05-10 16:05       ` Linus Torvalds
2007-05-10 17:38         ` Alex Riesen
2007-05-06 22:21 ` [PATCH] " Alex Riesen
2007-05-07  4:54   ` Michael S. Tsirkin
2007-05-07  7:51     ` Alex Riesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).