davisp commented on a change in pull request #660: Provide a more accurate size
check for max_document_size limit
URL: https://github.com/apache/couchdb/pull/660#discussion_r127752058
##########
File path: src/couch/src/couch_doc.erl
##########
@@ -127,7 +127,7 @@
doc_to_json_obj(#doc{id=Id,deleted=Del,body=Body,revs={Start, RevIds},
from_json_obj_validate(EJson) ->
MaxSize = config:get_integer("couchdb", "max_document_size", 4294967296),
Doc = from_json_obj(EJson),
- case erlang:external_size(Doc#doc.body) =< MaxSize of
+ case byte_size(jiffy:encode(Doc#doc.body)) =< MaxSize of
Review comment:
You've got an extra space there before byte_size
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services