You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2020/01/23 09:53:49 UTC

[tomcat] branch 8.5.x updated: Add new connector attribute to control facade recycling

This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new a327ff5  Add new connector attribute to control facade recycling
a327ff5 is described below

commit a327ff55633d70699405557326326534a467269b
Author: remm <re...@apache.org>
AuthorDate: Wed Jan 22 15:35:37 2020 +0100

    Add new connector attribute to control facade recycling
    
    Use the same default as before, using the system property and false if
    not set.
---
 java/org/apache/catalina/connector/Request.java | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java b/java/org/apache/catalina/connector/Request.java
index 201af7d..c4b6554 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -488,7 +488,7 @@ public class Request implements org.apache.catalina.servlet4preview.http.HttpSer
         recycleSessionInfo();
         recycleCookieInfo(false);
 
-        if (Globals.IS_SECURITY_ENABLED || Connector.RECYCLE_FACADES) {
+        if (getDiscardFacades()) {
             parameterMap = new ParameterMap<>();
         } else {
             parameterMap.setLocked(false);
@@ -499,7 +499,7 @@ public class Request implements org.apache.catalina.servlet4preview.http.HttpSer
         applicationMapping.recycle();
 
         applicationRequest = null;
-        if (Globals.IS_SECURITY_ENABLED || Connector.RECYCLE_FACADES) {
+        if (getDiscardFacades()) {
             if (facade != null) {
                 facade.clear();
                 facade = null;
@@ -588,6 +588,16 @@ public class Request implements org.apache.catalina.servlet4preview.http.HttpSer
 
 
     /**
+     * Get the recycling strategy of the facade objects.
+     * @return the value of the flag as set on the connector, or
+     *   <code>true</code> if no connector is associated with this request
+     */
+    public boolean getDiscardFacades() {
+        return (connector == null) ? true : connector.getDiscardFacades();
+    }
+
+
+    /**
      * @param context The newly associated Context
      * @deprecated Use setters on {@link #getMappingData() MappingData} object.
      * Depending on use case, you may need to update other


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org