You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by rg...@apache.org on 2009/04/22 08:02:32 UTC

svn commit: r767384 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpRandomAccessContent.java

Author: rgoers
Date: Wed Apr 22 06:02:32 2009
New Revision: 767384

URL: http://svn.apache.org/viewvc?rev=767384&view=rev
Log:
Fix VFS-243. Check that skip worked properly.

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpRandomAccessContent.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpRandomAccessContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpRandomAccessContent.java?rev=767384&r1=767383&r2=767384&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpRandomAccessContent.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpRandomAccessContent.java Wed Apr 22 06:02:32 2009
@@ -97,7 +97,15 @@
         // If the range request was ignored
         if (status == HttpURLConnection.HTTP_OK)
         {
-            mis.skip(filePointer);
+            long skipped = mis.skip(filePointer);
+            if (skipped != filePointer)
+            {
+                throw new FileSystemException("vfs.provider.http/get-range.error", new Object[]
+                {
+                    fileObject.getName(),
+                    new Long(filePointer)
+                });
+            }
         }
         dis = new DataInputStream(new FilterInputStream(mis)
         {