{"thread":{"id":"19652","subject":"[JGIT PATCH] Send non-standard port in host header of git://","startedAt":"2009-06-03T17:15:30Z","lastAt":"2009-06-03T17:19:00Z","messageCount":2,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"115356","messageId":"1244049330-4019-1-git-send-email-spearce@spearce.org","threadId":"19652","inReplyTo":null,"subject":"[JGIT PATCH] Send non-standard port in host header of git://","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-06-03T17:15:30Z","receivedAt":"2009-06-03T17:15:30Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"On a git://host:port/path style URL, if port is not the IANA\nregistered port 9418 for git, the remote git daemon expects\nus to send \"\\0host=host:port\\0\" in the virtual host slot.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../spearce/jgit/transport/TransportGitAnon.java   |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java\nindex add7e2a..9edd93e 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java\n@@ -103,6 +103,10 @@ void service(final String name, final PacketLineOut pckOut)\n \t\tcmd.append('\\0');\n \t\tcmd.append(\"host=\");\n \t\tcmd.append(uri.getHost());\n+\t\tif (uri.getPort() != GIT_PORT) {\n+\t\t\tcmd.append(\":\");\n+\t\t\tcmd.append(uri.getPort());\n+\t\t}\n \t\tcmd.append('\\0');\n \t\tpckOut.writeString(cmd.toString());\n \t\tpckOut.flush();\n-- \n1.6.3.1.333.g3ebba7\n"},{"id":"115357","messageId":"20090603171900.GK3355@spearce.org","threadId":"19652","inReplyTo":"1244049330-4019-1-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH v2] Send non-standard port in host header of git://","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-06-03T17:19:00Z","receivedAt":"2009-06-03T17:19:00Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"On a git://host:port/path style URL, if port is not the IANA\nregistered port 9418 for git, the remote git daemon expects\nus to send \"\\0host=host:port\\0\" in the virtual host slot.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n Arrrgh.  v2 deals with the case when the port isn't in the URL at\n all, its <= 0, in which case its the default port, so we shouldn't\n send it to the server.\n\n Sorry.  :-)\n\n .../spearce/jgit/transport/TransportGitAnon.java   |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java\nindex add7e2a..0c80b9d 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java\n@@ -103,6 +103,10 @@ void service(final String name, final PacketLineOut pckOut)\n \t\tcmd.append('\\0');\n \t\tcmd.append(\"host=\");\n \t\tcmd.append(uri.getHost());\n+\t\tif (uri.getPort() > 0 && uri.getPort() != GIT_PORT) {\n+\t\t\tcmd.append(\":\");\n+\t\t\tcmd.append(uri.getPort());\n+\t\t}\n \t\tcmd.append('\\0');\n \t\tpckOut.writeString(cmd.toString());\n \t\tpckOut.flush();\n-- \n1.6.3.1.333.g3ebba7\n"}]}