Allow to specify alternate gtest location

Change-Id: I55bee39852b3198cd3c761ecb2f070c39853b96f
Reviewed-on: http://review.couchbase.org/38727
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Add missing NULL termination of stropcode_map

Add a NULL terminator to stropcode_map to prevent a crash in
lcb_cntl_string() if it is passed an unknown control string.

Found when trying to set 'boostrap_on' via the -C HTTP option of
cbc-pillowfight.

Change-Id: I32386485ad4d5e05ec239413c0b2dc86954bbad5
Reviewed-on: http://review.couchbase.org/38666
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Dave Rigby <daver@couchbase.com>
Document cbc with markdown/ronn for manpages

ronn is a tool to generate manpages from markdown. The advantage in
placing our documentation are markdown is that it's also easily readable
from github as well as Doxygen.

This version documents the new cbc very extensively.

Change-Id: I26dabb8d4f944caa1300c9c4ede9be11594eddc6
Reviewed-on: http://review.couchbase.org/38688
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
bc_http: Enhance 'always-on' mode:

- Throttle the reconnection attempt when the nodelist has been cycled
- Don't reconnect when no configuration exists (if the nodelist has
  ended)

Change-Id: Iade455ceb9ef2cc5e3c2e0e81ac99f2e6bc9d289
Reviewed-on: http://review.couchbase.org/38704
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-457: Don't use couchbase:// uri for --host parameter

The --host parameter should be converted to http:// to support older
semantics.

Change-Id: I1531c3723c9180479de76baa40257d3c11321979
Reviewed-on: http://review.couchbase.org/38743
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Hide 'bucket' and 'host' options

Should be specified via dsn instead

Change-Id: I58df6ff1be290919f0efe7c0072ac3022600b0cd
Reviewed-on: http://review.couchbase.org/38742
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
dsn: Don't mark host as having a port if port specified is implicit port

If a host is marked with a special port we only place it inside the
list for that specific protocol. With an implicit port we should place
it inside both lists.

Change-Id: Ie2111bfe49d6491ddbb65920c7e2cb8427726821
Reviewed-on: http://review.couchbase.org/38744
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-431: Replace vbucket_* with lcbvb_* functions

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

Unfortunately this feature is non-deterministic especially considering
how the new configuration system works. We can no longer guarantee (and
_should_ no longer guarantee) that <n> configuration updates have
actually been received. Rather the clients (and tests) should only care
about whether a valid configuration has actually been received so that
keys will be mapped to their correct nodes.

Change-Id: I145f4b57b678ffb4a851e9c1526580118f53beda
Reviewed-on: http://review.couchbase.org/38746
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
'weird_things' should be a property of bootstrap, not instance

Change-Id: Ia1dddf7806e7d7fcc4b454214716b57df1c60790
Reviewed-on: http://review.couchbase.org/38747
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
negotiate: handle cases where no mechanisms are found

This happens in raw memcached daemons where there is no authentication
configured for the instance.

Change-Id: I18085ba3164d3465b35dbce98c19be5695cb38d2
Reviewed-on: http://review.couchbase.org/38750
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
vbucket: allow to convert a config to ketama

This is used in conjunction with lcbvb_genconfig_ex to create a new
memcached bucket config

Change-Id: I76c973a94d346a70300fd9df20dd16068c5d8c32
Reviewed-on: http://review.couchbase.org/38751
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-403: Restore 'compat' memcached functionality

This provides proper memcached support. In addition to the previous
commits which add necessary prerequisites, this commit:

- Adds a new scheme, memcached://
- A new configuration provider (LCB_CLCONFIG_MCRAW)
- defines the LCB_CONFIG_MCCOMPAT_PORT for the default 11211 memcached
  port
- Before switching to HTTP streaming config, check that the current
  configuration is not a raw memcached config.

Tested with memcached 1.4.13

Change-Id: I0372ac802718a75d9d70de92c5a6eb16ad641f20
Reviewed-on: http://review.couchbase.org/38752
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
print logging message in lcb_confmon_prepare()

In some situations this function may be called multiple times in
succession (such as when enabling/disabling various providers). Print a
message separating the list of enabled and/or disabled providers.

Change-Id: I81a496521a97d408efb1af44e48aab61d8860324
Reviewed-on: http://review.couchbase.org/38765
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-452: Rename 'DSN' to 'CONNSPEC' and 'connstr'

This is a makeover of the naming semantics within the previously termed
"DSN" subsytem. The string input parameter is referred to now as
'connstr' whereas the compiled structure is known as 'lcb_CONNSPEC'.

Change-Id: I527cebc64a73a8bb3ee22c8c1fcbca68be4969f5
Reviewed-on: http://review.couchbase.org/38770
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Add functions to scan for multiple environment variables

This is needed for normalizing environment variables

Change-Id: I2ecf00357ed5bed21b642d6fc4e96ca705ce5a24
Reviewed-on: http://review.couchbase.org/38775
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Add LCB_IOPS_NAME and LCB_IOPS_SYMBOL (in addition to the older names)

We previously had LIBCOUCHBASE_EVENT_PLUGIN_NAME=.. -- let's use
something starting with LCB, and shorter.

Change-Id: Id4d52e2ee5956836fcef4b6a624357ffb0ee0877
Reviewed-on: http://review.couchbase.org/38776
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-393: Add API documentation about environment variables

Change-Id: I7fbb4c19275c2ae25620ef618b21cdfb115e8d4f
Reviewed-on: http://review.couchbase.org/38777
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Remove envvars.h

We don't use it much, and actually retaining the string literals in the
code makes it easier to grep. There's more benefit to be had from
leaving the literals inside :)

Change-Id: I763b0949254b1633faf48e5454fc2ed11cc806c1
Reviewed-on: http://review.couchbase.org/38778
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
connspec: use default couchbase:// if no string passed.

Otherwise segfaults if a v3 options is passed empty.

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