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 7CB10EFCB for ; Sat, 2 Feb 2013 15:32:25 +0000 (UTC) Received: (qmail 58335 invoked by uid 500); 2 Feb 2013 15:32:23 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 57983 invoked by uid 500); 2 Feb 2013 15:32:22 -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 57123 invoked by uid 99); 2 Feb 2013 15:32:19 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Feb 2013 15:32:19 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 23BC682943B; Sat, 2 Feb 2013 15:32:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jhs@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [9/20] git commit: fix multipart response mixup, fixes replication.js Message-Id: <20130202153219.23BC682943B@tyr.zones.apache.org> Date: Sat, 2 Feb 2013 15:32:19 +0000 (UTC) fix multipart response mixup, fixes replication.js Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/734ca248 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/734ca248 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/734ca248 Branch: refs/heads/console_log Commit: 734ca24858c1fdcaa9d998f19bbf7f3e35817f64 Parents: 09d6787 Author: Jan Lehnardt Authored: Sun Jan 27 23:49:38 2013 +0100 Committer: Jan Lehnardt Committed: Sun Jan 27 23:49:57 2013 +0100 ---------------------------------------------------------------------- src/couchdb/couch_doc.erl | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/734ca248/src/couchdb/couch_doc.erl ---------------------------------------------------------------------- diff --git a/src/couchdb/couch_doc.erl b/src/couchdb/couch_doc.erl index 0c7b2d9..39e2354 100644 --- a/src/couchdb/couch_doc.erl +++ b/src/couchdb/couch_doc.erl @@ -461,14 +461,14 @@ len_doc_to_multi_part_stream(Boundary, JsonBytes, Atts, SendEncodedAtts) -> AccAttsSize + 4 + % "\r\n\r\n" case SendEncodedAtts of - false -> + true -> % header - length(integer_to_list(DiskLen)) + - DiskLen; + length(integer_to_list(AttLen)) + + AttLen; _ -> % header - length(integer_to_list(AttLen)) + - AttLen + length(integer_to_list(DiskLen)) + + DiskLen end + 4 + % "\r\n--" size(Boundary) + @@ -533,8 +533,8 @@ atts_to_mp([Att | RestAtts], Boundary, WriteFun, % write headers LengthBin = case SendEncodedAtts of - true -> list_to_binary(integer_to_list(DiskLen)); - false -> list_to_binary(integer_to_list(AttLen)) + true -> list_to_binary(integer_to_list(AttLen)); + false -> list_to_binary(integer_to_list(DiskLen)) end, WriteFun(<<"\r\nContent-Disposition: attachment; filename=\"", Name/binary, "\"">>), WriteFun(<<"\r\nContent-Type: ", Type/binary>>),