diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2009-05-29 04:44:35 +0000 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2009-05-29 04:44:35 +0000 |
commit | 7d148e9d142df3ae44d1f4d0de9b528eb14e93ff (patch) | |
tree | 1db20f19a0fd8e1ec92b51dfd9ae6822fd4232d8 | |
parent | 872de95e54b3a552431605c804458e955908929c (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
-rw-r--r-- | src/couchdb/couch_db.erl | 5 |
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 |