From: Junio C Hamano <gitster@pobox.com>
To: "Medve Emilian" <Emilian.Medve@freescale.com>
Cc: <git@vger.kernel.org>
Subject: Re: git-daemon
Date: Mon, 19 Nov 2007 14:23:41 -0800 [thread overview]
Message-ID: <7vbq9pnac2.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <598D5675D34BE349929AF5EDE9B03E27017BCC42@az33exm24.fsl.freescale.net> (Medve Emilian's message of "Mon, 19 Nov 2007 14:13:12 -0700")
"Medve Emilian" <Emilian.Medve@freescale.com> writes:
> It seems that something changed since maint/v.1.5.3.6 such that on
> master and next git-daemon doesn't seem to be working anymore in inetd
> mode. Can somebody please confirm this?
Sorry, I cannot quite parse. Do you mean:
master and next used to work. Recently 'maint' was
merged to them after v1.5.3.6 was cut. master and next
does not work anymore after that.
Or do you mean:
maint (specifically at v1.5.3.6) works, but master and
next contain more changes on top of them, and they do
not work.
In either case, the only change to the daemon code between
v1.5.3.5 and master is this one:
commit c67359be45be74e1056d6293c6bb09ee6d00a54a
Author: Gerrit Pape <pape@smarden.org>
Date: Mon Nov 5 09:16:22 2007 +0000
git-daemon: fix remote port number in log entry
The port number in struct sockaddr_in needs to be converted from network
byte order to host byte order (on some architectures).
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
daemon.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/daemon.c b/daemon.c
index 660e155..b8df980 100644
--- a/daemon.c
+++ b/daemon.c
@@ -540,7 +540,7 @@ static int execute(struct sockaddr *addr)
if (addr->sa_family == AF_INET) {
struct sockaddr_in *sin_addr = (void *) addr;
inet_ntop(addr->sa_family, &sin_addr->sin_addr, addrbuf, sizeof(addrbuf));
- port = sin_addr->sin_port;
+ port = ntohs(sin_addr->sin_port);
#ifndef NO_IPV6
} else if (addr && addr->sa_family == AF_INET6) {
struct sockaddr_in6 *sin6_addr = (void *) addr;
@@ -550,7 +550,7 @@ static int execute(struct sockaddr *addr)
inet_ntop(AF_INET6, &sin6_addr->sin6_addr, buf, sizeof(addrbuf) - 1);
strcat(buf, "]");
- port = sin6_addr->sin6_port;
+ port = ntohs(sin6_addr->sin6_port);
#endif
}
loginfo("Connection from %s:%d", addrbuf, port);
I do not see anything wrong in it. The "port" variable is very
local to this function and is used only for that loginfo() call
at the end of the context. So I am quite puzzled.
We have another irrelevant style change that is full of things
like this, but I do not think that makes any behaviour
difference either.
@@ -406,7 +406,8 @@ static struct daemon_service daemon_service[] = {
{ "receive-pack", "receivepack", receive_pack, 0, 1 },
};
-static void enable_service(const char *name, int ena) {
+static void enable_service(const char *name, int ena)
+{
int i;
for (i = 0; i < ARRAY_SIZE(daemon_service); i++) {
if (!strcmp(daemon_service[i].name, name)) {
next prev parent reply other threads:[~2007-11-19 22:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-19 21:13 git-daemon Medve Emilian
2007-11-19 22:23 ` Junio C Hamano [this message]
2007-11-19 22:49 ` git-daemon Medve Emilian
2007-11-20 5:07 ` git-daemon Jeff King
2007-11-20 16:54 ` git-daemon Medve Emilian
2007-11-20 18:26 ` git-daemon Jeff King
2007-11-20 22:04 ` git-daemon Medve Emilian
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=7vbq9pnac2.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Emilian.Medve@freescale.com \
--cc=git@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).