From a00cfd9770fad31639905ff8f45e702fcca6e639 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Fri, 30 Jan 2009 03:02:44 +0000 Subject: 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 --- src/couchdb/couch_httpd.erl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') 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) ++ "\"". -- cgit v1.2.3