couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1097593 - /couchdb/trunk/src/couchdb/couch_file.erl
Date Thu, 28 Apr 2011 20:04:51 GMT
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;



Mime
View raw message