summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2009-05-29 04:44:35 +0000
committerAdam Kocoloski <kocolosk@apache.org>2009-05-29 04:44:35 +0000
commit7d148e9d142df3ae44d1f4d0de9b528eb14e93ff (patch)
tree1db20f19a0fd8e1ec92b51dfd9ae6822fd4232d8 /src
parent872de95e54b3a552431605c804458e955908929c (diff)
misapplied Antony's workaround for extra bytes in r775724
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@779839 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_db.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl
index d0a4e34c..d6105dd0 100644
--- a/src/couchdb/couch_db.erl
+++ b/src/couchdb/couch_db.erl
@@ -613,8 +613,9 @@ write_streamed_attachment(_Stream, _F, 0) ->
ok;
write_streamed_attachment(Stream, F, LenLeft) ->
Bin = F(),
- ok = couch_stream:write(Stream, check_bin_length(LenLeft, Bin)),
- write_streamed_attachment(Stream, F, LenLeft - size(Bin)).
+ TruncatedBin = check_bin_length(LenLeft, Bin),
+ ok = couch_stream:write(Stream, TruncatedBin),
+ write_streamed_attachment(Stream, F, LenLeft - size(TruncatedBin)).
%% on rare occasions ibrowse seems to process a chunked response incorrectly
%% and include an extra "\r" in the last chunk. This code ensures that we