From b82adb9e7978945d8e1177d2734c2060116bfabe Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 8 Apr 2010 12:19:03 +0000 Subject: [PATCH] 297104 Improve handling of CONNECT method git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1489 7e9141cc-0065-0410-87d8-b60c137991c4 --- VERSION.txt | 1 + .../java/org/eclipse/jetty/http/HttpURI.java | 76 +++++++++++++++++++ .../eclipse/jetty/server/HttpConnection.java | 17 ++++- .../jetty/server/HttpConnectionTest.java | 25 ++++++ .../org/eclipse/jetty/server/HttpURITest.java | 31 ++++++++ 5 files changed, 147 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index b20257c556f..6e4f2edf805 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,6 +1,7 @@ jetty-7.1-SNAPSHOT + 294563 Websocket client connection + + 297104 Improve handling of CONNECT method + 306349 ProxyServlet does not work unless deployed at / + 307847 Fixed combining mime type parameters + 307898 Handle large/async websocket messages diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java index 47c67c1a483..52b7b57cc59 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java @@ -15,6 +15,8 @@ package org.eclipse.jetty.http; import java.io.UnsupportedEncodingException; +import javax.net.ssl.HostnameVerifier; + import org.eclipse.jetty.util.MultiMap; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.TypeUtil; @@ -110,6 +112,80 @@ public class HttpURI parse2(raw,offset,length); } + + public void parseConnect(byte[] raw,int offset, int length) + { + _rawString=null; + _encoded=false; + _raw=raw; + int i=offset; + int e=offset+length; + int state=AUTH; + int m=offset; + _end=offset+length; + _scheme=offset; + _authority=offset; + _host=offset; + _port=_end; + _portValue=-1; + _path=_end; + _param=_end; + _query=_end; + _fragment=_end; + + loop: while (i