diff options
author | Elijah Newren <newren@gmail.com> | 2023-04-16 06:03:05 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-19 00:01:04 +0300 |
commit | 331b094eec6d4c937af6e59df2a537112e4d8205 (patch) | |
tree | 38b6c65c15b9e719d026cd68917227920f78e268 | |
parent | 4711556905f381c01f1fbae205f67cfa673ab44a (diff) |
protocol.h: move definition of DEFAULT_GIT_PORT from cache.h
Michael J Gruber noticed that connection via the git:// protocol no
longer worked after a recent header clean-up. This was caused by
funny interaction of few gotchas. First, a necessary definition
#define DEFAULT_GIT_PORT 9418
was made invisible to a place where
const char *port = STR(DEFAULT_GIT_PORT);
was expecting to turn the integer into "9418" with a clever STR()
macro, and ended up stringifying it to
const char *port = "DEFAULT_GIT_PORT";
without giving any chance to compilers to notice such a mistake.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | cache.h | 21 | ||||
-rw-r--r-- | daemon.c | 1 | ||||
-rw-r--r-- | protocol.h | 21 |
3 files changed, 22 insertions, 21 deletions
@@ -40,27 +40,6 @@ /* - * Intensive research over the course of many years has shown that - * port 9418 is totally unused by anything else. Or - * - * Your search - "port 9418" - did not match any documents. - * - * as www.google.com puts it. - * - * This port has been properly assigned for git use by IANA: - * git (Assigned-9418) [I06-050728-0001]. - * - * git 9418/tcp git pack transfer service - * git 9418/udp git pack transfer service - * - * with Linus Torvalds <torvalds@osdl.org> as the point of - * contact. September 2005. - * - * See http://www.iana.org/assignments/port-numbers - */ -#define DEFAULT_GIT_PORT 9418 - -/* * Basic data structures for the directory cache */ @@ -4,6 +4,7 @@ #include "config.h" #include "environment.h" #include "pkt-line.h" +#include "protocol.h" #include "run-command.h" #include "setup.h" #include "strbuf.h" diff --git a/protocol.h b/protocol.h index cef1a4a01c..de66bf80f8 100644 --- a/protocol.h +++ b/protocol.h @@ -1,6 +1,27 @@ #ifndef PROTOCOL_H #define PROTOCOL_H +/* + * Intensive research over the course of many years has shown that + * port 9418 is totally unused by anything else. Or + * + * Your search - "port 9418" - did not match any documents. + * + * as www.google.com puts it. + * + * This port has been properly assigned for git use by IANA: + * git (Assigned-9418) [I06-050728-0001]. + * + * git 9418/tcp git pack transfer service + * git 9418/udp git pack transfer service + * + * with Linus Torvalds <torvalds@osdl.org> as the point of + * contact. September 2005. + * + * See http://www.iana.org/assignments/port-numbers + */ +#define DEFAULT_GIT_PORT 9418 + enum protocol_version { protocol_unknown_version = -1, protocol_v0 = 0, |