tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1141066 - in /tomcat/trunk: java/org/apache/coyote/ajp/ java/org/apache/coyote/http11/ webapps/docs/
Date Wed, 29 Jun 2011 12:12:49 GMT
Author: markt
Date: Wed Jun 29 12:12:48 2011
New Revision: 1141066

URL: http://svn.apache.org/viewvc?rev=1141066&view=rev
Log:
Ensure an access log entry is made if an error occurs during asynchronous request processing
and the socket is immediately closed.

Modified:
    tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1141066&r1=1141065&r2=1141066&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Wed Jun 29 12:12:48
2011
@@ -465,10 +465,13 @@ public abstract class AbstractAjpProcess
        } catch (Throwable t) {
            ExceptionUtils.handleThrowable(t);
            getLog().error(sm.getString("http11processor.request.process"), t);
-           // 500 - Internal Server Error
-           response.setStatus(500);
-           adapter.log(request, response, 0);
            error = true;
+       } finally {
+           if (error) {
+               // 500 - Internal Server Error
+               response.setStatus(500);
+               adapter.log(request, response, 0);
+           }
        }
 
        rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1141066&r1=1141065&r2=1141066&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Wed Jun 29 12:12:48
2011
@@ -355,10 +355,13 @@ public class Http11AprProcessor extends 
         } catch (Throwable t) {
             ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("http11processor.request.process"), t);
-            // 500 - Internal Server Error
-            response.setStatus(500);
-            adapter.log(request, response, 0);
             error = true;
+        } finally {
+            if (error) {
+                // 500 - Internal Server Error
+                response.setStatus(500);
+                adapter.log(request, response, 0);
+            }
         }
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1141066&r1=1141065&r2=1141066&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Wed Jun 29 12:12:48
2011
@@ -219,10 +219,13 @@ public class Http11NioProcessor extends 
         } catch (Throwable t) {
             ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("http11processor.request.process"), t);
-            // 500 - Internal Server Error
-            response.setStatus(500);
-            adapter.log(request, response, 0);
             error = true;
+        } finally {
+            if (error) {
+                // 500 - Internal Server Error
+                response.setStatus(500);
+                adapter.log(request, response, 0);
+            }
         }
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1141066&r1=1141065&r2=1141066&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Wed Jun 29 12:12:48 2011
@@ -396,10 +396,13 @@ public class Http11Processor extends Abs
         } catch (Throwable t) {
             ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("http11processor.request.process"), t);
-            // 500 - Internal Server Error
-            response.setStatus(500);
-            adapter.log(request, response, 0);
             error = true;
+        } finally {
+            if (error) {
+                // 500 - Internal Server Error
+                response.setStatus(500);
+                adapter.log(request, response, 0);
+            }
         }
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1141066&r1=1141065&r2=1141066&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jun 29 12:12:48 2011
@@ -162,6 +162,11 @@
         ServletRequestListener implementations to read the request body. Based
         on a patch by Simon Olofsson. (markt)
       </fix>
+      <fix>
+        Ensure an access log entry is made if an error occurs during
+        asynchronous request processing and the socket is immediately closed.
+        (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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


Mime
View raw message