Browse Source

HDFS-3794. WebHDFS Open used with Offset returns the original (and incorrect) Content Length in the HTTP Header. Contributed by Tsz Wo (Nicholas), SZE.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1504973 13f79535-47bb-0310-9956-ffa450edef68
Chris Nauroth 12 năm trước cách đây
mục cha
commit
11ed3b41da

+ 3 - 0
CHANGES.txt

@@ -86,6 +86,9 @@ Release 1.3.0 - unreleased
     HDFS-5003. TestNNThroughputBenchmark failed caused by existing directories.
     (Xi Fang via cnauroth)
 
+    HDFS-3794. WebHDFS Open used with Offset returns the original (and incorrect)
+    Content Length in the HTTP Header. (Tsz Wo (Nicholas), SZE via cnauroth)
+
 Release 1.2.1 - 2013.07.06
 
   INCOMPATIBLE CHANGES

+ 1 - 1
src/hdfs/org/apache/hadoop/hdfs/server/datanode/web/resources/DatanodeWebHdfsMethods.java

@@ -342,7 +342,7 @@ public class DatanodeWebHdfsMethods {
       }
       
       final long n = length.getValue() != null? length.getValue()
-          : in.getVisibleLength();
+          : in.getVisibleLength() - offset.getValue();
       return Response.ok(new OpenEntity(in, n, dfsclient)).type(
           MediaType.APPLICATION_OCTET_STREAM).build();
     }