hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1763201 - /httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/AbstractIOReactor.java
Date Mon, 03 Oct 2016 19:29:51 GMT
Author: olegk
Date: Mon Oct  3 19:29:51 2016
New Revision: 1763201

URL: http://svn.apache.org/viewvc?rev=1763201&view=rev
Log:
Bug fix in AbstractIOReactor#enumSessions

Modified:
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/AbstractIOReactor.java

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/AbstractIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/AbstractIOReactor.java?rev=1763201&r1=1763200&r2=1763201&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/AbstractIOReactor.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/AbstractIOReactor.java
Mon Oct  3 19:29:51 2016
@@ -425,12 +425,15 @@ abstract class AbstractIOReactor impleme
      */
     protected void enumSessions(final IOSessionCallback callback) throws IOException {
         if (this.selector.isOpen()) {
-            final Set<SelectionKey> keys = this.selector.keys();
-            for (final SelectionKey key : keys) {
-                final IOSession session = getSession(key);
-                if (session != null) {
-                    callback.execute(session);
+            try {
+                final Set<SelectionKey> keys = this.selector.keys();
+                for (final SelectionKey key : keys) {
+                    final IOSession session = getSession(key);
+                    if (session != null) {
+                        callback.execute(session);
+                    }
                 }
+            } catch (ClosedSelectorException ignore) {
             }
         }
     }



Mime
View raw message