couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cml...@apache.org
Subject svn commit: r660050 - /incubator/couchdb/trunk/src/couchdb/couch_httpd.erl
Date Sun, 25 May 2008 22:22:30 GMT
Author: cmlenz
Date: Sun May 25 15:22:29 2008
New Revision: 660050

URL: http://svn.apache.org/viewvc?rev=660050&view=rev
Log:
Use limit of 4GB for document PUT requests, instead of the MochiWeb default of 1MB. Closes
COUCHDB-37.

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

Modified: incubator/couchdb/trunk/src/couchdb/couch_httpd.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/src/couchdb/couch_httpd.erl?rev=660050&r1=660049&r2=660050&view=diff
==============================================================================
--- incubator/couchdb/trunk/src/couchdb/couch_httpd.erl (original)
+++ incubator/couchdb/trunk/src/couchdb/couch_httpd.erl Sun May 25 15:22:29 2008
@@ -15,6 +15,9 @@
 
 -export([start_link/3, stop/0, handle_request/2]).
 
+% Maximum size of document PUT request body (4GB)
+-define(MAX_DOC_SIZE, (4*1024*1024*1024)).
+
 -record(doc_query_args, {
     options = [],
     rev = "",
@@ -354,7 +357,7 @@
         direction = Dir,
         start_docid = StartDocId,
         end_docid = EndDocId
-        } = QueryArgs = parse_view_query(Req),
+    } = QueryArgs = parse_view_query(Req),
     case couch_view:get_map_view({DbName, "_design/" ++ DocId, ViewName}) of
     {ok, View} ->
         {ok, RowCount} = couch_view:get_row_count(View),
@@ -524,7 +527,7 @@
     end;
 
 handle_doc_request(Req, 'PUT', _DbName, Db, DocId) ->
-    Json = {obj, DocProps} = cjson:decode(Req:recv_body()),
+    Json = {obj, DocProps} = cjson:decode(Req:recv_body(?MAX_DOC_SIZE)),
     DocRev = proplists:get_value("_rev", DocProps),
     Etag = case Req:get_header_value("If-Match") of
         undefined ->



Mime
View raw message