Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C3A4910BFA for ; Fri, 13 Dec 2013 09:05:03 +0000 (UTC) Received: (qmail 75551 invoked by uid 500); 13 Dec 2013 09:05:03 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 75503 invoked by uid 500); 13 Dec 2013 09:04:58 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 75496 invoked by uid 99); 13 Dec 2013 09:04:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Dec 2013 09:04:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Dec 2013 09:04:54 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4E2C72388831 for ; Fri, 13 Dec 2013 09:04:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131213090433.4E2C72388831@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 + * [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 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) {