tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1643383 - in /tomcat/tc8.0.x/trunk: ./ java/org/apache/catalina/core/ test/org/apache/catalina/core/ webapps/docs/
Date Fri, 05 Dec 2014 18:35:22 GMT
Author: markt
Date: Fri Dec  5 18:35:21 2014
New Revision: 1643383

URL: http://svn.apache.org/r1643383
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57284
Enable startAsync() to be called from a Filter and still be able to call the remainder of
the FilterChain

Added:
    tomcat/tc8.0.x/trunk/test/org/apache/catalina/core/TestApplicationFilterChain.java
      - copied, changed from r1643370, tomcat/trunk/test/org/apache/catalina/core/TestApplicationFilterChain.java
Modified:
    tomcat/tc8.0.x/trunk/   (props changed)
    tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
    tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
    tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties
    tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_es.properties
    tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties
    tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_ja.properties
    tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java
    tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc8.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec  5 18:35:21 2014
@@ -1 +1 @@
-/tomcat/trunk:1636524,1637156,1637176,1637188,1637331,1637684,1637695,1638720-1638725,1639653,1640010,1640084,1640088,1640275,1640322,1640347,1640361,1640365,1640403,1640410,1640652,1640655-1640658,1640688,1640700-1640883,1640903,1640976,1640978,1641000,1641026,1641038-1641039,1641051-1641052,1641058,1641064,1641300,1641369,1641374,1641380,1641486,1641634,1641656-1641692,1641704,1641707-1641718,1641720-1641722,1641735,1641981,1642668,1642679,1642697,1642699,1643002,1643066,1643121,1643206,1643209-1643210,1643216,1643249,1643270,1643283,1643309-1643310,1643323,1643365-1643366
+/tomcat/trunk:1636524,1637156,1637176,1637188,1637331,1637684,1637695,1638720-1638725,1639653,1640010,1640084,1640088,1640275,1640322,1640347,1640361,1640365,1640403,1640410,1640652,1640655-1640658,1640688,1640700-1640883,1640903,1640976,1640978,1641000,1641026,1641038-1641039,1641051-1641052,1641058,1641064,1641300,1641369,1641374,1641380,1641486,1641634,1641656-1641692,1641704,1641707-1641718,1641720-1641722,1641735,1641981,1642668,1642679,1642697,1642699,1643002,1643066,1643121,1643206,1643209-1643210,1643216,1643249,1643270,1643283,1643309-1643310,1643323,1643365-1643366,1643370-1643371

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java?rev=1643383&r1=1643382&r2=1643383&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java Fri Dec
 5 18:35:21 2014
@@ -757,17 +757,6 @@ final class ApplicationDispatcher implem
             runtimeException = e;
         }
 
-        // Release the filter chain (if any) for this request
-        try {
-            if (filterChain != null)
-                filterChain.release();
-        } catch (Throwable e) {
-            ExceptionUtils.handleThrowable(e);
-            wrapper.getLogger().error(sm.getString("standardWrapper.releaseFilters",
-                             wrapper.getName()), e);
-            // FIXME: Exception handling needs to be similar to what is in the StandardWrapperValue
-        }
-
         // Deallocate the allocated servlet instance
         try {
             if (servlet != null) {

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java?rev=1643383&r1=1643382&r2=1643383&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java Fri Dec
 5 18:35:21 2014
@@ -530,22 +530,6 @@ final class ApplicationFilterChain imple
 
 
     /**
-     * Release references to the filters and wrapper executed by this chain.
-     */
-    void release() {
-
-        for (int i = 0; i < n; i++) {
-            filters[i] = null;
-        }
-        n = 0;
-        pos = 0;
-        servlet = null;
-        support = null;
-
-    }
-
-
-    /**
      * Prepare for reuse of the filters and wrapper executed by this chain.
      */
     void reuse() {

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties?rev=1643383&r1=1643382&r2=1643383&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties Fri Dec  5
18:35:21 2014
@@ -186,7 +186,6 @@ standardWrapper.notClass=No servlet clas
 standardWrapper.notContext=Parent container of a Wrapper must be a Context
 standardWrapper.notFound=Servlet {0} is not available
 standardWrapper.notServlet=Class {0} is not a Servlet
-standardWrapper.releaseFilters=Release filters exception for servlet {0}
 standardWrapper.serviceException=Servlet.service() for servlet [{0}] in context with path
[{1}] threw exception
 standardWrapper.serviceExceptionRoot=Servlet.service() for servlet [{0}] in context with
path [{1}] threw exception [{2}] with root cause
 standardWrapper.unavailable=Marking servlet {0} as unavailable

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_es.properties
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_es.properties?rev=1643383&r1=1643382&r2=1643383&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_es.properties (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_es.properties Fri Dec
 5 18:35:21 2014
@@ -145,7 +145,6 @@ standardWrapper.notClass = No se ha espe
 standardWrapper.notContext = El contenedor padre para un Arropador (Wrapper) debe de ser
un Contexto
 standardWrapper.notFound = No est\u00E1 disponible el Servlet {0}
 standardWrapper.notServlet = La Clase {0} no es un Servlet
-standardWrapper.releaseFilters = Excepci\u00F3n de Liberaci\u00F3n de filtros para servlet
{0}
 standardWrapper.serviceException = Servlet.service() para servlet {0} lanz\u00F3 excepci\u00F3n
 standardWrapper.serviceExceptionRoot = El Servlet.service() para el servlet [{0}] en el contexto
con ruta [{1}] lanz\u00F3 la excepci\u00F3n [{2}] con causa ra\u00EDz
 standardWrapper.unavailable = Marcando el servlet {0} como no disponible

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties?rev=1643383&r1=1643382&r2=1643383&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties Fri Dec
 5 18:35:21 2014
@@ -81,7 +81,6 @@ standardWrapper.notClass=Aucune classe s
 standardWrapper.notContext=Le conteneur parent d''un enrobeur (wrapper) doit \u00eatre un
contexte
 standardWrapper.notFound=Servlet {0} n''est pas disponible.
 standardWrapper.notServlet=La classe {0} n''est pas une servlet
-standardWrapper.releaseFilters=Exception des filtres de sortie (release filters) pour la
servlet {0}
 standardWrapper.serviceException="Servlet.service()" pour la servlet {0} a g\u00e9n\u00e9r\u00e9
une exception
 standardWrapper.unavailable=La servlet {0} est marqu\u00e9 comme indisponible
 standardWrapper.unloadException=La servlet {0} a g\u00e9n\u00e9r\u00e9 une exception "unload()"

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_ja.properties
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_ja.properties?rev=1643383&r1=1643382&r2=1643383&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_ja.properties (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/LocalStrings_ja.properties Fri Dec
 5 18:35:21 2014
@@ -82,7 +82,6 @@ standardWrapper.notClass=\u30b5\u30fc\u3
 standardWrapper.notContext=\u30e9\u30c3\u30d1\u306e\u89aa\u306e\u30b3\u30f3\u30c6\u30ca\u306f\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3067\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093
 standardWrapper.notFound=\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8 {0} \u304c\u5229\u7528\u3067\u304d\u307e\u305b\u3093
 standardWrapper.notServlet=\u30af\u30e9\u30b9 {0} \u306f\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u3067\u306f\u3042\u308a\u307e\u305b\u3093
-standardWrapper.releaseFilters=\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8 {0} \u306e\u30d5\u30a3\u30eb\u30bf\u4f8b\u5916\u3092\u89e3\u9664\u3057\u307e\u3059
 standardWrapper.serviceException=\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8 {0} \u306eServlet.service()\u304c\u4f8b\u5916\u3092\u6295\u3052\u307e\u3057\u305f
 standardWrapper.unavailable=\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8 {0} \u3092\u5229\u7528\u4e0d\u53ef\u80fd\u306b\u30de\u30fc\u30af\u3057\u307e\u3059
 standardWrapper.unloadException=\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8 {0} \u304cunload()\u4f8b\u5916\u3092\u6295\u3052\u307e\u3057\u305f

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java?rev=1643383&r1=1643382&r2=1643383&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/core/StandardWrapperValve.java Fri Dec 
5 18:35:21 2014
@@ -270,15 +270,10 @@ final class StandardWrapperValve
             exception(request, response, e);
         }
 
-        // Release the filter chain (if any) for this request
-        if (filterChain != null) {
-            if (request.isComet()) {
-                // If this is a Comet request, then the same chain will be used for the
-                // processing of all subsequent events.
-                filterChain.reuse();
-            } else {
-                filterChain.release();
-            }
+        if (filterChain != null && request.isComet()) {
+            // If this is a Comet request, then the same chain will be used for the
+            // processing of all subsequent events.
+            filterChain.reuse();
         }
 
         // Deallocate the allocated servlet instance

Copied: tomcat/tc8.0.x/trunk/test/org/apache/catalina/core/TestApplicationFilterChain.java
(from r1643370, tomcat/trunk/test/org/apache/catalina/core/TestApplicationFilterChain.java)
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/test/org/apache/catalina/core/TestApplicationFilterChain.java?p2=tomcat/tc8.0.x/trunk/test/org/apache/catalina/core/TestApplicationFilterChain.java&p1=tomcat/trunk/test/org/apache/catalina/core/TestApplicationFilterChain.java&r1=1643370&r2=1643383&rev=1643383&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestApplicationFilterChain.java (original)
+++ tomcat/tc8.0.x/trunk/test/org/apache/catalina/core/TestApplicationFilterChain.java Fri
Dec  5 18:35:21 2014
@@ -82,10 +82,10 @@ public class TestApplicationFilterChain
         }
 
         @Override
-        public void doFilter(ServletRequest request, ServletResponse response,
-                FilterChain chain) throws IOException, ServletException {
+        public void doFilter(final ServletRequest request, final ServletResponse response,
+                final FilterChain chain) throws IOException, ServletException {
 
-            AsyncContext ac = request.startAsync();
+            final AsyncContext ac = request.startAsync();
             ac.start(new Runnable() {
 
                 @Override

Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1643383&r1=1643382&r2=1643383&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Fri Dec  5 18:35:21 2014
@@ -109,6 +109,10 @@
         without error when running under a SecurityManager. (markt)
       </fix>
       <fix>
+        <bug>57284</bug>: Enable startAsync() to be called from a Filter and
+        still be able to call the remainder of the FilterChain. (markt)
+      </fix>
+      <fix>
         <bug>57308</bug>: Remove unnecessary calls to
         <code>System.getProperty()</code> where more suitable API calls are
         available. (markt)



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


Mime
View raw message