hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1140183 - /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
Date Mon, 27 Jun 2011 14:44:58 GMT
Author: olegk
Date: Mon Jun 27 14:44:58 2011
New Revision: 1140183

URL: http://svn.apache.org/viewvc?rev=1140183&view=rev
Log:
HTTPCORE-261: fixed NPE in AbstractIOReactor#timeoutCheck

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java?rev=1140183&r1=1140182&r2=1140183&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
Mon Jun 27 14:44:58 2011
@@ -485,10 +485,12 @@ public abstract class AbstractIOReactor 
      */
     protected void timeoutCheck(final SelectionKey key, long now) {
         IOSessionImpl session = (IOSessionImpl) key.attachment();
-        int timeout = session.getSocketTimeout();
-        if (timeout > 0) {
-            if (session.getLastAccessTime() + timeout < now) {
-                sessionTimedOut(session);
+        if (session != null) {
+            int timeout = session.getSocketTimeout();
+            if (timeout > 0) {
+                if (session.getLastAccessTime() + timeout < now) {
+                    sessionTimedOut(session);
+                }
             }
         }
     }



Mime
View raw message