Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--VERSION.txt2
-rw-r--r--jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnection.java28
-rw-r--r--jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnector.java6
-rw-r--r--jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedEndPoint.java41
4 files changed, 57 insertions, 20 deletions
diff --git a/VERSION.txt b/VERSION.txt
index 75e6f56be6..67737667e3 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1,5 +1,5 @@
jetty-7.4.1-SNAPSHOT
- + 343083 Set nested dispatch type.
+ + 343083 Set nested dispatch type and connection
+ 343277 add support for a context white list
+ 343352 make sure that jetty.osgi.boot is activated when a WAB is registered
diff --git a/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnection.java b/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnection.java
index 609c1109f0..5fcbdfb59f 100644
--- a/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnection.java
+++ b/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnection.java
@@ -33,45 +33,45 @@ import org.eclipse.jetty.util.log.Log;
public class NestedConnection extends HttpConnection
{
- protected NestedConnection(final NestedConnector connector, final NestedEndPoint endp, final HttpServletRequest request, HttpServletResponse response,String nestedIn)
+ protected NestedConnection(final NestedConnector connector, final NestedEndPoint endp, final HttpServletRequest outerRequest, HttpServletResponse outerResponse,String nestedIn)
throws IOException
{
super(connector,
endp,
connector.getServer(),
new NestedParser(),
- new NestedGenerator(connector.getResponseBuffers(),endp,response,nestedIn),
+ new NestedGenerator(connector.getResponseBuffers(),endp,outerResponse,nestedIn),
new NestedRequest());
((NestedRequest)_request).setConnection(this);
// Set the request line
_request.setDispatcherType(DispatcherType.REQUEST);
- _request.setScheme(request.getScheme());
- _request.setMethod(request.getMethod());
- String uri=request.getQueryString()==null?request.getRequestURI():(request.getRequestURI()+"?"+request.getQueryString());
+ _request.setScheme(outerRequest.getScheme());
+ _request.setMethod(outerRequest.getMethod());
+ String uri=outerRequest.getQueryString()==null?outerRequest.getRequestURI():(outerRequest.getRequestURI()+"?"+outerRequest.getQueryString());
_request.setUri(new HttpURI(uri));
- _request.setPathInfo(request.getRequestURI());
- _request.setQueryString(request.getQueryString());
- _request.setProtocol(request.getProtocol());
+ _request.setPathInfo(outerRequest.getRequestURI());
+ _request.setQueryString(outerRequest.getQueryString());
+ _request.setProtocol(outerRequest.getProtocol());
- _request.setAttribute("isSecure",new Boolean(request.isSecure()));
+ _request.setAttribute("isSecure",new Boolean(outerRequest.isSecure()));
// Set the headers
HttpFields fields = getRequestFields();
- for (Enumeration<String> e=request.getHeaderNames();e.hasMoreElements();)
+ for (Enumeration<String> e=outerRequest.getHeaderNames();e.hasMoreElements();)
{
String header=e.nextElement();
- String value=request.getHeader(header);
+ String value=outerRequest.getHeader(header);
fields.add(header,value);
}
- _request.setCookies(request.getCookies());
+ _request.setCookies(outerRequest.getCookies());
- for (Enumeration<String> e=request.getAttributeNames();e.hasMoreElements();)
+ for (Enumeration<String> e=outerRequest.getAttributeNames();e.hasMoreElements();)
{
String attr=e.nextElement();
- _request.setAttribute(attr,request.getAttribute(attr));
+ _request.setAttribute(attr,outerRequest.getAttribute(attr));
}
// System.err.println(_request.getMethod()+" "+_request.getUri()+" "+_request.getProtocol());
diff --git a/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnector.java b/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnector.java
index c4f870639c..b4efff3e26 100644
--- a/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnector.java
+++ b/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnector.java
@@ -72,9 +72,9 @@ public class NestedConnector extends AbstractConnector
*/
public void service(ServletRequest outerRequest, ServletResponse outerResponse) throws IOException, ServletException
{
- HttpServletRequest request = (HttpServletRequest)outerRequest;
- HttpServletResponse response = (HttpServletResponse)outerResponse;
- NestedConnection connection=new NestedConnection(this,new NestedEndPoint(request,response),request,response,_serverInfo);
+ HttpServletRequest outerServletRequest = (HttpServletRequest)outerRequest;
+ HttpServletResponse outerServletResponse = (HttpServletResponse)outerResponse;
+ NestedConnection connection=new NestedConnection(this,new NestedEndPoint(outerServletRequest,outerServletResponse),outerServletRequest,outerServletResponse,_serverInfo);
connection.service();
}
diff --git a/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedEndPoint.java b/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedEndPoint.java
index 5d65c563fc..30d7fbb790 100644
--- a/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedEndPoint.java
+++ b/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedEndPoint.java
@@ -25,15 +25,52 @@ import org.eclipse.jetty.io.bio.StreamEndPoint;
public class NestedEndPoint extends StreamEndPoint
{
- public NestedEndPoint(HttpServletRequest request, HttpServletResponse response)
+ private final HttpServletRequest _outerRequest;
+
+ public NestedEndPoint(HttpServletRequest outerRequest, HttpServletResponse outerResponse)
throws IOException
{
- super(request.getInputStream(),response.getOutputStream());
+ super(outerRequest.getInputStream(),outerResponse.getOutputStream());
+ _outerRequest=outerRequest;
}
public ServletInputStream getServletInputStream()
{
return (ServletInputStream)getInputStream();
}
+ @Override
+ public String getLocalAddr()
+ {
+ return _outerRequest.getLocalAddr();
+ }
+
+ @Override
+ public String getLocalHost()
+ {
+ return _outerRequest.getLocalName();
+ }
+
+ @Override
+ public int getLocalPort()
+ {
+ return _outerRequest.getLocalPort();
+ }
+ @Override
+ public String getRemoteAddr()
+ {
+ return _outerRequest.getRemoteAddr();
+ }
+
+ @Override
+ public String getRemoteHost()
+ {
+ // TODO Auto-generated method stub
+ return _outerRequest.getRemoteHost();
+ }
+ @Override
+ public int getRemotePort()
+ {
+ return _outerRequest.getRemotePort();
+ }
}

Back to the top