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 2008/02/02 18:51:06 UTC
svn commit: r617846 - in /httpcomponents/httpcore/trunk: RELEASE_NOTES.txt
module-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java
Author: olegk
Date: Sat Feb 2 09:51:00 2008
New Revision: 617846
URL: http://svn.apache.org/viewvc?rev=617846&view=rev
Log:
HTTPCORE-143: Ensure the underlying channel is closed if the session request is canceled or times out.
Modified:
httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java
Modified: httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/RELEASE_NOTES.txt?rev=617846&r1=617845&r2=617846&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpcore/trunk/RELEASE_NOTES.txt Sat Feb 2 09:51:00 2008
@@ -1,7 +1,11 @@
Changes since 4.0 Beta 1
-------------------
-* [HTTPCORE-140] Fixed timeout handling in ThrottlingHttpServiceHandler
+* [HTTPCORE-143] Ensure the underlying channel is closed if the session
+ request is canceled or times out.
+ Oleg Kalnichevski <olegk at apache.org>
+
+* [HTTPCORE-140] Fixed timeout handling in ThrottlingHttpServiceHandler.
Contributed by Lorenzo Moretti <moznerol at hotmail.com> and
Oleg Kalnichevski <olegk at apache.org>
Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java?rev=617846&r1=617845&r2=617846&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java (original)
+++ httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java Sat Feb 2 09:51:00 2008
@@ -33,6 +33,7 @@
import java.io.IOException;
import java.net.SocketAddress;
+import java.nio.channels.Channel;
import java.nio.channels.SelectionKey;
import org.apache.http.nio.reactor.IOSession;
@@ -149,6 +150,12 @@
this.completed = true;
if (this.key != null) {
this.key.cancel();
+ Channel channel = this.key.channel();
+ if (channel.isOpen()) {
+ try {
+ channel.close();
+ } catch (IOException ignore) {}
+ }
}
synchronized (this) {
if (this.callback != null) {
@@ -181,6 +188,12 @@
this.completed = true;
if (this.key != null) {
this.key.cancel();
+ Channel channel = this.key.channel();
+ if (channel.isOpen()) {
+ try {
+ channel.close();
+ } catch (IOException ignore) {}
+ }
}
synchronized (this) {
if (this.callback != null) {