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 AD0B3E589 for ; Fri, 18 Jan 2013 14:07:39 +0000 (UTC) Received: (qmail 56152 invoked by uid 500); 18 Jan 2013 14:07:39 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 56124 invoked by uid 500); 18 Jan 2013 14:07:39 -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 56114 invoked by uid 99); 18 Jan 2013 14:07:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jan 2013 14:07:39 +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, 18 Jan 2013 14:07:38 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 287AA2388980 for ; Fri, 18 Jan 2013 14:07:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1435144 - in /httpcomponents/httpcore/branches/4.2.x: RELEASE_NOTES.txt httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java Date: Fri, 18 Jan 2013 14:07:19 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130118140719.287AA2388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Fri Jan 18 14:07:18 2013 New Revision: 1435144 URL: http://svn.apache.org/viewvc?rev=1435144&view=rev Log: HTTPCORE-331: BasicFuture no longer executes notification callbacks inside a synchronized block Modified: httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java Modified: httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt?rev=1435144&r1=1435143&r2=1435144&view=diff ============================================================================== --- httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt (original) +++ httpcomponents/httpcore/branches/4.2.x/RELEASE_NOTES.txt Fri Jan 18 14:07:18 2013 @@ -1,5 +1,8 @@ Changes since 4.2.3 +* [HTTPCORE-331] BasicFuture no longer executes notification callbacks inside a synchronized block. + Contributed by Oleg Kalnichevski + * [HTTPCORE-319] Non-blocking SSLIOSession can fail to shut down correctly when the underlying connection gets terminated abnormally by the opposite endpoint in case there is a truncated or corrupted encrypted content in the input buffer and there is still data in the output buffer Modified: httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java?rev=1435144&r1=1435143&r2=1435144&view=diff ============================================================================== --- httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java (original) +++ httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/concurrent/BasicFuture.java Fri Jan 18 14:07:18 2013 @@ -100,41 +100,47 @@ public class BasicFuture implements F } public synchronized boolean completed(final T result) { - if (this.completed) { - return false; + synchronized(this) { + if (this.completed) { + return false; + } + this.completed = true; + this.result = result; + notifyAll(); } - this.completed = true; - this.result = result; if (this.callback != null) { this.callback.completed(result); } - notifyAll(); return true; } public synchronized boolean failed(final Exception exception) { - if (this.completed) { - return false; + synchronized(this) { + if (this.completed) { + return false; + } + this.completed = true; + this.ex = exception; + notifyAll(); } - this.completed = true; - this.ex = exception; if (this.callback != null) { this.callback.failed(exception); } - notifyAll(); return true; } public synchronized boolean cancel(boolean mayInterruptIfRunning) { - if (this.completed) { - return false; + synchronized(this) { + if (this.completed) { + return false; + } + this.completed = true; + this.cancelled = true; + notifyAll(); } - this.completed = true; - this.cancelled = true; if (this.callback != null) { this.callback.cancelled(); } - notifyAll(); return true; }