couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r739153 - /couchdb/trunk/src/couchdb/couch_httpd.erl
Date Fri, 30 Jan 2009 03:02:44 GMT
Author: jchris
Date: Fri Jan 30 03:02:44 2009
New Revision: 739153

URL: http://svn.apache.org/viewvc?rev=739153&view=rev
Log:
use the config setting for max document size. fixes COUCHDB-60

Modified:
    couchdb/trunk/src/couchdb/couch_httpd.erl

Modified: couchdb/trunk/src/couchdb/couch_httpd.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?rev=739153&r1=739152&r2=739153&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd.erl Fri Jan 30 03:02:44 2009
@@ -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 @@
     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) ++ "\"".



Mime
View raw message