You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2011/04/28 22:04:51 UTC

svn commit: r1097593 - /couchdb/trunk/src/couchdb/couch_file.erl

Author: fdmanana
Date: Thu Apr 28 20:04:51 2011
New Revision: 1097593

URL: http://svn.apache.org/viewvc?rev=1097593&view=rev
Log:
Use correct block offset when loading header

So far this was not a problem since our headers are always
smaller then 4091 bytes.

Modified:
    couchdb/trunk/src/couchdb/couch_file.erl

Modified: couchdb/trunk/src/couchdb/couch_file.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_file.erl?rev=1097593&r1=1097592&r2=1097593&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_file.erl (original)
+++ couchdb/trunk/src/couchdb/couch_file.erl Thu Apr 28 20:04:51 2011
@@ -390,7 +390,7 @@ find_header(Fd, Block) ->
 load_header(Fd, Block) ->
     {ok, <<1, HeaderLen:32/integer, RestBlock/binary>>} =
         file:pread(Fd, Block * ?SIZE_BLOCK, ?SIZE_BLOCK),
-    TotalBytes = calculate_total_read_len(1, HeaderLen),
+    TotalBytes = calculate_total_read_len(5, HeaderLen),
     case TotalBytes > byte_size(RestBlock) of
     false ->
         <<RawBin:TotalBytes/binary, _/binary>> = RestBlock;