couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject git commit: fix multipart response mixup, fixes replication.js
Date Sun, 27 Jan 2013 22:50:05 GMT
Updated Branches:
  refs/heads/master 09d6787ef -> 734ca2485


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/master
Commit: 734ca24858c1fdcaa9d998f19bbf7f3e35817f64
Parents: 09d6787
Author: Jan Lehnardt <jan@apache.org>
Authored: Sun Jan 27 23:49:38 2013 +0100
Committer: Jan Lehnardt <jan@apache.org>
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>>),


Mime
View raw message