You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by nickva <gi...@git.apache.org> on 2017/03/13 14:39:19 UTC

[GitHub] couchdb-couch pull request #235: Allow limiting maximum document body size

GitHub user nickva opened a pull request:

    https://github.com/apache/couchdb-couch/pull/235

    Allow limiting maximum document body size

    Configuration is via the `couchdb.max_document_size`. In the past that
    was implemented as a maximum http request body size and this finally implements
    it by actually checking a document's body size.
    
    COUCHDB-2992

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cloudant/couchdb-couch couchdb-2992

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-couch/pull/235.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #235
    
----
commit c51c3f2bdc8e2f2a135c8363096762607ed33f2c
Author: Nick Vatamaniuc <va...@apache.org>
Date:   2017-03-13T06:33:57Z

    Allow limiting maximum document body size
    
    Configuration is via the `couchdb.max_document_size`. In the past that
    was implemented as a maximum http request body size and this finally implements
    it by actually checking a document's body size.
    
    COUCHDB-2992

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request #235: Allow limiting maximum document body size

Posted by nickva <gi...@git.apache.org>.
Github user nickva commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch/pull/235#discussion_r105816177
  
    --- Diff: src/couch_doc.erl ---
    @@ -125,7 +125,14 @@ doc_to_json_obj(#doc{id=Id,deleted=Del,body=Body,revs={Start, RevIds},
         }.
     
     from_json_obj({Props}) ->
    --- End diff --
    
    Hmm good point. It seems like the cleanest place code-wise as we do other validations in that function (`throw({doc_validation,...`). Wonder if it makes sens to make a validating and non-validation version of the function.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch issue #235: Allow limiting maximum document body size

Posted by nickva <gi...@git.apache.org>.
Github user nickva commented on the issue:

    https://github.com/apache/couchdb-couch/pull/235
  
    Related pr:
    
     * https://github.com/apache/couchdb-fabric/pull/91
    
     * https://github.com/apache/couchdb-chttpd/pull/157


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request #235: Allow limiting maximum document body size

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/couchdb-couch/pull/235


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request #235: Allow limiting maximum document body size

Posted by sagelywizard <gi...@git.apache.org>.
Github user sagelywizard commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch/pull/235#discussion_r105772791
  
    --- Diff: src/couch_doc.erl ---
    @@ -125,7 +125,14 @@ doc_to_json_obj(#doc{id=Id,deleted=Del,body=Body,revs={Start, RevIds},
         }.
     
     from_json_obj({Props}) ->
    --- End diff --
    
    Is this the right place to be making this change? `from_json_obj` is used in places other than when parsing HTTP request bodies. For example, this change will cause `fabric:cleanup_index_files` to fail if any existing design documents are larger than the limit.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch issue #235: Allow limiting maximum document body size

Posted by nickva <gi...@git.apache.org>.
Github user nickva commented on the issue:

    https://github.com/apache/couchdb-couch/pull/235
  
    @sagelywizard should be a bit better now. But ended up with another pr for fabric as well.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch issue #235: Allow limiting maximum document body size

Posted by nickva <gi...@git.apache.org>.
Github user nickva commented on the issue:

    https://github.com/apache/couchdb-couch/pull/235
  
    @sagelywizard I added a validating version of the function. The other code like cleanup_index_files can still call the old function and not crash on size limit change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---