diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2007-03-27 09:50:20 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-03-27 13:00:13 -0700 |
commit | 608d48b2207a6152839a9762c7a66f217bceb440 (patch) | |
tree | 1468f079ac916dc4d06ff0ce25c390a8d948da99 /t/t3600-rm.sh | |
parent | 66d5871ead74ae363274f221c9fa5945c18c4aa2 (diff) | |
download | git-608d48b2207a6152839a9762c7a66f217bceb440.tar.gz git-608d48b2207a6152839a9762c7a66f217bceb440.tar.xz |
Fix "getaddrinfo()" buglet
At least in Linux glibc, "getaddrinfo()" has a very irritating feature (or
bug, who knows..).
Namely if you pass it in an empty string for the service name, it will
happily and quietly consider it identical to a NULL port pointer, and
return port number zero and no errors. Which obviously will not work.
Maybe that's what it's really expected to do, although the man-page for
getaddrinfo() certainly implies that it's a bug.
So when somebody passes me a "please pull" request pointing to something
like the following
git://git.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
(note the extraneous colon at the end of the host name), git would happily
try to connect to port 0, which would generally just cause the remote to
not even answer, and the "connect()" will take a long time to time out.
So to work around the glibc feature/bug, just notice this empty port case
automatically. Also, add the port information to the error information
when it fails to look up (maybe it's the host-name that fails, maybe it's
the port-name - we should print out both).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't/t3600-rm.sh')
0 files changed, 0 insertions, 0 deletions