couchdb-chttpd.git
6 years ago1.x compat: update fun: allow docs with slash in id 1.x-compat 98/head
Jan Lehnardt [Sat, 12 Dec 2015 14:14:37 +0000 (15:14 +0100)] 
1.x compat: update fun: allow docs with slash in id

6 years ago1.x compat: parse form data for externals on PUT in addtion ot POST
Jan Lehnardt [Sat, 12 Dec 2015 14:09:01 +0000 (15:09 +0100)] 
1.x compat: parse form data for externals on PUT in addtion ot POST

6 years agoFix return types of responses to view requests 94/head
Klaus Trainer [Mon, 2 Nov 2015 22:12:04 +0000 (23:12 +0100)] 
Fix return types of responses to view requests

This fixes an issue that was introduced with 72258e2 and e5b1aee.

Background:

Although all things still seemed to work, each request to a view
generated an exception with the following stack trace:

```
exception error: undefined function vacc:get/2
  in function  chttpd:result/2 (src/chttpd.erl, line 297)
  in call from chttpd:handle_request_int/1 (src/chttpd.erl, line 276)
  in call from mochiweb_http:headers/6 (src/mochiweb_http.erl, line 122)
```

6 years agoDon't set random ETag header for `_all_docs` view 93/head
Klaus Trainer [Mon, 2 Nov 2015 20:22:26 +0000 (21:22 +0100)] 
Don't set random ETag header for `_all_docs` view

This fixes the issue that by setting a random ETag header, we implicitly
promised that there's a chance of a cache hit where there was no chance.

For 2.0, we simply remove the random ETag without replacement, in order
to not accidentally cause useless cache bloat in clients.

COUCHDB-2859

6 years agoDon't set random ETag header for views
Klaus Trainer [Mon, 2 Nov 2015 17:33:19 +0000 (18:33 +0100)] 
Don't set random ETag header for views

This fixes the issue that by setting a random ETag header, we implicitly
promised that there's a chance of a cache hit where there was no chance.

For 2.0, we simply remove the random ETag without replacement, in order
to not accidentally cause useless cache bloat in clients.

COUCHDB-2859

6 years agoExplicitly create admin user and authenticate requests in chttpd_db_test cases 91/head
Jay Doane [Mon, 2 Nov 2015 00:59:32 +0000 (16:59 -0800)] 
Explicitly create admin user and authenticate requests in chttpd_db_test cases

COUCHDB-2865
BugzID: 55502

6 years agoFix Last-Event-ID header handling for db changes feed 89/head
Alexander Shorin [Thu, 29 Oct 2015 00:38:52 +0000 (03:38 +0300)] 
Fix Last-Event-ID header handling for db changes feed

This assumes Last-Event-ID header value to be opaque.

COUCHDB-2858

6 years agoAccept OPTIONS requests to list functions 88/head
Alexander Shorin [Thu, 29 Oct 2015 00:06:45 +0000 (03:06 +0300)] 
Accept OPTIONS requests to list functions

COUCHDB-2850

6 years agoRestore HTTP 301 response for /db/_design%2fddoc/* resources 87/head
Alexander Shorin [Wed, 28 Oct 2015 22:07:26 +0000 (01:07 +0300)] 
Restore HTTP 301 response for /db/_design%2fddoc/* resources

This also fixes bug that existed in 1.x when escape sequence
represented in uppercase: then we send wrong Location header
back to user causing HTTP 404 result.

COUCHDB-2674

6 years agoUpdate /_replicate handler and clean it from legacy decisions 86/head
Alexander Shorin [Tue, 27 Oct 2015 20:59:03 +0000 (23:59 +0300)] 
Update /_replicate handler and clean it from legacy decisions

It's not actual anymore to have try/catch around replicate/2 as it never
throws any errors making catch block is actually unreached for
the specified clauses.

We also shouldn't repeat our self in error response rendering here.

6 years agoBackport content negotiation from couch_httpd_* 85/head
Alexander Shorin [Thu, 22 Oct 2015 19:25:21 +0000 (22:25 +0300)] 
Backport content negotiation from couch_httpd_*

COUCHDB-2409

6 years agoMerge remote-tracking branch 'github/pr/81'
Alexander Shorin [Tue, 27 Oct 2015 19:32:54 +0000 (22:32 +0300)] 
Merge remote-tracking branch 'github/pr/81'

6 years agoFix replication when source/target are URLs
Alexander Shorin [Tue, 27 Oct 2015 13:23:22 +0000 (16:23 +0300)] 
Fix replication when source/target are URLs

Commit 895715a6 introduced a bug when we quote all the values
while we only need to escape values that references to local
databases.

6 years agoFix start_couch test helper 84/head
Alexander Shorin [Thu, 22 Oct 2015 18:27:04 +0000 (21:27 +0300)] 
Fix start_couch test helper

6 years agoEscape database name on POST /_replicate
Alexander Shorin [Tue, 20 Oct 2015 18:13:39 +0000 (21:13 +0300)] 
Escape database name on POST /_replicate

COUCHDB-2666

6 years agoUse real chttpd port for URI construct
Alexander Shorin [Tue, 20 Oct 2015 18:04:31 +0000 (21:04 +0300)] 
Use real chttpd port for URI construct

Those port that we get from config works fine until we start to ask
for a random port.

6 years agoUse new couch_httpd_multipart API
Alexander Shorin [Thu, 15 Oct 2015 20:17:41 +0000 (23:17 +0300)] 
Use new couch_httpd_multipart API

6 years agoFix multipart stream refactor
Alexander Shorin [Thu, 15 Oct 2015 19:53:12 +0000 (22:53 +0300)] 
Fix multipart stream refactor

6 years agoMerge remote-tracking branch 'github/pr/11'
Alexander Shorin [Thu, 15 Oct 2015 16:36:41 +0000 (19:36 +0300)] 
Merge remote-tracking branch 'github/pr/11'

6 years agoUse couch_epi:decide/5 for authenticate/authorize 81/head
ILYA Khlopotov [Fri, 9 Oct 2015 20:51:24 +0000 (13:51 -0700)] 
Use couch_epi:decide/5 for authenticate/authorize

6 years agoCall parse_revs 80/head
Robert Newson [Thu, 8 Oct 2015 12:14:02 +0000 (13:14 +0100)] 
Call parse_revs

COUCHDB-2845

6 years agoremove dead code
Robert Kowalski [Thu, 8 Oct 2015 09:36:56 +0000 (11:36 +0200)] 
remove dead code

i keep running into this but it is not used anywhere

PR: #79
PR-URL: https://github.com/apache/couchdb-chttpd/pull/79
Reviewed-By: Robert Newson <rnewson@apache.org>
6 years agoMake sure that database was created and deleted successfully
Alexander Shorin [Wed, 7 Oct 2015 21:02:19 +0000 (00:02 +0300)] 
Make sure that database was created and deleted successfully

6 years agoMerge remote-tracking branch 'github/pr/78'
Alexander Shorin [Thu, 1 Oct 2015 17:53:29 +0000 (20:53 +0300)] 
Merge remote-tracking branch 'github/pr/78'

6 years agoUpdate .travis.yml
Alexander Shorin [Thu, 1 Oct 2015 17:50:26 +0000 (20:50 +0300)] 
Update .travis.yml

6 years agoRemove chttpd_handlers:provider 78/head
ILYA Khlopotov [Thu, 1 Oct 2015 17:40:16 +0000 (10:40 -0700)] 
Remove chttpd_handlers:provider

`provider` function is no longer needed since providers defined by
couch_epi_plugin behaviour.

6 years agoMerge remote-tracking branch 'cloudant/simplify_couch_epi'
Robert Newson [Thu, 1 Oct 2015 15:05:34 +0000 (16:05 +0100)] 
Merge remote-tracking branch 'cloudant/simplify_couch_epi'

6 years agoProperly escape Location: HTTP header
Robert Newson [Thu, 1 Oct 2015 13:55:09 +0000 (14:55 +0100)] 
Properly escape Location: HTTP header

Non-ASCII characters in the "Location:" header must be URL-encoded. This
can happen if a document is inserted with a user-defined "_id"
containing non-ASCII characters or if a filename contains non-ASCII
characters.

COUCHDB-2673

6 years agoPass supervisor's children to couch_epi 77/head
ILYA Khlopotov [Tue, 29 Sep 2015 20:04:19 +0000 (13:04 -0700)] 
Pass supervisor's children to couch_epi

6 years agoUpdate to new couch_epi API
ILYA Khlopotov [Mon, 28 Sep 2015 16:47:02 +0000 (09:47 -0700)] 
Update to new couch_epi API

6 years agoMerge remote-tracking branch 'cloudant/2825-crypto-deprecations'
Robert Newson [Fri, 25 Sep 2015 11:06:45 +0000 (12:06 +0100)] 
Merge remote-tracking branch 'cloudant/2825-crypto-deprecations'

6 years agoLager is optional, don't start it here
Robert Newson [Thu, 24 Sep 2015 11:10:20 +0000 (12:10 +0100)] 
Lager is optional, don't start it here

6 years agoFix crypto deprecations 76/head
Robert Newson [Wed, 23 Sep 2015 18:29:54 +0000 (19:29 +0100)] 
Fix crypto deprecations

COUCHDB-2825

6 years agoFix test broken by 'Use illegal_docid error for really bad document ids'
Robert Newson [Wed, 23 Sep 2015 12:50:36 +0000 (13:50 +0100)] 
Fix test broken by 'Use illegal_docid error for really bad document ids'

6 years agoUse illegal_docid error for really bad document ids 74/head
Alexander Shorin [Thu, 17 Sep 2015 20:09:45 +0000 (23:09 +0300)] 
Use illegal_docid error for really bad document ids

6 years agoReject database names that cause enametoolong error 75/head
Robert Newson [Mon, 21 Sep 2015 22:40:11 +0000 (23:40 +0100)] 
Reject database names that cause enametoolong error

COUCHDB-2821

6 years agoImplement /db/_bulk_get endpoint 33/head
Alexander Shorin [Wed, 22 Apr 2015 18:30:47 +0000 (21:30 +0300)] 
Implement /db/_bulk_get endpoint

COUCHDB-2310

6 years agoremove tabs
Robert Newson [Thu, 17 Sep 2015 17:34:41 +0000 (18:34 +0100)] 
remove tabs

6 years agoPOST to /{db}/_all_docs with invalid keys should return 400 73/head
Nick Vatamaniuc [Wed, 16 Sep 2015 20:48:20 +0000 (16:48 -0400)] 
POST to /{db}/_all_docs with invalid keys should return 400

Now they return 500. Since there is nothing wrong on the 500,
400 is more appropriate.

For example, turns requests like these:

http -a adm:pass POST http://127.0.0.1:15984/db1/_all_docs  keys:='["1",2]'
HTTP/1.1 500 Internal Server Error
Content-Type: application/json

{
    "error": "2",
    "reason": "{illegal_docid,2}"
}

Into:

http -a adm:pass POST http://127.0.0.1:15984/db1/_all_docs  keys:='["1",2]'
HTTP/1.1 400 Bad Request
Content-Type: application/json

{
    "error": "illegal_docid",
    "reason": 2
}

COUCHDB-2815

6 years agoRevert "add clusterwide compaction for dbs"
Robert Newson [Sat, 12 Sep 2015 18:30:20 +0000 (19:30 +0100)] 
Revert "add clusterwide compaction for dbs"

This reverts commit 994f132fd0923223ec7fd0802288fc2814bcc634.

6 years agoRemove new CSRF mechanism 71/head
Robert Newson [Thu, 10 Sep 2015 11:29:23 +0000 (12:29 +0100)] 
Remove new CSRF mechanism

6 years agoFix usage of lists:keyreplace 70/head
ILYA Khlopotov [Wed, 9 Sep 2015 16:28:01 +0000 (09:28 -0700)] 
Fix usage of lists:keyreplace

6 years agoDon't insert nil into lru 69/head
Robert Newson [Tue, 8 Sep 2015 12:50:31 +0000 (13:50 +0100)] 
Don't insert nil into lru

6 years agoremove tabs
Robert Newson [Tue, 8 Sep 2015 12:49:18 +0000 (13:49 +0100)] 
remove tabs

6 years agoMerge remote-tracking branch 'cloudant/2796-improve_performance_of_providers_function'
Robert Newson [Wed, 2 Sep 2015 18:34:25 +0000 (19:34 +0100)] 
Merge remote-tracking branch 'cloudant/2796-improve_performance_of_providers_function'

6 years agoRegister service 67/head
ILYA Khlopotov [Wed, 2 Sep 2015 16:50:41 +0000 (09:50 -0700)] 
Register service

COUCHDB-2796

6 years agoUse ?SERVICE_ID macro
ILYA Khlopotov [Wed, 2 Sep 2015 16:50:08 +0000 (09:50 -0700)] 
Use ?SERVICE_ID macro

COUCHDB-2796

6 years agoMerge remote-tracking branch 'cloudant/2775-post-valid-json-header'
Robert Newson [Wed, 2 Sep 2015 15:30:18 +0000 (16:30 +0100)] 
Merge remote-tracking branch 'cloudant/2775-post-valid-json-header'

6 years agoRemove `ignore_providers` option
ILYA Khlopotov [Tue, 1 Sep 2015 13:25:12 +0000 (06:25 -0700)] 
Remove `ignore_providers` option

COUCHDB-2796

6 years agoMerge remote-tracking branch 'cloudant/2788-fix-override'
Robert Newson [Fri, 28 Aug 2015 12:57:09 +0000 (13:57 +0100)] 
Merge remote-tracking branch 'cloudant/2788-fix-override'

6 years agoCapture histogram data for _bulk_requests 66/head
Robert Newson [Thu, 27 Aug 2015 20:29:55 +0000 (21:29 +0100)] 
Capture histogram data for _bulk_requests

COUCHDB-2792

6 years agoadd clusterwide compaction for dbs
Robert Kowalski [Fri, 21 Aug 2015 12:13:18 +0000 (14:13 +0200)] 
add clusterwide compaction for dbs

PRs:
https://github.com/apache/couchdb-chttpd/pull/62
https://github.com/apache/couchdb-fabric/pull/27

COUCHDB-2492

PR: #62
PR-URL: https://github.com/apache/couchdb-chttpd/pull/62
Reviewed-By: Robert Newson <rnewson@apache.org>
6 years agoFix 'override' and 'override default' functionality 64/head
ILYA Khlopotov [Tue, 25 Aug 2015 00:04:51 +0000 (17:04 -0700)] 
Fix 'override' and 'override default' functionality

COUCHDB-2788

6 years agoActually send an ETag for _view and _all_docs
Robert Newson [Tue, 25 Aug 2015 16:57:52 +0000 (17:57 +0100)] 
Actually send an ETag for _view and _all_docs

We were previously sending ETag: undefined in both cases.

It would be better to not bother with Etag at all for these as the
odds of caching are low in a sharded system.

6 years agoEtag's require quotes
Robert Newson [Tue, 25 Aug 2015 15:38:39 +0000 (16:38 +0100)] 
Etag's require quotes

6 years agoadd missing dbinfo metric
Robert Newson [Tue, 25 Aug 2015 12:20:24 +0000 (13:20 +0100)] 
add missing dbinfo metric

6 years agoThere is no binary_to_integer/1 in R14
Alexander Shorin [Tue, 25 Aug 2015 08:47:45 +0000 (11:47 +0300)] 
There is no binary_to_integer/1 in R14

6 years agoFix test after sequence format change
Alexander Shorin [Tue, 25 Aug 2015 08:07:54 +0000 (11:07 +0300)] 
Fix test after sequence format change

Caused by
https://git-wip-us.apache.org/repos/asf?p=couchdb-fabric.git;h=42a67d0a0

6 years agoIntegrate with Travis CI 63/head
Alexander Shorin [Sat, 22 Aug 2015 22:06:21 +0000 (01:06 +0300)] 
Integrate with Travis CI

6 years agoExpose node`s /_system endpoint
Alexander Shorin [Fri, 21 Aug 2015 10:09:03 +0000 (13:09 +0300)] 
Expose node`s /_system endpoint

6 years agoEnsure that provided bind_address is correct 60/head
Alexander Shorin [Fri, 21 Aug 2015 08:31:44 +0000 (11:31 +0300)] 
Ensure that provided bind_address is correct

6 years agoFix cors tests
Alexander Shorin [Wed, 19 Aug 2015 19:12:16 +0000 (22:12 +0300)] 
Fix cors tests

6 years agoDon't pass CSRF cookie to replicator 57/head
Robert Newson [Wed, 19 Aug 2015 15:41:06 +0000 (16:41 +0100)] 
Don't pass CSRF cookie to replicator

COUCHDB-2781

6 years agocheck POST requests for valid json header 56/head
Mayya Sharipova [Mon, 17 Aug 2015 14:12:46 +0000 (10:12 -0400)] 
check POST requests for valid json header

validate that all POST requests with json body must have also have valid
json header: {"Content-Type": "application/json"}
This ensures a basic protection against CSRF

JIRA: COUCHDB-2775

6 years agoWhitelist CSRF header for CORS
Robert Newson [Tue, 18 Aug 2015 09:50:29 +0000 (10:50 +0100)] 
Whitelist CSRF header for CORS

x-couchdb-csrf is a permitted request header
x-couchdb-csrf-valid is a permitted response header

COUCHDB-2762

6 years agoWhitelist CSRF header for CORS
Robert Newson [Sun, 16 Aug 2015 12:06:01 +0000 (13:06 +0100)] 
Whitelist CSRF header for CORS

COUCHDB-2762

6 years agoSupport endpoint overriding 55/head
ILYA Khlopotov [Thu, 13 Aug 2015 15:33:33 +0000 (08:33 -0700)] 
Support endpoint overriding

There are two kinds of overrides:
- overriding regular endpoint
- overriding default handler (such as chttpd_db:handle_request/1)

Therefore there are two distinct options for overriding.

    url_handler(<<"_all_dbs">>) ->
        {override, fun mymodule:handle_all_dbs_req/1};

    url_handler(_) ->
        {default, fun mymodule:handle_request/1};

6 years agoReturn `{error, {illegal_database_name, Name}}` 53/head
ILYA Khlopotov [Fri, 31 Jul 2015 18:35:24 +0000 (11:35 -0700)] 
Return `{error, {illegal_database_name, Name}}`

6 years agoUse `#httpd.qs` field
ILYA Khlopotov [Fri, 31 Jul 2015 13:27:20 +0000 (06:27 -0700)] 
Use `#httpd.qs` field

6 years agoUse private to_lower instead of string:to_lower
ILYA Khlopotov [Wed, 29 Jul 2015 18:59:42 +0000 (11:59 -0700)] 
Use private to_lower instead of string:to_lower

6 years agoAdd chttpd_plugin hooks
ILYA Khlopotov [Wed, 29 Jul 2015 18:31:28 +0000 (11:31 -0700)] 
Add chttpd_plugin hooks

We add following hooks:

 - chttpd_plugin:before_request/1
 - chttpd_plugin:after_request/2
 - chttpd_plugin:handle_error/1

6 years agoUse `#httpd.cors_config`
ILYA Khlopotov [Mon, 29 Jun 2015 13:19:11 +0000 (06:19 -0700)] 
Use `#httpd.cors_config`

6 years agoUse #httpd.absolute_uri
ILYA Khlopotov [Mon, 22 Jun 2015 18:37:54 +0000 (11:37 -0700)] 
Use #httpd.absolute_uri

6 years agoRefactor handle_request/1 to use #httpd_resp{}
ILYA Khlopotov [Mon, 22 Jun 2015 12:32:39 +0000 (05:32 -0700)] 
Refactor handle_request/1 to use #httpd_resp{}

Pass more info into #httpd{} and introduce #httpd_resp{} so we can
abstract updating stats and logging of request into separate functions.

We also prepare for introduction of before_request/after_request hooks.

6 years agoAdd `chttpd_auth:authorize/2` hook
ILYA Khlopotov [Wed, 29 Jul 2015 17:15:50 +0000 (10:15 -0700)] 
Add `chttpd_auth:authorize/2` hook

6 years agoDerive HandlerKey from path_parts
ILYA Khlopotov [Fri, 19 Jun 2015 21:12:33 +0000 (14:12 -0700)] 
Derive HandlerKey from path_parts

This is a preparation for introducing `before_request` hook.

Plugin might want to manipulate Path in order to affect handler selection.
Therefore HandlerKey calculation has to happen after
`chttpd_plugin:before_request` and it should be based on the value
returned from that call.

HandlerKey was constructed using `mochiweb_util:partition(Path, "/")`.
We change the logic to use first part of path_parts field of #httpd{}
record.

6 years agoUse '?ADMIN_USER' for admin party
ILYA Khlopotov [Wed, 5 Aug 2015 21:31:31 +0000 (14:31 -0700)] 
Use '?ADMIN_USER' for admin party

6 years agoIntroduce `chttpd_auth:authenticate` hook
ILYA Khlopotov [Wed, 29 Jul 2015 16:40:23 +0000 (09:40 -0700)] 
Introduce `chttpd_auth:authenticate` hook

6 years agoMerge remote-tracking branch 'cloudant/2762-csrf'
Robert Newson [Wed, 5 Aug 2015 13:27:38 +0000 (14:27 +0100)] 
Merge remote-tracking branch 'cloudant/2762-csrf'

6 years agoDon't send empty buffer as it terminates response prematurely
Robert Newson [Tue, 4 Aug 2015 14:40:27 +0000 (15:40 +0100)] 
Don't send empty buffer as it terminates response prematurely

6 years agoCall CouchDB's CSRF validation 52/head
Robert Newson [Fri, 31 Jul 2015 15:29:08 +0000 (16:29 +0100)] 
Call CouchDB's CSRF validation

COUCHDB-2762

6 years agoFix vhost rewrite loop but 51/head
├ôlafur Arason [Wed, 29 Jul 2015 18:24:56 +0000 (18:24 +0000)] 
Fix vhost rewrite loop but

6 years agoPort max_rewrites to chttpd 49/head
Robert Newson [Wed, 29 Jul 2015 17:17:27 +0000 (18:17 +0100)] 
Port max_rewrites to chttpd

This commit incorporates the original work by Ronny Pfannschmidt
<Ronny.Pfannschmidt@gmx.de> and myself for COUCHDB-1441 and COUCHDB-1651.

6 years agoMerge remote-tracking branch 'cloudant/chttpd-qs'
Robert Newson [Wed, 29 Jul 2015 15:20:20 +0000 (16:20 +0100)] 
Merge remote-tracking branch 'cloudant/chttpd-qs'

6 years agoHandle waiting_for_updates in callback
Robert Newson [Mon, 27 Jul 2015 12:11:29 +0000 (13:11 +0100)] 
Handle waiting_for_updates in callback

COUCHDB-2724

6 years agoRevert "Discard request body after request"
Robert Newson [Mon, 27 Jul 2015 11:32:35 +0000 (12:32 +0100)] 
Revert "Discard request body after request"

This reverts commit 56cf6412ad3572b5d07a281c5a25ec511af0530c.

6 years agoUse `chttpd:qs*` instead of `couch_httpd:qs*` 48/head
ILYA Khlopotov [Thu, 23 Jul 2015 20:15:44 +0000 (13:15 -0700)] 
Use `chttpd:qs*` instead of `couch_httpd:qs*`

6 years agoMerge branch '2724-chunked-buffering'
Adam Kocoloski [Wed, 22 Jul 2015 21:02:31 +0000 (17:02 -0400)] 
Merge branch '2724-chunked-buffering'

6 years agoMatch old behavior when buffering is disabled 2724-chunked-buffering 38/head
Adam Kocoloski [Wed, 22 Jul 2015 18:14:48 +0000 (14:14 -0400)] 
Match old behavior when buffering is disabled

If the threshold is set to zero we make sure to send a separate chunk to
close the JSON, otherwise we just merge it into the previous chunk.

6 years agoRemove support for CouchDB =< 1.0.0
Adam Kocoloski [Wed, 22 Jul 2015 18:10:43 +0000 (14:10 -0400)] 
Remove support for CouchDB =< 1.0.0

Thise UA-sniffing code has been in place to ensure interop with clients
running CouchDB versions older than 1.0.1. We should be safe to remove
it now.

6 years agoDefine an accessor for the chunk buffer config val
Adam Kocoloski [Tue, 21 Jul 2015 13:57:24 +0000 (09:57 -0400)] 
Define an accessor for the chunk buffer config val

6 years agoAllow configurable buffer size for all_docs, views
Adam Kocoloski [Mon, 20 Jul 2015 21:16:10 +0000 (17:16 -0400)] 
Allow configurable buffer size for all_docs, views

Now that couch_mrview can buffer chunked responses we should pass the
config value for the buffer size to it.

6 years agoExecute a callback for every complete DB traversal
Adam Kocoloski [Wed, 24 Jun 2015 17:56:18 +0000 (13:56 -0400)] 
Execute a callback for every complete DB traversal

This ensures that we don't enter a receive statement waiting for new DB
updates without first flushing the buffer.

COUCHDB-2724

6 years agoAdd basic buffering support for other feed types
Adam Kocoloski [Wed, 24 Jun 2015 17:47:01 +0000 (13:47 -0400)] 
Add basic buffering support for other feed types

With this code it is possible that changes are buffered for a long
period of time and not sent out. Will work on addressing that next.

COUCHDB-2724

6 years agoBuffer rows for normal/longpoll feeds
Adam Kocoloski [Tue, 23 Jun 2015 01:45:26 +0000 (21:45 -0400)] 
Buffer rows for normal/longpoll feeds

This patch causes the coordinator to accumulate data in its own buffer
and reduce the number of calls to write data on the socket. The size of
the buffer is configurable:

[httpd]
chunked_response_buffer = 1490

The default is chosen to approximately fill a standard Ethernet frame.

COUCHDB-2724

6 years agoMerge branch 'add-manual-migration-logic'
Russell Branca [Tue, 21 Jul 2015 20:51:01 +0000 (20:51 +0000)] 
Merge branch 'add-manual-migration-logic'

6 years agoDon't allow security updates during cassim migration add-manual-migration-logic 37/head
Russell Branca [Fri, 26 Jun 2015 22:30:23 +0000 (22:30 +0000)] 
Don't allow security updates during cassim migration

6 years agoMerge remote-tracking branch 'cloudant/dynamic-handlers'
Robert Newson [Tue, 21 Jul 2015 12:33:00 +0000 (13:33 +0100)] 
Merge remote-tracking branch 'cloudant/dynamic-handlers'

6 years agoDynamic http endpoint handlers 43/head
ILYA Khlopotov [Wed, 15 Jul 2015 15:15:45 +0000 (08:15 -0700)] 
Dynamic http endpoint handlers

Use `couch_epi` to implement dynamic http endpoint handlers.

The application which wishes to add dynamic endpoint would
have to do following:

  1. Add a child into application supervisor

        chttpd_handler:provider(myapp, myapp_httpd_handlers)

  2. Provide `myapp_httpd_handlers` callback module

        -module(myapp_httpd_handlers).

        -export([url_handler/1, db_handler/1, design_handler/1]).

        url_handler(<<"_foo">>) -> fun myapp_httpd:handle_foo_req/1;
        url_handler(_) -> no_match.

        db_handler(<<"_bar">>) -> fun myapp_httpd:handle_bar_req/2;
        db_handler(_) -> no_match.

        design_handler(_) -> no_match.

6 years agoValidate host header 45/head
Robert Newson [Fri, 17 Jul 2015 17:15:31 +0000 (18:15 +0100)] 
Validate host header

See enabling commit in couchdb-couch

COUCHDB-2752