Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5F6A8200C22 for ; Tue, 21 Feb 2017 20:58:39 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5DE86160B68; Tue, 21 Feb 2017 19:58:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A8FAE160B4F for ; Tue, 21 Feb 2017 20:58:38 +0100 (CET) Received: (qmail 22565 invoked by uid 500); 21 Feb 2017 19:58:37 -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 22556 invoked by uid 99); 21 Feb 2017 19:58:37 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Feb 2017 19:58:37 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 6A1143A0232 for ; Tue, 21 Feb 2017 19:58:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1783928 - /httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java Date: Tue, 21 Feb 2017 19:58:37 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170221195837.6A1143A0232@svn01-us-west.apache.org> archived-at: Tue, 21 Feb 2017 19:58:39 -0000 Author: olegk Date: Tue Feb 21 19:58:37 2017 New Revision: 1783928 URL: http://svn.apache.org/viewvc?rev=1783928&view=rev Log: Improved handling of premature HTTP/1.1 stream termination Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java?rev=1783928&r1=1783927&r2=1783928&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java (original) +++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java Tue Feb 21 19:58:37 2017 @@ -51,11 +51,11 @@ import org.apache.hc.core5.http.HttpMess import org.apache.hc.core5.http.Message; import org.apache.hc.core5.http.ProtocolVersion; import org.apache.hc.core5.http.config.CharCodingConfig; -import org.apache.hc.core5.http.impl.CharCodingSupport; import org.apache.hc.core5.http.config.H1Config; import org.apache.hc.core5.http.impl.BasicEndpointDetails; import org.apache.hc.core5.http.impl.BasicHttpConnectionMetrics; import org.apache.hc.core5.http.impl.BasicHttpTransportMetrics; +import org.apache.hc.core5.http.impl.CharCodingSupport; import org.apache.hc.core5.http.impl.ConnectionListener; import org.apache.hc.core5.http.nio.ContentDecoder; import org.apache.hc.core5.http.nio.ContentEncoder; @@ -244,7 +244,7 @@ abstract class AbstractHttp1StreamDuplex } while (bytesRead > 0); if (bytesRead == -1 && !inbuf.hasData()) { - if (incomingMessage == null && outgoingMessage == null) { + if (outputIdle() && inputIdle()) { requestShutdown(ShutdownType.IMMEDIATE); } else { doTerminate(new ConnectionClosedException("Connection closed by peer"));