Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Correctly recycle the cookies when mapping requests for parallel deployment

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1723414 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Jan 6, 2016
1 parent 9728aab commit 04164c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion java/org/apache/catalina/connector/CoyoteAdapter.java
Expand Up @@ -719,8 +719,8 @@ protected boolean postParseRequest(org.apache.coyote.Request req, Request reques
// Recycle cookies and session info in case the
// correct context is configured with different
// settings
req.getCookies().recycle();
request.recycleSessionInfo();
request.recycleCookieInfo(true);
}
break;
}
Expand Down
14 changes: 11 additions & 3 deletions java/org/apache/catalina/connector/Request.java
Expand Up @@ -452,8 +452,6 @@ public void recycle() {
parts = null;
}
partsParseException = null;
cookiesParsed = false;
cookiesConverted = false;
locales.clear();
localesParsed = false;
secure = false;
Expand All @@ -467,9 +465,9 @@ public void recycle() {
attributes.clear();
sslAttributesParsed = false;
notes.clear();
cookies = null;

recycleSessionInfo();
recycleCookieInfo(false);

if (Globals.IS_SECURITY_ENABLED || Connector.RECYCLE_FACADES) {
parameterMap = new ParameterMap<>();
Expand Down Expand Up @@ -520,6 +518,16 @@ protected void recycleSessionInfo() {
}


protected void recycleCookieInfo(boolean recycleCoyote) {
cookiesParsed = false;
cookiesConverted = false;
cookies = null;
if (recycleCoyote) {
getCoyoteRequest().getCookies().recycle();
}
}


// -------------------------------------------------------- Request Methods

/**
Expand Down

0 comments on commit 04164c1

Please sign in to comment.