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>