couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject svn commit: r988651 - in /couchdb/trunk: share/www/script/test/attachment_ranges.js src/couchdb/couch_httpd_db.erl
Date Tue, 24 Aug 2010 18:42:16 GMT
Author: rnewson
Date: Tue Aug 24 18:42:15 2010
New Revision: 988651

URL: http://svn.apache.org/viewvc?rev=988651&view=rev
Log:
correct fencepost error for last bytes range request.

Modified:
    couchdb/trunk/share/www/script/test/attachment_ranges.js
    couchdb/trunk/src/couchdb/couch_httpd_db.erl

Modified: couchdb/trunk/share/www/script/test/attachment_ranges.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/attachment_ranges.js?rev=988651&r1=988650&r2=988651&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/attachment_ranges.js (original)
+++ couchdb/trunk/share/www/script/test/attachment_ranges.js Tue Aug 24 18:42:15 2010
@@ -108,9 +108,9 @@ couchTests.attachment_ranges = function(
         }
     });
     TEquals(206, xhr.status);
-    TEquals("text", xhr.responseText);
-    TEquals("4", xhr.getResponseHeader("Content-Length"));
-    TEquals("bytes 25-28/29", xhr.getResponseHeader("Content-Range"));
+    TEquals("ext", xhr.responseText);
+    TEquals("3", xhr.getResponseHeader("Content-Length"));
+    TEquals("bytes 26-28/29", xhr.getResponseHeader("Content-Range"));
 
 
 };

Modified: couchdb/trunk/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_db.erl?rev=988651&r1=988650&r2=988651&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_db.erl Tue Aug 24 18:42:15 2010
@@ -1096,7 +1096,7 @@ parse_ranges([], _Len, Acc) ->
 parse_ranges([{From,To}|Rest], Len, Acc) ->
     {From1, To1} = case {From, To} of
         {none, To} ->
-            {Len - To - 1, Len - 1};
+            {Len - To, Len - 1};
         {From, none} ->
             {From, Len - 1};
         _ ->



Mime
View raw message