From couchdb-commits-return-394-apmail-incubator-couchdb-commits-archive=incubator.apache.org@incubator.apache.org Sun May 25 22:22:51 2008 Return-Path: Delivered-To: apmail-incubator-couchdb-commits-archive@locus.apache.org Received: (qmail 52325 invoked from network); 25 May 2008 22:22:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 May 2008 22:22:51 -0000 Received: (qmail 63372 invoked by uid 500); 25 May 2008 22:22:52 -0000 Delivered-To: apmail-incubator-couchdb-commits-archive@incubator.apache.org Received: (qmail 63353 invoked by uid 500); 25 May 2008 22:22:52 -0000 Mailing-List: contact couchdb-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-dev@incubator.apache.org Delivered-To: mailing list couchdb-commits@incubator.apache.org Received: (qmail 63344 invoked by uid 99); 25 May 2008 22:22:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 May 2008 15:22:52 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 May 2008 22:22:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7CEAB23889F1; Sun, 25 May 2008 15:22:30 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r660050 - /incubator/couchdb/trunk/src/couchdb/couch_httpd.erl Date: Sun, 25 May 2008 22:22:30 -0000 To: couchdb-commits@incubator.apache.org From: cmlenz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080525222230.7CEAB23889F1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 ->