CCBC-368: Bail on bootstrap when the bucket is potentially missing

This will abort the current provider iteration on the list of hosts if
an authentication or HTTP 404 error is encountered _AND_ there is no
prior configuration

Change-Id: Ic2d4c9d0c4d9fb6045583dd6ed05eb273e876f7f
Reviewed-on: http://review.couchbase.org/35979
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-367: Fix missing host for management requests

Change-Id: Iaf6c7ec3fb3d6417b5a91e24fbd3b1246e3654c0
Reviewed-on: http://review.couchbase.org/35981
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-370: Return consistent host/port from lcb_get_host/port

Change-Id: I474616a56639beb70d4105bde4de28748980d7c1
Reviewed-on: http://review.couchbase.org/35980
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-385: Handle CMD_GET_REPLICA in failout_single_request

Change-Id: Ib3833eafa99ba88c027c15cd3554fc583f07e9ae
Reviewed-on: http://review.couchbase.org/36139
Reviewed-by: Yury Alioshinov <haster2010@gmail.com>
Tested-by: Yury Alioshinov <haster2010@gmail.com>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-384: Don't abort on unrecognized WSA errors

Change-Id: Ic5ca12dc35d337ab9fde176bc13ccb69034ca143
Reviewed-on: http://review.couchbase.org/36140
Reviewed-by: Yury Alioshinov <haster2010@gmail.com>
Tested-by: Yury Alioshinov <haster2010@gmail.com>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Allow to reinitialize the providers

Change-Id: I6ad4e1d7a30af8360a4b90f4a4ecaca809fd186b
Reviewed-on: http://review.couchbase.org/35248
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
init_providers: disable providers not explicitly active

Change-Id: I8cccb1beaa03f4c4a48c536c34502c5afcf99d29
Reviewed-on: http://review.couchbase.org/35249
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-389: Disarm timeout when no commands remain

Also:
- Make purge_single_server return the number of items purged
- Don't refresh bootstrap count unless something has actually failed
- Fixup log messages so users don't get alarmed. The invocation of the
  timeout callback itself is perfectly normal (and is more efficient
  than constantly rescheduling)

Change-Id: Ie52d18201711ce3b74f09b75fceb9706088450b6
Reviewed-on: http://review.couchbase.org/36242
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-376: cJSON: fix memleak

Change-Id: I2ce43a4c21a865669008f6c1a609fec9c55f2d76
Reviewed-on: http://review.couchbase.org/36081
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
(cherry picked from commit 77a1140c229397cb125b87798cf98feb7086fed6)
Reviewed-on: http://review.couchbase.org/36235
libvbucket: parse 'rev' field

This adds a vbucket_config_get_revision() field which returns the
revision ID (if parsed) or -1 (if not found).

Change-Id: I1de653cf4823db0f914eee4964d003c0da4eb80e
Reviewed-on: http://review.couchbase.org/36301
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-332: Use revids when comparing configs

Change-Id: I4df5a5e40f6b7765d3842f072a48427561f05f48
Reviewed-on: http://review.couchbase.org/36302
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-395: Provide lcb_cntl() API for configuration cache

Change-Id: Ib11a79e73c28b0387dde2f94092c3bc1c23269b4
Reviewed-on: http://review.couchbase.org/36330
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-394: Check ringbuffer on server_start_packet_ex

Change-Id: If979226c3cdd2997ef56609ef7976968fef45bc8
Reviewed-on: http://review.couchbase.org/36525
Reviewed-by: Yury Alioshinov <haster2010@gmail.com>
Tested-by: Yury Alioshinov <haster2010@gmail.com>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-392: Fix binary incompatibilities with lcb_create_compat

This changeset attempts to alleviate some of the issues experienced by
adding a new field to lcb_create_st. These steps were taken

- Use preprocessor indirection to use a new symbol for future versions.
  Future in-source references to lcb_create_compat will actually forward
  to lcb__create_compat_230 which employs a new structure layout.

- Old 'lcb_create_compat' symbol exists in the source code file only,
  but is not inside the header. Thus older applications which relied on
  the older structure shall be directed to lcb_create_compat()

- The special exception is 2.3.0 which uses the larger structure but
  with an alternate layout. In this case the library tries to perform
  some heuristics to determine the version

- As a limitation, a configuration cache filename cannot be NULL. This
  should not affect any SDKs, but is easily fixable at the user level by
  simply providing a path for the file.

- The lcb_cached_config_st structure has been reordered so that the
  filename starts first and the trailer portion of the structure becomes
  the creation options. This allows more fields to be added to the
  'lcb_create_st' field without bringing about a scenario like this
  again.

Change-Id: Ib4b5b1611a9bf588875b448f7128be97ed4e158c
Reviewed-on: http://review.couchbase.org/36559
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Update documentation for 2.3.0/2.3.1 added fields

Change-Id: Iac660ec5fa63a5085c4febb8b34e96ec688594a8
Reviewed-on: http://review.couchbase.org/36582
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>