summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-01-30 03:02:44 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-01-30 03:02:44 +0000
commita00cfd9770fad31639905ff8f45e702fcca6e639 (patch)
tree7e793a593985a5341561841882a643cb972c1682
parentbbd217f334475cd83eaaf24cda71100d4db0efb0 (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
-rw-r--r--src/couchdb/couch_httpd.erl12
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) ++ "\"".