Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
diff --git a/src/couchdb/couch_doc.erl b/src/couchdb/couch_doc.erl
index d991de2..4f5d19d 100644
--- a/src/couchdb/couch_doc.erl
+++ b/src/couchdb/couch_doc.erl
@@ -458,15 +458,17 @@ len_doc_to_multi_part_stream(Boundary, JsonBytes, Atts, SendEncodedAtts) ->
_ ->
AccAttsSize +
4 + % "\r\n\r\n"
- case SendEncodedAtts of
- true ->
- % header
- length(integer_to_list(AttLen)) +
- AttLen;
- _ ->
- % header
+ case {Encoding, SendEncodedAtts} of
+ {identity, _} ->
+ % stored and served in identity form
length(integer_to_list(DiskLen)) +
- DiskLen
+ DiskLen;
+ {_, false} when DiskLen =/= AttLen->
+ length(integer_to_list(DiskLen)) +
+ DiskLen;
+ {_, true} ->
+ length(integer_to_list(AttLen)) +
+ AttLen
end +
4 + % "\r\n--"
size(Boundary) +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.