git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [JGIT PATCH] Send non-standard port in host header of git://
@ 2009-06-03 17:15 Shawn O. Pearce
  2009-06-03 17:19 ` [JGIT PATCH v2] " Shawn O. Pearce
  0 siblings, 1 reply; 2+ messages in thread
From: Shawn O. Pearce @ 2009-06-03 17:15 UTC (permalink / raw)
  To: Robin Rosenberg; +Cc: git

On a git://host:port/path style URL, if port is not the IANA
registered port 9418 for git, the remote git daemon expects
us to send "\0host=host:port\0" in the virtual host slot.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 .../spearce/jgit/transport/TransportGitAnon.java   |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java
index add7e2a..9edd93e 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java
@@ -103,6 +103,10 @@ void service(final String name, final PacketLineOut pckOut)
 		cmd.append('\0');
 		cmd.append("host=");
 		cmd.append(uri.getHost());
+		if (uri.getPort() != GIT_PORT) {
+			cmd.append(":");
+			cmd.append(uri.getPort());
+		}
 		cmd.append('\0');
 		pckOut.writeString(cmd.toString());
 		pckOut.flush();
-- 
1.6.3.1.333.g3ebba7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [JGIT PATCH v2] Send non-standard port in host header of git://
  2009-06-03 17:15 [JGIT PATCH] Send non-standard port in host header of git:// Shawn O. Pearce
@ 2009-06-03 17:19 ` Shawn O. Pearce
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn O. Pearce @ 2009-06-03 17:19 UTC (permalink / raw)
  To: Robin Rosenberg; +Cc: git

On a git://host:port/path style URL, if port is not the IANA
registered port 9418 for git, the remote git daemon expects
us to send "\0host=host:port\0" in the virtual host slot.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 Arrrgh.  v2 deals with the case when the port isn't in the URL at
 all, its <= 0, in which case its the default port, so we shouldn't
 send it to the server.

 Sorry.  :-)

 .../spearce/jgit/transport/TransportGitAnon.java   |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java
index add7e2a..0c80b9d 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitAnon.java
@@ -103,6 +103,10 @@ void service(final String name, final PacketLineOut pckOut)
 		cmd.append('\0');
 		cmd.append("host=");
 		cmd.append(uri.getHost());
+		if (uri.getPort() > 0 && uri.getPort() != GIT_PORT) {
+			cmd.append(":");
+			cmd.append(uri.getPort());
+		}
 		cmd.append('\0');
 		pckOut.writeString(cmd.toString());
 		pckOut.flush();
-- 
1.6.3.1.333.g3ebba7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-03 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-03 17:15 [JGIT PATCH] Send non-standard port in host header of git:// Shawn O. Pearce
2009-06-03 17:19 ` [JGIT PATCH v2] " Shawn O. Pearce

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).