hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r617846 - in /httpcomponents/httpcore/trunk: RELEASE_NOTES.txt module-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java
Date Sat, 02 Feb 2008 17:51:06 GMT
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) {



Mime
View raw message