Fix OS daemon log formatting
Refactor oauth source tree
Export missing function - couch_httpd:send_error/2

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Move addition of qs params after normalization

This refactor executes normalize_path/1 before appending the bound query
string parameters.

COUCHDB-2031
Speed up and move couch_httpd:find_in_binary.

See https://issues.apache.org/jira/browse/COUCHDB-1953
Adopt to the recent erlang-oauth (1.3+)

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Signed-off-by: Alexander Shorin <kxepal@apache.org>
Allow cacertfile without verifying peers

COUCHDB-2028
Throw cleaner error on MD5 mismatch during compaction

COUCHDB-2040
Refactor couch source tree
Remove unnecessary includes and search paths
Squash into f40f349
Remove second fd from couch_db_updater

This reverts the change to use a second file descriptor for
couch_db_udpaters to split read and writes. This is ground work for the
next few patches that change how databases are managed.
Remove couch_ref_counter and use process monitors

This patch removes the ref counting code that used process links and a
gen_server to manage when databases are idle. This is important ground
work for the refactoring of couch_server which relies on having a sane
interface to managing database.

This code has two major parts. The first part removes the gen_server
from couch_db.erl and instead relies on checking who's monitoring the
database's couch_file gen_server. The database is idle when this list
only includes the updater and possibly the couch_stats_collector which
monitors open databases.

The second half is how couch_file's are managed by listening for who is
monitoring them. If they're monitored by only zero or one process then
they close themselves. This allows for the semantics of staying open
long enough to handle any current connections while being replaced with
a new couch_file (ie, due to compaction).
[squash] to couch_file ref counter refactor
Refactor couch_server for performance

This is a backport of a change in BigCouch that changes the behaviour of
couch_server to be more performant as well as be more robust under heavy
load.

There are two main parts to this change. First, it removes the need to
have synchronous message passing between the couch_server gen_server and
every process that wants to open a database that is already open. It
does this by using a protected ets table that is used to by pass having
to talk directly to couch_server.

The second major portion of this patch rewrites the LRU handling inside
couch_server so that it doesn't turn into an N^2 loop when the
max_dbs_limit is reached and all databases are in use.
Shorter internal btree names in records
Configurable btree chunk size
New fields for chttpd and friend
Store #full_doc_info{} records in the seq tree

This improves the performance of compaction and replication by not
requiring a btree lookup for every row in the by_seq tree at the cost of
storing extra bytes on disk.
Squash to #full_doc_info{} in by_seq tree