summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_db.erl
AgeCommit message (Collapse)Author
2011-09-15Make sure view compaction terminatesFilipe David Borba Manana
If a view group is compacting and the corresponding database is shutdown by the LRU system, then the view compaction is aborted because its couch view group process shutdowns. This could lead to situations where the number of active databases is much higher than max_dbs_open and making it impossible to compact view groups. Issue reported and patch tested by Mike Leddy. Thanks. COUCHDB-1283 This is a backport of revision 1171328 from branch 1.2.x git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1171329 13f79535-47bb-0310-9956-ffa450edef68
2011-08-15Fix empty range check for raw collation.Paul Joseph Davis
The check for empty ranges was not taking into account the view option for raw collation. This fixes that by passing the couch_btree:less/2 function into the check. Patch by: Jason Smith Back port of: 1156506, 1156507, 1156509, 1156509, 1156610 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1157706 13f79535-47bb-0310-9956-ffa450edef68
2011-06-12Backport revision 1129897 from trunkFilipe David Borba Manana
Fixes to the doc PUT multipart API Don't hold the connection forever if the document is rejected by a validate_doc_update function. The solution is to discard all the attachments' data if the document was rejected. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1134942 13f79535-47bb-0310-9956-ffa450edef68
2011-05-28COUCHDB-1171 Multiple requests to _changes feed causes {error, system_limit} ↵Robert Newson
"Too many processes" git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1128704 13f79535-47bb-0310-9956-ffa450edef68
2011-05-26COUCHDB-1177 - don't read more of an attachment than Content-Length states.Robert Newson
(original patch by Paul Davis, awesomeness enhanced by Robert Newson). git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1128040 13f79535-47bb-0310-9956-ffa450edef68
2011-05-26COUCHDB-1173 - return Content-MD5 when fetching attachments where possible.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1128038 13f79535-47bb-0310-9956-ffa450edef68
2011-05-23Merged revision 1126426 from trunkFilipe David Borba Manana
Fix timing issues in the doc PUT multipart/related API Two issues were present: 1) the handler replied to the request before the multipart parser consumed all the request's data, causing a subsequent request in the same connection to consume the remaining data from the multipart/related request; 2) the data function passed to the multipart parser could consume, and discard, all or part of the data from a subsequent request in the same connection. This closes COUCHDB-1174. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1126428 13f79535-47bb-0310-9956-ffa450edef68
2011-05-21Merged revision 1125828 from trunkFilipe David Borba Manana
Add missing option to multipart/related GETs This is necessary as the client needs to be able to know if attachments are encoded or not. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1125830 13f79535-47bb-0310-9956-ffa450edef68
2011-05-06COUCHDB-760 - allow utf-8 in attachment names (patch by davisp/benoitc)Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1100254 13f79535-47bb-0310-9956-ffa450edef68
2011-04-19Merged revision 1095200 from trunkFilipe David Borba Manana
Don't set Content-Encoding headers with value "identity" This is dictated by RFC 2616 and causes problems with Microsoft's ISA 2006 proxy. Closes COUCHDB-1128. Thanks Paul Davis and Andrew Gleave. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1095204 13f79535-47bb-0310-9956-ffa450edef68
2011-03-09Merged revision 1079939 from trunkFilipe David Borba Manana
Parameter "include_docs" now honors parameter "conflicts" When querying a map view, /db/_all_docs/ or /db/_changes/ with "include_docs=true", if "conflicts=true" is given as well, the documents will contain the conflicts list (if there are conflicting revisions). Closes COUCHDB-549. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1079941 13f79535-47bb-0310-9956-ffa450edef68
2011-02-14Merged revision 1070625 from trunk:Filipe David Borba Manana
_all_docs rows must not deleted include documents After COUCHDB-1061, when POSTing to _all_docs?include_docs=true with the body "keys" option, deleted documents were part part of the output. The "doc" property of each _all_docs row should have the value 'null' for all deleted documents (when ?include_docs=true). A test was added to help prevent this from happening again. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1070631 13f79535-47bb-0310-9956-ffa450edef68
2011-02-10Merged revision 1069262 from trunkFilipe David Borba Manana
More efficient _changes?include_docs=true and _all_docs?include_docs=true Closes COUCHDB-1061 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1069264 13f79535-47bb-0310-9956-ffa450edef68
2011-01-18Avoid bug in rev tree logic during attachment uploadsAdam Kocoloski
This is a workaround for a bug in couch_key_tree, described in COUCHDB-902, which would cause uploads to fail with spurious conflicts. A patch for the key tree itself will be landing on trunk. Thanks Bob Dionne, Klaus Trainer. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1060150 13f79535-47bb-0310-9956-ffa450edef68
2011-01-11Merged revision 1057875 from trunk:Filipe David Borba Manana
Make the doc multipart GET APIs always send attachments compressed For attachments that are stored in compressed (gzip) form, make sure the document multipart/related and multipart/mixed APIs don't decompress the attachments before sending them through the socket. This is to avoid multipart parser issues when the attachment's identity length is unknown or lost due to a local to local replication triggered by CouchDB versions up to 1.0.1 Closes COUCHDB-1022. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1057879 13f79535-47bb-0310-9956-ffa450edef68
2010-12-22Merged revision 1052047 from trunk:Filipe David Borba Manana
Allow a multipart/mixed document GET to send the attachments in encoded (compressed) form Currently this API is not used internally but it's a very important one for the new replicator. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1052048 13f79535-47bb-0310-9956-ffa450edef68
2010-11-13builtin changes filters fonctions: _doc_ids & _design. replace lastBenoit Chesneau
patch to get filtering on docids. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1034891 13f79535-47bb-0310-9956-ffa450edef68
2010-11-12Proper verification of the request's accepted media types. Uses the new ↵Filipe David Borba Manana
function mochiweb_request:accepts_content_type/1. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1034554 13f79535-47bb-0310-9956-ffa450edef68
2010-11-10Support the keys parameter in GET requests.Paul Joseph Davis
You can now request a list of keys in the query string using a query string like: ?keys=["foo", "bar"] Your query string obviously needs to be properly escaped. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1033676 13f79535-47bb-0310-9956-ffa450edef68
2010-11-07Bug fix: the separator for media types in the 'Accept' header is a comma. ↵Filipe David Borba Manana
The semicolon separates a media type from its parameters. A more complete solution, which takes into account Q values, was submitted upstream: https://github.com/mochi/mochiweb/issues/issue/21. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1032391 13f79535-47bb-0310-9956-ffa450edef68
2010-11-07Allow the atts_since parameter to work together with the open_revs parameter.Filipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1032288 13f79535-47bb-0310-9956-ffa450edef68
2010-10-14like in view, check content_type on POST /db/_all_docsBenoit Chesneau
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1022447 13f79535-47bb-0310-9956-ffa450edef68
2010-10-13get _changes on specific docidsBenoit Chesneau
/POST /db/_changes {"doc_ids": ["docid1", ...]} git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1022291 13f79535-47bb-0310-9956-ffa450edef68
2010-09-30fix badmatch for COPY call with missing Destination header.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1003050 13f79535-47bb-0310-9956-ffa450edef68
2010-09-30Revert "COUCHDB-903 - add {ok, true} to COPY result."Robert Newson
This reverts commit 5d918e616119e308ca38dc847dd8165e089557dc. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1003044 13f79535-47bb-0310-9956-ffa450edef68
2010-09-30COUCHDB-903 - add {ok, true} to COPY result.Robert Newson
Thanks to Bob Dionne for original patch. I've modified it to fix the badmatch error if you do COPY without a Destination header. It now yields a 400 (Bad Request) error without spewing a stack trace. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1003035 13f79535-47bb-0310-9956-ffa450edef68
2010-09-30Removing ?getv macros.Filipe David Borba Manana
With OTP releases up to R13B03 it's not possible to define a 2 macro functions with the same name and different arities. (Only allowed in R13B04 and R14). git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1003025 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27Replacing calls to couch_util:get_value with ?getvFilipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1001879 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02fix warnings in couch_httpd_db.erlRobert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@992070 13f79535-47bb-0310-9956-ffa450edef68
2010-08-25COUCHDB-161 - range support. Adhere closer to the spec. correct range ↵Robert Newson
parsing error in mochiweb. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@988866 13f79535-47bb-0310-9956-ffa450edef68
2010-08-24correct fencepost error for last bytes range request.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@988651 13f79535-47bb-0310-9956-ffa450edef68
2010-08-24fix warnings of unused Len variables.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@988454 13f79535-47bb-0310-9956-ffa450edef68
2010-08-24set Accept-Ranges conditionally on identity encoding.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@988452 13f79535-47bb-0310-9956-ffa450edef68
2010-08-24support multiple byte ranges in Range header.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@988451 13f79535-47bb-0310-9956-ffa450edef68
2010-08-24return 400 Bad Request for unparseable range request.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@988450 13f79535-47bb-0310-9956-ffa450edef68
2010-08-22tidy range support, make inserting of multirange support more obvious.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@987936 13f79535-47bb-0310-9956-ffa450edef68
2010-08-19Support Range header for all attachments, even without compaction upgrade. ↵Robert Newson
It's just less efficient. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@987084 13f79535-47bb-0310-9956-ffa450edef68
2010-08-18COUCHDB-161 - support Range header for attachments.Robert Newson
Attachments are upgraded to support the Range header on compaction. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@986629 13f79535-47bb-0310-9956-ffa450edef68
2010-08-17fix badmatch when fetching zero byte attachments.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@986476 13f79535-47bb-0310-9956-ffa450edef68
2010-08-08provide the update_seq in all_docs view even when it is zeroJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@983336 13f79535-47bb-0310-9956-ffa450edef68
2010-08-06add Etag header for standalone attachment PUT.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@983045 13f79535-47bb-0310-9956-ffa450edef68
2010-07-24Move the tracking of the stat {httpd, clients_requesting_changes} from ↵Filipe David Borba Manana
couch_changes module into the couch_httpd_db module (that stat shouldn't be affected when the changes API is used for internal operations). git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@978918 13f79535-47bb-0310-9956-ffa450edef68
2010-07-23Removed warnings about unused vairables.Filipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@967254 13f79535-47bb-0310-9956-ffa450edef68
2010-07-22humane error message on missing design handlerJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@966685 13f79535-47bb-0310-9956-ffa450edef68
2010-07-20require application/json content-type in the remaining places where a POST ↵John Christopher Anderson
has side-effects git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@965700 13f79535-47bb-0310-9956-ffa450edef68
2010-07-11Simplification - avoid 2 proplists lookups and an unnecessary list to binary ↵Filipe David Borba Manana
conversion. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@963151 13f79535-47bb-0310-9956-ffa450edef68
2010-07-11thank you dialyzerAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@962965 13f79535-47bb-0310-9956-ffa450edef68
2010-07-08validate admin and content type for compact requestsJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@961904 13f79535-47bb-0310-9956-ffa450edef68
2010-06-24use JSON content type in replicator, require it in the _bulk_docs and other ↵John Christopher Anderson
POST apis git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957422 13f79535-47bb-0310-9956-ffa450edef68
2010-06-23Authentication caching, to avoid repeated opening and closing of the users ↵Damien F. Katz
database for each request requiring authentication. COUCHDB-807 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957314 13f79535-47bb-0310-9956-ffa450edef68