hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1550666 - in /httpcomponents/httpcore/trunk: RELEASE_NOTES.txt httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
Date Fri, 13 Dec 2013 09:04:33 GMT
Author: olegk
Date: Fri Dec 13 09:04:32 2013
New Revision: 1550666

URL: http://svn.apache.org/r1550666
Log:
HTTPCORE-367: Reverted revision 1480321: Call #inputReady as long as there is interest in
input, decoder is not done and there is buffered session data

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

Modified: httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/RELEASE_NOTES.txt?rev=1550666&r1=1550665&r2=1550666&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpcore/trunk/RELEASE_NOTES.txt Fri Dec 13 09:04:32 2013
@@ -1,6 +1,10 @@
 Changes since 4.3
 -------------------
 
+* [HTTPCORE-367] (Regression) Non-blocking connections can enter a tight loop while waiting

+  for a chunk header split across multiple TCP frames.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * [HTTPCORE-366] Non-blocking SSLIOSession can enter an infinite loop if the underlying
   channel receives incoming data simultaneously with inactivity timeout.
   Contributed by Oleg Kalnichevski <olegk at apache.org>

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java?rev=1550666&r1=1550665&r2=1550666&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
Fri Dec 13 09:04:32 2013
@@ -260,20 +260,12 @@ public class DefaultNHttpClientConnectio
                     handler.endOfInput(this);
                 }
             }
-            if (this.contentDecoder != null) {
-                // Loop until there is interest in input,
-                // decoder is not done and there is buffered session data
-                while ((this.session.getEventMask() & SelectionKey.OP_READ) > 0) {
-                    handler.inputReady(this, this.contentDecoder);
-                    if (this.contentDecoder.isCompleted()) {
-                        // Response entity received
-                        // Ready to receive a new response
-                        resetInput();
-                        break;
-                    }
-                    if (!this.inbuf.hasData()) {
-                        break;
-                    }
+            if (this.contentDecoder != null && (this.session.getEventMask() &
SelectionKey.OP_READ) > 0) {
+                handler.inputReady(this, this.contentDecoder);
+                if (this.contentDecoder.isCompleted()) {
+                    // Response entity received
+                    // Ready to receive a new response
+                    resetInput();
                 }
             }
         } catch (final HttpException ex) {

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java?rev=1550666&r1=1550665&r2=1550666&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
Fri Dec 13 09:04:32 2013
@@ -279,20 +279,12 @@ public class DefaultNHttpServerConnectio
                     handler.endOfInput(this);
                 }
             }
-            if (this.contentDecoder != null) {
-                // Loop until there is interest in input,
-                // decoder is not done and there is buffered session data
-                while ((this.session.getEventMask() & SelectionKey.OP_READ) > 0) {
-                    handler.inputReady(this, this.contentDecoder);
-                    if (this.contentDecoder.isCompleted()) {
-                        // Response entity received
-                        // Ready to receive a new response
-                        resetInput();
-                        break;
-                    }
-                    if (!this.inbuf.hasData()) {
-                        break;
-                    }
+            if (this.contentDecoder != null && (this.session.getEventMask() &
SelectionKey.OP_READ) > 0) {
+                handler.inputReady(this, this.contentDecoder);
+                if (this.contentDecoder.isCompleted()) {
+                    // Request entity received
+                    // Ready to receive a new request
+                    resetInput();
                 }
             }
         } catch (final HttpException ex) {



Mime
View raw message