CCBC-352: never return nmv origin index

Change-Id: I7197e3778cdbe7f77062da4fcd0bccd655d1f9ec
Reviewed-on: http://review.couchbase.org/34899
Reviewed-by: Subhashni Balakrishnan <b.subhashni@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Fix whitespace issues in cJSON.

Change-Id: I796e6d0a1fc2e68d7600259cc263619ddca7b369
Reviewed-on: http://review.couchbase.org/34913
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Brett Lawson <brett19@gmail.com>
Optimized cJSON to allow faster config parsing.

cJSON change to allow you to enable a pool (compile time) that
will be used for performing cJSON structure malloc/free's.
This trades memory usage for performance (10% additional
memory usage for parsed tree, 2000% increase in runtime
performance).  Additionally re-ordered value parsing to avoid
unnecessary strncmp's as well as made tabs/spaces consistent.

Change-Id: I467f8c8afdcb9e6fbdd0e37e2a730f1e0a7b4024
Reviewed-on: http://review.couchbase.org/34914
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Brett Lawson <brett19@gmail.com>
Optimize libvbucket populate_bucket.

libvbucket called cJSON_GetArrayItem recursively,
which itself is a loop over many objects.  Removed
the need for this triple embedded loop.

Change-Id: I338467cdfe17b139b8339921063dd2f13c804e8d
Reviewed-on: http://review.couchbase.org/34917
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Subhashni Balakrishnan <b.subhashni@gmail.com>
Tested-by: Brett Lawson <brett19@gmail.com>
Provide error code in log message for timeout_server

This isn't always called on a timeout

Change-Id: I1600e77503f17da7261a1cb1422db97638298736
Reviewed-on: http://review.couchbase.org/34953
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-343: Fix environment variable handling for 'booleans'

Change-Id: Ied96696658c9828f6a555365afad43bd4cce5a7d
Reviewed-on: http://review.couchbase.org/34359
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Restore DTrace functionality.

Change-Id: I23f2684436c8ced9fd7e30eb0a472fbac99b81f3
Reviewed-on: http://review.couchbase.org/33814
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Brett Lawson <brett19@gmail.com>
CCBC-350: Add cntl to report changeset used by binary

Change-Id: Ib8240c4d899fdf3f6c4988a52f23ddf2e37def8b
Reviewed-on: http://review.couchbase.org/34898
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Map NOT_MY_VBUCKET calls to LCB_ETIMEDOUT

While this is technically incorrect, the only time we allow a
NOT_MY_VBUCKET to reach the response handler code here is during the
event of a timeout where the command is no longer retried. This
simplifies application development in allowing this failure to be
treated as a normal "Timeout" - with all its actionable dependencies.

Change-Id: Iae9806eb0a831d492f06c0fdd175ccdf312c28e9
Reviewed-on: http://review.couchbase.org/34650
Reviewed-by: Subhashni Balakrishnan <b.subhashni@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
bc_http: remove 'protocol_error' handling

We shouldn't fail out an entire provider if a single node happens to
complain about something

Change-Id: If16ce998f43c75ddbcfa7dc92f7fd61ebdad72b5
Reviewed-on: http://review.couchbase.org/34954
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Remove 'always_on' flag

This can be inferred by setting the idle timeout to -1

Change-Id: I07737df2d8972c6d3153f75f3007ee566545d06d
Reviewed-on: http://review.couchbase.org/34955
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Revert default behavior to 'always on' streaming mode

Config cache will still used 'timed' connections which linger

Change-Id: I6c78fb915d332392ee76692d13bd1f88a8c2c734
Reviewed-on: http://review.couchbase.org/34957
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
bc_file bugfixes

- Always update last_mtime after successful update
- Don't check vbucket changes. This is done by confmon and the core

Change-Id: I7d5b62149ca372ff8881f7673697adb9458f11b6
Reviewed-on: http://review.couchbase.org/34988
Reviewed-by: Subhashni Balakrishnan <b.subhashni@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Terminate provider network polling on first call to success()

This call indicates we've received a new network configuration and
should stop polling.

Change-Id: I5a66f8ad5888a61966d0afb6ec0a090bbda6ebc7
Reviewed-on: http://review.couchbase.org/34969
Reviewed-by: Subhashni Balakrishnan <b.subhashni@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Don't parse NMV config if cccp is disabled

Change-Id: I14532f43835e87f6808ca20ee880537528f16d1f
Reviewed-on: http://review.couchbase.org/34997
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Subhashni Balakrishnan <b.subhashni@gmail.com>
Sanitize $HOST markers before propagating to confmon

This way the configuration cache can take advantage of CCCP configs.

Change-Id: I57e2b3ad0e6be1cb1e39c872fbd018a905cff8ac
Reviewed-on: http://review.couchbase.org/34995
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Subhashni Balakrishnan <b.subhashni@gmail.com>
cbc: Add config cache option

Change-Id: I60bde01f2056fe634bef87990c8c569949b6fd62
Reviewed-on: http://review.couchbase.org/34994
Reviewed-by: Subhashni Balakrishnan <b.subhashni@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
conncycle: Don't return success on failure

Fixed missing 'continue' within loop

Change-Id: I7b336762415db32e9aa7e95abaa9aa829e492419
Reviewed-on: http://review.couchbase.org/35004
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
is_compat => is_v220_compat

Change-Id: I06e5825a1a59112cd3b93fb8c46e30718dd2a450
Reviewed-on: http://review.couchbase.org/35012
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
bc_http: If 'always on', always reconnect

Change-Id: I28b6ca686f20e56a62ad4b1a2106d29dbbdb5cd6
Reviewed-on: http://review.couchbase.org/34956
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>