hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r702592 - in /httpcomponents/httpcore/trunk: RELEASE_NOTES.txt module-main/src/main/java/org/apache/http/impl/io/ContentLengthInputStream.java module-main/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java
Date Tue, 07 Oct 2008 19:19:21 GMT
Author: olegk
Date: Tue Oct  7 12:19:21 2008
New Revision: 702592

URL: http://svn.apache.org/viewvc?rev=702592&view=rev
Log:
HTTPCORE-174: Position is incremented twice in ContentLengthInputStream#skip(long) 
Contributed by Ildar Safarov <ildar.safarov at gmail.com> 
Reviewed by Oleg Kalnichevski

Modified:
    httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
    httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/ContentLengthInputStream.java
    httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java

Modified: httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/RELEASE_NOTES.txt?rev=702592&r1=702591&r2=702592&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpcore/trunk/RELEASE_NOTES.txt Tue Oct  7 12:19:21 2008
@@ -1,6 +1,9 @@
 Changes since 4.0 Beta 2
 -------------------
 
+* [HTTPCORE-174] Position is incremented twice in ContentLengthInputStream#skip(long) 
+  Contributed by Ildar Safarov <ildar.safarov at gmail.com> 
+
 * [HTTPCORE-125] OSGi bundle containing HttpCore & HttpCore NIO jars. 
   Contributed by Oleg Kalnichevski <olegk at apache.org> 
 

Modified: httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/ContentLengthInputStream.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/ContentLengthInputStream.java?rev=702592&r1=702591&r2=702592&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/ContentLengthInputStream.java
(original)
+++ httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/ContentLengthInputStream.java
Tue Oct  7 12:19:21 2008
@@ -214,7 +214,6 @@
             count += l;
             remaining -= l;
         }
-        this.pos += count;
         return count;
     }
 }

Modified: httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java?rev=702592&r1=702591&r2=702592&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java
(original)
+++ httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java
Tue Oct  7 12:19:21 2008
@@ -114,6 +114,10 @@
         in = new ContentLengthInputStream(new SessionInputBufferMockup(new byte[2]), 4L);
         in.read();
         assertTrue(in.skip(2) == 1);
+
+        in = new ContentLengthInputStream(new SessionInputBufferMockup(new byte[20]), 10L);
+        in.skip(5);
+        assertEquals(5, in.read(new byte[20]));
     }
 
     public void testClose() throws IOException {



Mime
View raw message