debian/diff: fix two regressions introduced by the SRV patch
commit7bb0285172fc8c2333d93f1c658628c6365371e0
authorJonathan Nieder <jrnieder@gmail.com>
Thu, 23 Jun 2011 11:25:15 +0000 (23 06:25 -0500)
committerJonathan Nieder <jrnieder@gmail.com>
Thu, 23 Jun 2011 11:31:57 +0000 (23 06:31 -0500)
tree057a19b8fbb3bea132405192450bc918c65113b3
parentdab89f3a9846b251d751dc9639bb455631785c54
debian/diff: fix two regressions introduced by the SRV patch

A few days ago, sourceforge.net returned a CNAME resource record (and
nothing else) in response to queries for _git._tcp.git.git.sf.net.
which would confuse "git fetch git://git.git.sf.net/" into thinking it
had encountered a malformed SRV RR and erroring out for no good reason
with the message

fatal: Unable to look up git.git.sf.net

Of course the problem was that the SRV code path was written without
alternate RR types in mind; fixing it to pay attention to the type of
each RR and skip the informative CNAME RRs at the beginning of a reply
fixes it.

Meanwhile, the SRV RR parser should provide better error messages, but
this update doesn't address that.

While investigating the above, it was noticed that the SRV patch had
also broken the error messages from ordinary A/AAAA lookups: they
should look like

fatal: Unable to look up git.example.com (port 9418) (Name or service not known)

but after that patch taught git to move on and try the next address
from a list, it forgot to save the error code, producing the confusing

fatal: unable to connect to a socket (Success)

This update partially fixes that, and now the message looks like

fatal: Unable to look up git.example.com: Name or service not known

The hostname printed is the name extracted from the argument to
git_tcp_connect_sock, not the particular server and port the error
message is associated to.  There's been some discussion and a rough
patch on-list to buffer all errors in resolve+connect loop and print
them all if no address succeeds, which would make this a little
easier; probably the next edition of the SRV patch series will use
that.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
debian/changelog
debian/diff/0010-transport-fix-index-in-ipv6-connection-failed-message.diff
debian/diff/0011-tcp-unify-ipv4-and-ipv6-code-paths.diff
debian/diff/0012-daemon-check-for-errors-retrieving-IP-address.diff [moved from debian/diff/0012-daemon-check-for-errors-retrieving-canonical-IP-addre.diff with 63% similarity]
debian/diff/0013-tcp-make-dns_resolve-return-an-error-code.diff [new file with mode: 0644]
debian/diff/0014-transport-honor-DNS-SRV-records.diff [moved from debian/diff/0013-transport-learn-to-honor-DNS-SRV-records.diff with 84% similarity]