summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2010-06-15 18:52:11 +0000
committerDamien F. Katz <damien@apache.org>2010-06-15 18:52:11 +0000
commit8f6a0089ee04ff7e95d1650ab1a2b7ddc0fcaca6 (patch)
tree690bbac8b6051c04ef69e0427d6f53cf8078b424 /src
parente421789386d4f621ddbb1a107278f7843b3042c8 (diff)
Fix for wrong offset when writing headers and converting them to blocks, only triggered when header is larger than 4k. COUCHDB-800.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@955000 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_file.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl
index 1f1fbe83..59074b65 100644
--- a/src/couchdb/couch_file.erl
+++ b/src/couchdb/couch_file.erl
@@ -302,7 +302,7 @@ handle_call({write_header, Bin}, _From, #file{fd=Fd, eof=Pos}=File) ->
BlockOffset ->
Padding = <<0:(8*(?SIZE_BLOCK-BlockOffset))>>
end,
- FinalBin = [Padding, <<1, BinSize:32/integer>> | make_blocks(1, [Bin])],
+ FinalBin = [Padding, <<1, BinSize:32/integer>> | make_blocks(5, [Bin])],
case file:write(Fd, FinalBin) of
ok ->
{reply, ok, File#file{eof=Pos+iolist_size(FinalBin)}};