Author: markt
Date: Thu Oct 15 19:14:43 2015
New Revision: 1708869
URL: http://svn.apache.org/viewvc?rev=1708869&view=rev
Log:
Move the path parameters to the Coyote request so it is easier for HTTP/2 push
requests to inject them.
Modified:
tomcat/trunk/java/org/apache/catalina/connector/Request.java
tomcat/trunk/java/org/apache/coyote/Request.java
Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1708869&r1=1708868&r2=1708869&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Thu Oct 15
19:14:43 2015
@@ -407,20 +407,14 @@ public class Request implements HttpServ
protected Boolean asyncSupported = null;
- /**
- * Path parameters
- */
- protected final Map<String,String> pathParameters = new HashMap<>();
-
// --------------------------------------------------------- Public Methods
-
protected void addPathParameter(String name, String value) {
- pathParameters.put(name, value);
+ coyoteRequest.addPathParameter(name, value);
}
protected String getPathParameter(String name) {
- return pathParameters.get(name);
+ return coyoteRequest.getPathParameter(name);
}
public void setAsyncSupported(boolean asyncSupported) {
@@ -513,8 +507,6 @@ public class Request implements HttpServ
asyncContext.recycle();
}
asyncContext = null;
-
- pathParameters.clear();
}
Modified: tomcat/trunk/java/org/apache/coyote/Request.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/Request.java?rev=1708869&r1=1708868&r2=1708869&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/Request.java (original)
+++ tomcat/trunk/java/org/apache/coyote/Request.java Thu Oct 15 19:14:43 2015
@@ -18,6 +18,7 @@ package org.apache.coyote;
import java.io.IOException;
import java.util.HashMap;
+import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.servlet.ReadListener;
@@ -97,6 +98,12 @@ public final class Request {
private final MimeHeaders headers = new MimeHeaders();
+
+ /**
+ * Path parameters
+ */
+ private final Map<String,String> pathParameters = new HashMap<>();
+
/**
* Notes.
*/
@@ -399,6 +406,15 @@ public final class Request {
}
+ public void addPathParameter(String name, String value) {
+ pathParameters.put(name, value);
+ }
+
+ public String getPathParameter(String name) {
+ return pathParameters.get(name);
+ }
+
+
// -------------------- Other attributes --------------------
// We can use notes for most - need to discuss what is of general interest
@@ -551,6 +567,7 @@ public final class Request {
serverCookies.recycle();
parameters.recycle();
+ pathParameters.clear();
uriMB.recycle();
decodedUriMB.recycle();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]