diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-01-30 03:02:44 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-01-30 03:02:44 +0000 |
commit | a00cfd9770fad31639905ff8f45e702fcca6e639 (patch) | |
tree | 7e793a593985a5341561841882a643cb972c1682 /src | |
parent | bbd217f334475cd83eaaf24cda71100d4db0efb0 (diff) |
use the config setting for max document size. fixes COUCHDB-60
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@739153 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/couchdb/couch_httpd.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index 7c371326..535a864c 100644 --- a/src/couchdb/couch_httpd.erl +++ b/src/couchdb/couch_httpd.erl @@ -26,9 +26,6 @@ -export([default_authentication_handler/1,special_test_authentication_handler/1]). -% Maximum size of document PUT request body (4GB) --define(MAX_DOC_SIZE, (4*1024*1024*1024)). - start_link() -> % read config and register for configuration changes @@ -264,10 +261,13 @@ recv(#httpd{mochi_req=MochiReq}, Len) -> MochiReq:recv(Len). body(#httpd{mochi_req=MochiReq}) -> - MochiReq:recv_body(?MAX_DOC_SIZE). + % Maximum size of document PUT request body (4GB) + MaxSize = list_to_integer( + couch_config:get("couchdb", "max_document_size", "4294967296")), + MochiReq:recv_body(MaxSize). -json_body(#httpd{mochi_req=MochiReq}) -> - ?JSON_DECODE(MochiReq:recv_body(?MAX_DOC_SIZE)). +json_body(Httpd) -> + ?JSON_DECODE(body(Httpd)). doc_etag(#doc{revs=[DiskRev|_]}) -> "\"" ++ binary_to_list(DiskRev) ++ "\"". |