hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1091142 - in /httpcomponents/httpclient/branches/4.1.x: ./ RELEASE_NOTES.txt httpclient/ httpclient/src/main/java/org/apache/http/client/entity/DecompressingEntity.java
Date Mon, 11 Apr 2011 17:42:05 GMT
Author: olegk
Date: Mon Apr 11 17:42:05 2011
New Revision: 1091142

URL: http://svn.apache.org/viewvc?rev=1091142&view=rev
Log:
HTTPCLIENT-1078: Decompressing entities (DeflateDecompressingEntity, GzipDecompressingEntity)
do not close content stream in #writeTo() method

Modified:
    httpcomponents/httpclient/branches/4.1.x/   (props changed)
    httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt
    httpcomponents/httpclient/branches/4.1.x/httpclient/   (props changed)
    httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/client/entity/DecompressingEntity.java

Propchange: httpcomponents/httpclient/branches/4.1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 11 17:42:05 2011
@@ -1,4 +1,4 @@
 /httpcomponents/httpclient/branches/4.0.x:950681-950688
 /httpcomponents/httpclient/branches/branch_4_1:755593-811107
 /httpcomponents/httpclient/branches/notice-plugin-test:1024348-1031454
-/httpcomponents/httpclient/trunk:1087358
+/httpcomponents/httpclient/trunk:1087358,1091140-1091141

Modified: httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt?rev=1091142&r1=1091141&r2=1091142&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt Mon Apr 11 17:42:05 2011
@@ -1,5 +1,9 @@
 Changes since 4.1.1
 
+* [HTTPCLIENT-1078] Decompressing entities (DeflateDecompressingEntity, GzipDecompressingEntity)

+  do not close content stream in #writeTo() method.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * [HTTPCLIENT-1075] Decompressing entities (DeflateDecompressingEntity, GzipDecompressingEntity)

   do not correctly handle content streaming.
   Contributed by James Abley <james.abley at gmail.com> 

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 11 17:42:05 2011
@@ -1,4 +1,4 @@
 /httpcomponents/httpclient/branches/4.0.x/httpclient:950681-950688
 /httpcomponents/httpclient/branches/branch_4_1/httpclient:755593-811107
 /httpcomponents/httpclient/branches/notice-plugin-test/httpclient:1024348-1031454
-/httpcomponents/httpclient/trunk/httpclient:1087358,1088000-1088004
+/httpcomponents/httpclient/trunk/httpclient:1087358,1088000-1088004,1091140-1091141

Modified: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/client/entity/DecompressingEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/client/entity/DecompressingEntity.java?rev=1091142&r1=1091141&r2=1091142&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/client/entity/DecompressingEntity.java
(original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/client/entity/DecompressingEntity.java
Mon Apr 11 17:42:05 2011
@@ -85,15 +85,17 @@ abstract class DecompressingEntity exten
         if (outstream == null) {
             throw new IllegalArgumentException("Output stream may not be null");
         }
-
         InputStream instream = getContent();
+        try {
+            byte[] buffer = new byte[BUFFER_SIZE];
 
-        byte[] buffer = new byte[BUFFER_SIZE];
-
-        int l;
+            int l;
 
-        while ((l = instream.read(buffer)) != -1) {
-            outstream.write(buffer, 0, l);
+            while ((l = instream.read(buffer)) != -1) {
+                outstream.write(buffer, 0, l);
+            }
+        } finally {
+            instream.close();
         }
     }
 



Mime
View raw message