hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r538731 - in /jakarta/httpcomponents/httpcore/trunk: ./ module-nio/src/main/java/org/apache/http/impl/nio/ module-nio/src/main/java/org/apache/http/nio/protocol/
Date Wed, 16 May 2007 21:09:55 GMT
Author: olegk
Date: Wed May 16 14:09:54 2007
New Revision: 538731

URL: http://svn.apache.org/viewvc?view=rev&rev=538731
Log:
HTTPCORE-75: DefaultNHttpServerConnection and DefaultNHttpClientConnection now correctly terminate
the underlying I/O session when closed. BufferingHttpServiceHandler now correctly applies
connection keep-alive strategy when sending a response with no content body.  

Contributed by Steffen Pingel <spingel at limewire.com>
Reviewed by Oleg Kalnichevski

Modified:
    jakarta/httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java

Modified: jakarta/httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/RELEASE_NOTES.txt?view=diff&rev=538731&r1=538730&r2=538731
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/RELEASE_NOTES.txt (original)
+++ jakarta/httpcomponents/httpcore/trunk/RELEASE_NOTES.txt Wed May 16 14:09:54 2007
@@ -1,5 +1,11 @@
 Changes since 4.0 Alpha 4
 
+* [HTTPCORE-75]: DefaultNHttpServerConnection and DefaultNHttpClientConnection 
+  now correctly terminate the underlying I/O session when closed. 
+  BufferingHttpServiceHandler now correctly applies connection keep-alive 
+  strategy when sending a response with no content body.
+  Contributed by Steffen Pingel <spingel at limewire.com>
+
 * [HTTPCORE-73]: Fixed bug preventing NHttpServiceHandler#responseReady and 
   NHttpClientHandler#requestReady events from being fired if the HTTP message 
   has no content body.

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java?view=diff&rev=538731&r1=538730&r2=538731
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
Wed May 16 14:09:54 2007
@@ -143,11 +143,14 @@
                 }
                 
                 if (this.contentEncoder == null && !this.outbuf.hasData()) {
+                    if (this.closed) {
+                        this.session.close();
+                        return;
+                    }
+                    
                     this.session.clearEvent(EventMask.WRITE);
                     
-                    if (!this.closed) {
-                        handler.requestReady(this);
-                    }
+                    handler.requestReady(this);
                 }
             }
         } catch (IOException ex) {

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java?view=diff&rev=538731&r1=538730&r2=538731
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
Wed May 16 14:09:54 2007
@@ -142,11 +142,14 @@
                 }
                 
                 if (this.contentEncoder == null && !this.outbuf.hasData()) {
+                    if (this.closed) {
+                        this.session.close();
+                        return;
+                    }
+                    
                     this.session.clearEvent(EventMask.WRITE);
                
-                    if (!this.closed) {
-                        handler.responseReady(this);
-                    }
+                    handler.responseReady(this);
                 }
             }
         } catch (IOException ex) {

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java?view=diff&rev=538731&r1=538730&r2=538731
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java
Wed May 16 14:09:54 2007
@@ -427,7 +427,11 @@
             outstream.close();
         } else {
             connState.resetOutput();
-            conn.requestInput();
+            if (!this.connStrategy.keepAlive(response, context)) {
+                conn.close();
+            } else {
+                conn.requestInput();
+            }
         }
     }
 



Mime
View raw message