tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1133401 - in /tomcat/trunk: java/org/apache/catalina/connector/CoyoteAdapter.java webapps/docs/changelog.xml
Date Wed, 08 Jun 2011 13:52:50 GMT
Author: markt
Date: Wed Jun  8 13:52:50 2011
New Revision: 1133401

URL: http://svn.apache.org/viewvc?rev=1133401&view=rev
Log:
Avoid possible NPE

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1133401&r1=1133400&r2=1133401&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Wed Jun  8 13:52:50
2011
@@ -26,6 +26,7 @@ import javax.servlet.RequestDispatcher;
 import javax.servlet.SessionTrackingMode;
 
 import org.apache.catalina.Context;
+import org.apache.catalina.Host;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.comet.CometEvent;
 import org.apache.catalina.comet.CometEvent.EventType;
@@ -642,7 +643,11 @@ public class CoyoteAdapter implements Ad
                 res.setStatus(404);
                 res.setMessage("Not found");
                 // No context, so use host
-                request.getHost().logAccess(request, response, 0, true);
+                Host host = request.getHost();
+                // Make sure there is a host (might not be during shutdown)
+                if (host != null) {
+                    host.logAccess(request, response, 0, true);
+                }
                 return false;
             }
         

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1133401&r1=1133400&r2=1133401&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jun  8 13:52:50 2011
@@ -67,6 +67,10 @@
         Enable remaining valves for Servlet 3 asynchronous processing support.
         (markt)
       </fix>
+      <fix>
+        Avoid possible NPE when logging requests received during embedded Tomcat
+        shutdown. (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