couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vatam...@apache.org
Subject [1/2] chttpd commit: updated refs/heads/master to 60f6f6a
Date Wed, 08 Mar 2017 00:15:01 GMT
Repository: couchdb-chttpd
Updated Branches:
  refs/heads/master 90bd04811 -> 60f6f6a8b


Rename max_document_size to max_http_request_size

`max_document_size` is implemented as `max_http_request_size`. There was no
real check for document size. In some cases the implementation was close enough
of a proxy (PUT-ing and GET-ing single docs), but in some edge cases, like
_bulk_docs requests the discrepancy between request size and document size
could be rather large.

The section was changed accordingly from `couchdb` to `httpd`. `httpd` was
chosen as it applies to both clustered as well as local interface.

There is a parallel effort to implement an actual max_document_size check. The
set of commit should be merged close enough together to allow for a backwards
compatible transition.

COUCHDB-2992


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/a1470e3b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/a1470e3b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/a1470e3b

Branch: refs/heads/master
Commit: a1470e3bdbcb4b98d9cc7f5dc3641a2b008df16b
Parents: 90bd048
Author: Nick Vatamaniuc <vatamane@apache.org>
Authored: Tue Mar 7 18:01:33 2017 -0500
Committer: Nick Vatamaniuc <vatamane@apache.org>
Committed: Tue Mar 7 18:01:33 2017 -0500

----------------------------------------------------------------------
 src/chttpd.erl          | 4 ++--
 src/chttpd_external.erl | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/a1470e3b/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index cdf6e8d..89498c0 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -629,8 +629,8 @@ body(#httpd{mochi_req=MochiReq, req_body=ReqBody}) ->
     case ReqBody of
         undefined ->
             % Maximum size of document PUT request body (4GB)
-            MaxSize = list_to_integer(
-                config:get("couchdb", "max_document_size", "4294967296")),
+            MaxSize =  config:get_integer("httpd", "max_http_request_size",
+                4294967296),
             Begin = os:timestamp(),
             try
                 MochiReq:recv_body(MaxSize)

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/a1470e3b/src/chttpd_external.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_external.erl b/src/chttpd_external.erl
index 1dccf2a..4abeecb 100644
--- a/src/chttpd_external.erl
+++ b/src/chttpd_external.erl
@@ -93,7 +93,7 @@ json_req_obj_field(<<"headers">>, #httpd{mochi_req=Req}, _Db,
_DocId) ->
     Hlist = mochiweb_headers:to_list(Headers),
     to_json_terms(Hlist);
 json_req_obj_field(<<"body">>, #httpd{req_body=undefined, mochi_req=Req}, _Db,
_DocId) ->
-    MaxSize = config:get_integer("couchdb", "max_document_size", 4294967296),
+    MaxSize = config:get_integer("httpd", "max_http_request_size", 4294967296),
     try
         Req:recv_body(MaxSize)
     catch exit:normal ->


Mime
View raw message