Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2011-05-17 04:18:39 +0000
committerGreg Wilkins2011-05-17 04:18:39 +0000
commit018a366f6da703fce2bab94921d40d1f85a5937b (patch)
treead0de2f8a332152df50ff46da7165f58d3655eba
parent6058e595d504118aa4c30cdded6c2c63e6f301bf (diff)
downloadorg.eclipse.jetty.project-018a366f6da703fce2bab94921d40d1f85a5937b.tar.gz
org.eclipse.jetty.project-018a366f6da703fce2bab94921d40d1f85a5937b.tar.xz
org.eclipse.jetty.project-018a366f6da703fce2bab94921d40d1f85a5937b.zip
345900 Handle ipv6 with default port
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3160 7e9141cc-0065-0410-87d8-b60c137991c4
-rw-r--r--VERSION.txt1
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/Request.java16
2 files changed, 12 insertions, 5 deletions
diff --git a/VERSION.txt b/VERSION.txt
index ee78aee1d6..4b9c98ba58 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -3,6 +3,7 @@ jetty-7.4.2-SNAPSHOT
+ 345615 Enable SSL Session caching
+ 345763 Source file is updated during the build
+ 345873 Update jetty-ssl.xml to new style
+ + 345900 Handle ipv6 with default port
+ 346014 Fixed full HttpGenerator
jetty-7.4.1.v20110513
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
index 5935ac3d8f..96af38530f 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
@@ -987,13 +987,19 @@ public class Request implements HttpServletRequest
Buffer hostPort = _connection.getRequestFields().get(HttpHeaders.HOST_BUFFER);
if (hostPort!=null)
{
- for (int i=hostPort.length();i-->0;)
+ loop:
+ for (int i=hostPort.putIndex();i-->hostPort.getIndex();)
{
- if (hostPort.peek(hostPort.getIndex()+i)==':')
+ char ch=(char)(0xff&hostPort.peek(i));
+ switch(ch)
{
- _serverName=BufferUtil.to8859_1_String(hostPort.peek(hostPort.getIndex(), i));
- _port=BufferUtil.toInt(hostPort.peek(hostPort.getIndex()+i+1, hostPort.length()-i-1));
- return _serverName;
+ case ']':
+ break loop;
+
+ case ':':
+ _serverName=BufferUtil.to8859_1_String(hostPort.peek(hostPort.getIndex(), i-hostPort.getIndex()));
+ _port=BufferUtil.toInt(hostPort.peek(i+1, hostPort.putIndex()-i-1));
+ return _serverName;
}
}
if (_serverName==null || _port<0)

Back to the top