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/trunk@1373193 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tsz-wo Sze 2012-08-15 02:23:21 +00:00
parent 6c96039693
commit f41497c141
2 changed files with 5 additions and 1 deletions

View File

@ -605,6 +605,10 @@ Branch-2 ( Unreleased changes )
HDFS-3658. Fix bugs in TestDFSClientRetries and add more tests. (szetszwo)
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)
BREAKDOWN OF HDFS-3042 SUBTASKS
HDFS-2185. HDFS portion of ZK-based FailoverController (todd)

View File

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