diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-07-16 22:56:55 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-07-16 22:56:55 +0000 |
commit | 75303fed898cbf631f7ebf2b28e807c4d0db21a4 (patch) | |
tree | 3ba5958fc24b17965343acb6cdebfeb4c87ee205 /src/couchdb/couch_db.erl | |
parent | 0afa7e82448ed103e472cddd9c82ad7f924d1385 (diff) |
Revert revision 964957 (COUCHDB-827) - solution had secondary effects.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@964971 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_db.erl')
-rw-r--r-- | src/couchdb/couch_db.erl | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl index b445046f..80f0d7bf 100644 --- a/src/couchdb/couch_db.erl +++ b/src/couchdb/couch_db.erl @@ -901,20 +901,10 @@ with_stream(Fd, #att{md5=InMd5,type=Type,encoding=Enc}=Att, Fun) -> write_streamed_attachment(_Stream, _F, 0) -> ok; -% LenLeft might be different from the total size of what function F returns. -% This happens when doing a pull replication of compressed attachments from a -% 0.11.0 server, where LenLeft will match the uncompressed size but we end up -% receiving the attachment compressed (therefore a size different from LenLeft). -% This is because 0.11.0 doesn't understand the query parameter -% "?att_encoding_info=true" when we do a doc request (GET /somedb/somedoc). write_streamed_attachment(Stream, F, LenLeft) -> - case F() of - Bin when is_binary(Bin) -> - ok = couch_stream:write(Stream, Bin), - write_streamed_attachment(Stream, F, LenLeft - size(Bin)); - eof -> - ok - end. + Bin = F(), + ok = couch_stream:write(Stream, Bin), + write_streamed_attachment(Stream, F, LenLeft - size(Bin)). enum_docs_since_reduce_to_count(Reds) -> couch_btree:final_reduce( |