From 7d148e9d142df3ae44d1f4d0de9b528eb14e93ff Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Fri, 29 May 2009 04:44:35 +0000 Subject: 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 --- src/couchdb/couch_db.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3