From: Benjamin Kramer <benny.kra@googlemail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, mike@codeweavers.com
Subject: Re: [PATCH] imap-send: add support for IPv6
Date: Wed, 27 May 2009 12:50:11 +0200 [thread overview]
Message-ID: <4A1D1AE3.9030900@googlemail.com> (raw)
In-Reply-To: <7v7i03kqjq.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> We already use %h length specifier to explicitly say the parameter is
> a short in the IPV4 part of this program, so I am sure this won't regress
> anything for people, but I wonder what the point of it is... (I am not
> asking nor even suggesting to change this, by the way).
getaddrinfo(3) takes the port as a string so we have to convert it. I tried
to match the style of the existing code with the format string. The portstr
buffer is 6 chars long so the highest possible unsigned short 65535 fits in
exactly.
> It is Ok for now (as existing codepath liberally uses fprintf() and
> fputs() to report errors), but ideally we should start converting these to
> error() calls, I think, in a follow-up patch.
Looking at the number of fprintfs in imap-send.c a simple search/replace
probably won't do the job here. I tried to contact the original author but
his mail address seems to be dead ...
> Is forcing to NUMERICHOST done to match IPV4 codepath that does
> inet_ntoa()? I guess that makes sense.
We need to get the IP string, otherwise the output of imap-send would
make no sense. Here's what imap-send outputs when I try to connect to
localhost.
Without the patch:
Resolving localhost... ok
Connecting to 127.0.0.1:993... connect: Connection refused
With the patch:
Resolving localhost... ok
Connecting to [::1]:993... connect: Connection refused
Connecting to [fe80::1%lo0]:993... connect: Connection refused
Connecting to [127.0.0.1]:993... connect: Connection refused
Error: unable to connect to server.
Using the hostname instead of the IP address here wouldn't be very useful.
prev parent reply other threads:[~2009-05-27 10:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-25 19:13 [PATCH] imap-send: add support for IPv6 Benjamin Kramer
2009-05-27 6:28 ` Junio C Hamano
2009-05-27 10:50 ` Benjamin Kramer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A1D1AE3.9030900@googlemail.com \
--to=benny.kra@googlemail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mike@codeweavers.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.