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 3DD8018C27 for ; Wed, 27 Jan 2016 09:47:33 +0000 (UTC) Received: (qmail 57950 invoked by uid 500); 27 Jan 2016 09:47:33 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 57908 invoked by uid 500); 27 Jan 2016 09:47:33 -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 57899 invoked by uid 99); 27 Jan 2016 09:47:33 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2016 09:47:33 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id BCB29C282F for ; Wed, 27 Jan 2016 09:47:32 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.999 X-Spam-Level: X-Spam-Status: No, score=0.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id CsLvFNWS5f4I for ; Wed, 27 Jan 2016 09:47:32 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id BAEDE31AA9 for ; Wed, 27 Jan 2016 09:47:31 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id ACB01E050C for ; Wed, 27 Jan 2016 09:47:30 +0000 (UTC) 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 AAD1D3A1751 for ; Wed, 27 Jan 2016 09:47:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1726985 - /httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java Date: Wed, 27 Jan 2016 09:47:30 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160127094730.AAD1D3A1751@svn01-us-west.apache.org> Author: olegk Date: Wed Jan 27 09:47:30 2016 New Revision: 1726985 URL: http://svn.apache.org/viewvc?rev=1726985&view=rev Log: HTTPCORE-417: SSLIOSession#writePlain incorrectly handles closed channel condition leading to an infinite loop Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java?rev=1726985&r1=1726984&r2=1726985&view=diff ============================================================================== --- httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java (original) +++ httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java Wed Jan 27 09:47:30 2016 @@ -32,6 +32,7 @@ import java.net.Socket; import java.net.SocketAddress; import java.nio.ByteBuffer; import java.nio.channels.ByteChannel; +import java.nio.channels.ClosedChannelException; import java.nio.channels.SelectionKey; import javax.net.ssl.SSLContext; @@ -563,10 +564,10 @@ public class SSLIOSession implements IOS return this.sslEngine.isOutboundDone(); } - private synchronized int writePlain(final ByteBuffer src) throws SSLException { + private synchronized int writePlain(final ByteBuffer src) throws IOException { Args.notNull(src, "Byte buffer"); if (this.status != ACTIVE) { - return -1; + throw new ClosedChannelException(); } if (this.outPlain.hasData()) { // Acquire buffers