Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

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/tc8.0.x/trunk@1723506 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Jan 7, 2016
1 parent 0c3ab9d commit c39b7ff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion java/org/apache/catalina/connector/CoyoteAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,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
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,6 @@ public void recycle() {
parts = null;
}
partsParseException = null;
cookiesParsed = false;
cookiesConverted = false;
locales.clear();
localesParsed = false;
secure = false;
Expand All @@ -492,9 +490,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 @@ -554,6 +552,16 @@ protected void recycleSessionInfo() {
}


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


public boolean read() throws IOException {
return (inputBuffer.realReadBytes(null, 0, 0) > 0);
}
Expand Down
4 changes: 4 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@
Fix declaration of <code>localPort</code> attribute of Connector MBean:
it is read-only. (kkolinko)
</fix>
<fix>
<bug>58809/bug>: Correctly recycle cookies when mapping requests for
parallel deployment. (markt)
</fix>
</changelog>
</subsection>
<subsection name="Jasper">
Expand Down

0 comments on commit c39b7ff

Please # to comment.