You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2013/04/02 18:10:32 UTC
svn commit: r1463609 - in /httpcomponents/httpcore/branches/4.2.x:
RELEASE_NOTES.txt
httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
Author: olegk
Date: Tue Apr 2 16:10:32 2013
New Revision: 1463609
URL: http://svn.apache.org/r1463609
Log:
HTTPCORE-336: Unhandled CancelledKeyException leads to a shutdown of the underlying IOReactor
Contributed by Thomas Dudek <mail.dudek at gmail.com>
Modified:
httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt
httpcomponents/httpcore/branches/4.2.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
Modified: httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt?rev=1463609&r1=1463608&r2=1463609&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt Tue Apr 2 16:10:32 2013
@@ -1,3 +1,10 @@
+Changes since Release 4.2.4
+-------------------
+
+* [HTTPCORE-336] Unhandled CancelledKeyException leads to a shutdown of the underlying IOReactor.
+ Contributed by Thomas Dudek <mail.dudek at gmail.com>
+
+
Release 4.2.4
-------------------
Modified: httpcomponents/httpcore/branches/4.2.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.2.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java?rev=1463609&r1=1463608&r2=1463609&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.2.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java (original)
+++ httpcomponents/httpcore/branches/4.2.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java Tue Apr 2 16:10:32 2013
@@ -403,22 +403,25 @@ public abstract class AbstractIOReactor
};
}
- IOSession session = new IOSessionImpl(key, interestOpsCallback, sessionClosedCallback);
-
- int timeout = 0;
+ IOSession session;
try {
- timeout = channel.socket().getSoTimeout();
- } catch (IOException ex) {
- // Very unlikely to happen and is not fatal
- // as the protocol layer is expected to overwrite
- // this value anyways
- }
-
- session.setAttribute(IOSession.ATTACHMENT_KEY, entry.getAttachment());
- session.setSocketTimeout(timeout);
- this.sessions.add(session);
+ session = new IOSessionImpl(key, interestOpsCallback, sessionClosedCallback);
+ int timeout = 0;
+ try {
+ timeout = channel.socket().getSoTimeout();
+ } catch (final IOException ex) {
+ // Very unlikely to happen and is not fatal
+ // as the protocol layer is expected to overwrite
+ // this value anyways
+ }
+ session.setAttribute(IOSession.ATTACHMENT_KEY, entry.getAttachment());
+ session.setSocketTimeout(timeout);
+ } catch (final CancelledKeyException ex) {
+ continue;
+ }
try {
+ this.sessions.add(session);
SessionRequestImpl sessionRequest = entry.getSessionRequest();
if (sessionRequest != null) {
sessionRequest.completed(session);