summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-05-04 22:23:39 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-05-04 22:23:39 +0000
commit4708e0afcfeaaa9821c9910902495972fc5733ac (patch)
tree484e39bfb35596f05eac4a744c19f5d4d2368cf2 /src
parent0126fbf9d58928516e83c88a6a7bb8134f0901b7 (diff)
hinting to reduce sparseness in chunked attachment puts
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@771472 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-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.