浏览代码

svn merge -c 1373193 FIXES: HDFS-3794. WebHDFS OPEN returns the incorrect Content-Length in the HTTP header when offset is specified and length is omitted. Contributed by Ravi Prakash

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1373399 13f79535-47bb-0310-9956-ffa450edef68
Daryn Sharp 12 年之前
父节点
当前提交
ceb7b0ba58

+ 4 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -15,6 +15,10 @@ Release 0.23.3 - UNRELEASED
     HDFS-3258. Test for HADOOP-8144 (pseudoSortByDistance in
     NetworkTopology for first rack local node). (Junping Du via eli)
 
+    HDFS-3794. WebHDFS OPEN returns the incorrect Content-Length in the HTTP
+    header when offset is specified and length is omitted.
+    (Ravi Prakash via szetszwo)
+
   OPTIMIZATIONS
 
   BUG FIXES

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

@@ -368,7 +368,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();
     }