Skip to content

Commit 331b094

Browse files
newrengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4711556 commit 331b094

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

cache.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,6 @@
3939
#define S_DIFFTREE_IFXMIN_NEQ 0x80000000
4040

4141

42-
/*
43-
* Intensive research over the course of many years has shown that
44-
* port 9418 is totally unused by anything else. Or
45-
*
46-
* Your search - "port 9418" - did not match any documents.
47-
*
48-
* as www.google.com puts it.
49-
*
50-
* This port has been properly assigned for git use by IANA:
51-
* git (Assigned-9418) [I06-050728-0001].
52-
*
53-
* git 9418/tcp git pack transfer service
54-
* git 9418/udp git pack transfer service
55-
*
56-
* with Linus Torvalds <[email protected]> as the point of
57-
* contact. September 2005.
58-
*
59-
* See http://www.iana.org/assignments/port-numbers
60-
*/
61-
#define DEFAULT_GIT_PORT 9418
62-
6342
/*
6443
* Basic data structures for the directory cache
6544
*/

daemon.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "config.h"
55
#include "environment.h"
66
#include "pkt-line.h"
7+
#include "protocol.h"
78
#include "run-command.h"
89
#include "setup.h"
910
#include "strbuf.h"

protocol.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
#ifndef PROTOCOL_H
22
#define PROTOCOL_H
33

4+
/*
5+
* Intensive research over the course of many years has shown that
6+
* port 9418 is totally unused by anything else. Or
7+
*
8+
* Your search - "port 9418" - did not match any documents.
9+
*
10+
* as www.google.com puts it.
11+
*
12+
* This port has been properly assigned for git use by IANA:
13+
* git (Assigned-9418) [I06-050728-0001].
14+
*
15+
* git 9418/tcp git pack transfer service
16+
* git 9418/udp git pack transfer service
17+
*
18+
* with Linus Torvalds <[email protected]> as the point of
19+
* contact. September 2005.
20+
*
21+
* See http://www.iana.org/assignments/port-numbers
22+
*/
23+
#define DEFAULT_GIT_PORT 9418
24+
425
enum protocol_version {
526
protocol_unknown_version = -1,
627
protocol_v0 = 0,

0 commit comments

Comments
 (0)