Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B6FFD184F3 for ; Thu, 15 Oct 2015 16:35:35 +0000 (UTC) Received: (qmail 15212 invoked by uid 500); 15 Oct 2015 16:35:35 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 15166 invoked by uid 500); 15 Oct 2015 16:35:35 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 15157 invoked by uid 99); 15 Oct 2015 16:35:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Oct 2015 16:35:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 645FFE10A7; Thu, 15 Oct 2015 16:35:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kxepal@apache.org To: commits@couchdb.apache.org Date: Thu, 15 Oct 2015 16:35:35 -0000 Message-Id: <64d3630d8d2c4732a64895e209f172d1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/25] couch commit: updated refs/heads/master to 92598cd Repository: couchdb-couch Updated Branches: refs/heads/master 1aec9a4a9 -> 92598cd33 Filter out stub attachments before calculating multipart_stream length Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/81263e8d Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/81263e8d Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/81263e8d Branch: refs/heads/master Commit: 81263e8dcb9de94e24582c7140e0fde5b3d74c58 Parents: ad99a53 Author: ILYA Khlopotov Authored: Fri Nov 28 13:25:19 2014 -0800 Committer: ILYA Khlopotov Committed: Wed May 6 06:55:58 2015 -0700 ---------------------------------------------------------------------- src/couch_doc.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/81263e8d/src/couch_doc.erl ---------------------------------------------------------------------- diff --git a/src/couch_doc.erl b/src/couch_doc.erl index 96945e6..38d4d7f 100644 --- a/src/couch_doc.erl +++ b/src/couch_doc.erl @@ -352,12 +352,13 @@ merge_stubs(#doc{id=Id,atts=MemBins}=StubsDoc, #doc{atts=DiskBins}) -> end. len_doc_to_multi_part_stream(Boundary, JsonBytes, Atts, SendEncodedAtts) -> + AttsToInclude = lists:filter(fun(Att) -> not couch_att:is_stub(Att) end, Atts), AttsSize = lists:foldl(fun(Att, AccAttsSize) -> [Data, Name, AttLen, DiskLen, Type, Encoding] = couch_att:fetch([data, name, att_len, disk_len, type, encoding], Att), case Data of stub -> - AccAttsSize; + not_reachable = AccAttsSize; _ -> AccAttsSize + 4 + % "\r\n\r\n" @@ -389,7 +390,7 @@ len_doc_to_multi_part_stream(Boundary, JsonBytes, Atts, SendEncodedAtts) -> length("\r\nContent-Encoding: ") end end - end, 0, Atts), + end, 0, AttsToInclude), if AttsSize == 0 -> {<<"application/json">>, iolist_size(JsonBytes)}; true ->