From: Junio C Hamano Date: Thu, 26 May 2011 17:28:10 +0000 (-0700) Subject: Merge branch 'jk/git-connection-deadlock-fix' into maint-1.7.4 X-Git-Tag: v1.7.5.3~1^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bac9c06ba093d9254cb2ab3eed074722a3e635a6;p=git.git Merge branch 'jk/git-connection-deadlock-fix' into maint-1.7.4 * jk/git-connection-deadlock-fix: test core.gitproxy configuration send-pack: avoid deadlock on git:// push with failed pack-objects connect: let callers know if connection is a socket connect: treat generic proxy processes like ssh processes Conflicts: connect.c --- bac9c06ba093d9254cb2ab3eed074722a3e635a6 diff --cc cache.h index 342b4100f,724aad41b..5e9675d76 --- a/cache.h +++ b/cache.h @@@ -943,9 -863,9 +943,10 @@@ struct ref extern struct ref *find_ref_by_name(const struct ref *list, const char *name); #define CONNECT_VERBOSE (1u << 0) +extern char *git_getpass(const char *prompt); extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags); extern int finish_connect(struct child_process *conn); + extern int git_connection_is_socket(struct child_process *conn); extern int path_match(const char *path, int nr, char **match); struct extra_have_objects { int nr, alloc; diff --cc connect.c index 57dc20c43,9b31af02b..2119c3f74 --- a/connect.c +++ b/connect.c @@@ -395,14 -403,31 +395,15 @@@ static int git_use_proxy(const char *ho return (git_proxy_command && *git_proxy_command); } - static void git_proxy_connect(int fd[2], char *host) + static struct child_process *git_proxy_connect(int fd[2], char *host) { const char *port = STR(DEFAULT_GIT_PORT); - const char *argv[4]; - struct child_process proxy; - char *colon, *end; + const char **argv; + struct child_process *proxy; - if (host[0] == '[') { - end = strchr(host + 1, ']'); - if (end) { - *end = 0; - end++; - host++; - } else - end = host; - } else - end = host; - colon = strchr(end, ':'); - - if (colon) { - *colon = 0; - port = colon + 1; - } + get_host_and_port(&host, &port); + argv = xmalloc(sizeof(*argv) * 4); argv[0] = git_proxy_command; argv[1] = host; argv[2] = port;