couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [17/25] couch commit: updated refs/heads/master to 92598cd
Date Thu, 15 Oct 2015 16:35:51 GMT
Length of an att should be passed as int into httpd_multipart:encode_multipart_stream


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/4fead903
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/4fead903
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/4fead903

Branch: refs/heads/master
Commit: 4fead903eb22105dd8d058f0269a10310e435247
Parents: 81263e8
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Fri Nov 28 15:46:49 2014 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Wed May 6 06:55:59 2015 -0700

----------------------------------------------------------------------
 src/couch_doc.erl             | 4 ++--
 src/couch_httpd_multipart.erl | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/4fead903/src/couch_doc.erl
----------------------------------------------------------------------
diff --git a/src/couch_doc.erl b/src/couch_doc.erl
index 38d4d7f..e16d0a7 100644
--- a/src/couch_doc.erl
+++ b/src/couch_doc.erl
@@ -422,8 +422,8 @@ decode_attributes(Atts, SendEncodedAtts) ->
         [Name, AttLen, DiskLen, Type, Encoding] =
            couch_att:fetch([name, att_len, disk_len, type, encoding], Att),
         Len = case SendEncodedAtts of
-            true -> list_to_binary(integer_to_list(AttLen));
-            false -> list_to_binary(integer_to_list(DiskLen))
+            true -> AttLen;
+            false -> DiskLen
           end,
         {Att, Name, Len, Type, Encoding}
       end, Atts).

http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/4fead903/src/couch_httpd_multipart.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_multipart.erl b/src/couch_httpd_multipart.erl
index 6ca5692..0477125 100644
--- a/src/couch_httpd_multipart.erl
+++ b/src/couch_httpd_multipart.erl
@@ -171,8 +171,9 @@ encode_multipart_stream(Boundary, JsonBytes, Atts, WriteFun, AttFun) ->
 
 atts_to_mp([], _Boundary, WriteFun, _AttFun) ->
     WriteFun(<<"--">>);
-atts_to_mp([{Att, Name, LengthBin, Type, Encoding} | RestAtts], Boundary, WriteFun,
+atts_to_mp([{Att, Name, Len, Type, Encoding} | RestAtts], Boundary, WriteFun,
     AttFun)  ->
+    LengthBin = list_to_binary(integer_to_list(Len)),
     % write headers
     WriteFun(<<"\r\nContent-Disposition: attachment; filename=\"", Name/binary, "\"">>),
     WriteFun(<<"\r\nContent-Type: ", Type/binary>>),


Mime
View raw message