summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/couchdb/couch_db.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl
index db865482..4cd5a5fd 100644
--- a/src/couchdb/couch_db.erl
+++ b/src/couchdb/couch_db.erl
@@ -624,10 +624,12 @@ make_writer_fun(Stream) ->
{ok, {FinalLen, SpFin}};
({Length, Bin}, {Total, nil}) ->
% save StreamPointer
+ ok = couch_stream:set_min_buffer(Stream, Length),
{ok, StreamPointer} = couch_stream:write(Stream, Bin),
{Total+Length, StreamPointer};
({Length, Bin}, {Total, SpAcc}) ->
% write the Bin to disk
+ ok = couch_stream:set_min_buffer(Stream, Length),
{ok, _Sp} = couch_stream:write(Stream, Bin),
{Total+Length, SpAcc}
end.