commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r767384 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpRandomAccessContent.java
Date Wed, 22 Apr 2009 06:02:32 GMT
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)
         {



Mime
View raw message