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 63528EFF1 for ; Fri, 1 Feb 2013 12:06:26 +0000 (UTC) Received: (qmail 34547 invoked by uid 500); 1 Feb 2013 12:06:26 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 34502 invoked by uid 500); 1 Feb 2013 12:06:26 -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 34489 invoked by uid 99); 1 Feb 2013 12:06:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 12:06:26 +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, 01 Feb 2013 12:06:23 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 23AA72388847 for ; Fri, 1 Feb 2013 12:06:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1441413 - in /httpcomponents/httpclient/branches/4.2.x: ./ httpclient/src/main/java/org/apache/http/impl/client/ httpclient/src/test/java/org/apache/http/impl/conn/ Date: Fri, 01 Feb 2013 12:06:02 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130201120603.23AA72388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Fri Feb 1 12:06:02 2013 New Revision: 1441413 URL: http://svn.apache.org/viewvc?rev=1441413&view=rev Log: HTTPCLIENT-1311: made sure the current thread is re-interrupted if InterruptedException is caught and re-thrown as a different exception Modified: httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java httpcomponents/httpclient/branches/4.2.x/httpclient/src/test/java/org/apache/http/impl/conn/TestAbortHandling.java Modified: httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt?rev=1441413&r1=1441412&r2=1441413&view=diff ============================================================================== --- httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt (original) +++ httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt Fri Feb 1 12:06:02 2013 @@ -1,6 +1,9 @@ Changes since Release 4.2.3 ------------------- +* [HTTPCLIENT-1311] Interrupt flag is not preserved where InterruptedException is caught. + Contributed by Oleg Kalnichevski + * [HTTPCLIENT-1312] Zero length content entities with a Content-Encoding header cause an I/O error when an attempt is made to consume such entity. Contributed by Oleg Kalnichevski Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java?rev=1441413&r1=1441412&r2=1441413&view=diff ============================================================================== --- httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java (original) +++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java Fri Feb 1 12:06:02 2013 @@ -163,7 +163,8 @@ public class AutoRetryHttpClient impleme log.trace("Wait for " + nextInterval); Thread.sleep(nextInterval); } catch (InterruptedException e) { - throw new InterruptedIOException(e.getMessage()); + Thread.currentThread().interrupt(); + throw new InterruptedIOException(); } } else { return response; Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java?rev=1441413&r1=1441412&r2=1441413&view=diff ============================================================================== --- httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java (original) +++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java Fri Feb 1 12:06:02 2013 @@ -455,9 +455,8 @@ public class DefaultRequestDirector impl try { managedConn = connRequest.getConnection(timeout, TimeUnit.MILLISECONDS); } catch(InterruptedException interrupted) { - InterruptedIOException iox = new InterruptedIOException(); - iox.initCause(interrupted); - throw iox; + Thread.currentThread().interrupt(); + throw new InterruptedIOException(); } if (HttpConnectionParams.isStaleCheckingEnabled(params)) { Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/test/java/org/apache/http/impl/conn/TestAbortHandling.java URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/test/java/org/apache/http/impl/conn/TestAbortHandling.java?rev=1441413&r1=1441412&r2=1441413&view=diff ============================================================================== --- httpcomponents/httpclient/branches/4.2.x/httpclient/src/test/java/org/apache/http/impl/conn/TestAbortHandling.java (original) +++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/test/java/org/apache/http/impl/conn/TestAbortHandling.java Fri Feb 1 12:06:02 2013 @@ -163,8 +163,6 @@ public class TestAbortHandling extends B Assert.assertTrue("should have finished get request", getLatch.await(1, TimeUnit.SECONDS)); Assert.assertTrue("should be instanceof IOException, was: " + throwableRef.get(), throwableRef.get() instanceof IOException); - Assert.assertTrue("cause should be InterruptedException, was: " + throwableRef.get().getCause(), - throwableRef.get().getCause() instanceof InterruptedException); } /** @@ -296,8 +294,6 @@ public class TestAbortHandling extends B Assert.assertTrue("should have finished get request", getLatch.await(1, TimeUnit.SECONDS)); Assert.assertTrue("should be instanceof IOException, was: " + throwableRef.get(), throwableRef.get() instanceof IOException); - Assert.assertTrue("cause should be InterruptedException, was: " + throwableRef.get().getCause(), - throwableRef.get().getCause() instanceof InterruptedException); }