Use SASL unless username is NULL, not password

This fixes not being able to connect to non-default buckets

Change-Id: Iac87f53075e0c9b07b79121462c136b1e0d8735a
Reviewed-on: http://review.couchbase.org/31221
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
cbc-pillowfight features that enable DGM workloads

-D  Specify if testing with data greater than memory
   (default false) (--data-greater-than-memory)
-n  Skip populating (default false) (--no-population)
    The first option is needed for rapidly generating workload
    where the data is much greater than memory
    The second option allows the tester to directly skip to the
    workload phase if the data is already loaded.
    If this is not there, then cbc-pillowfight ends up loading
    data once again, and this can take a long time if we are in
    DGM mode!
-w  wait time in seconds for DGM operations to complete
    (default 10) (--wait-for-op)
Change-Id: Iaf372442428201c32d0f8ec1ddb7002f8899d4c4
Reviewed-on: http://review.couchbase.org/30637
Tested-by: Sundararaman Sridharan <sundar.sridharan@gmail.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reverting CCCP support to prepare for confmon

Confmon is our next-generation configuration management system which
abstracts all the config handling using a dedicated new API

Revert "Use SASL unless username is NULL, not password"

This reverts commit 61d18f314face1541beede99e2d82e5c528ab689.
Revert "Don't start a failout chain if NMVB config can't be parsed"

This reverts commit 14c7aabb75c92b143b69dddada52ef24c17e06f4.
Revert "CCBC-300 Use 'Uncommited' instead of 'Evolving' according to attributes(5)"

This reverts commit ceb345353b36a854e2161b8c1ccab81821d169c8.
Revert "Skip CMD_GET_CLUSTER_CONFIG on server failout"

This reverts commit c1128a2bdbb156f7cf78644d4eec32e087fc8b99.
Revert "Sylistic improvements for configuration"

This reverts commit 8d66cb5638e8b38f99e5b0240c8f9d33981e428e.
Revert "cbc: add switch --config-transport to choose HTTP/CCCP"

This reverts commit a12ad36abdf52ccf96f19821abb9dc8c5c151045.
Revert "Use second version of the lcb_create_st in C++ constructor"

This reverts commit 7121ba431ff950401e0bdf0be56629320e2b8a0f.
Revert "CCBC-234 Add lcb_cntl command to determine source of configuration"

This reverts commit 3e9ccd624d3b98dd4ab26bdabc11f2585dd61365.
Revert "CCBC-234 Use CCCP protocol to update vbucket configuration"

This reverts commit c010d2b4c27efb7b9da02c82084948e9f821aaba.
Revert "CCBC-234 Bootstrap with CCCP"

This reverts commit b07f1b65e4ed07832d74aaf1ec22a15b8a5f2482.
Revert "Extract function to pick node from backup list"

This reverts commit 983eaaec96ef3e9a7a5f59b7530233a112e1787f.
Revert "Refactor internal configuration struct"

This reverts commit e758c638b4842234629215ff113c400809340828.
Revert "Isolate HTTP bootstrapping code"

This reverts commit 6295d55d671dc79bdca4e56a2790f3966de84d90.

Change-Id: Ia0d3a4f52e90de46bbd8b2411327ce8a4fe554a3
Reviewed-on: http://review.couchbase.org/31633
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Allow rudimentary CMake builds on unix

Change-Id: I806ebe85ef6626d438e1e3e33dd5d0dbb268294d
Reviewed-on: http://review.couchbase.org/31640
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
pillowfight: Don't use usleep on Win32

Change-Id: Ia8693752b08ede8ea0b13f85fdc7a955b4ecc083
Reviewed-on: http://review.couchbase.org/31641
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-295 Infinitely follow redirects by default

Change-Id: I12e1656627c5fa7d8c1695d98ad6ceec439afa9d
Reviewed-on: http://review.couchbase.org/31264
Tested-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Add simple string functions

Change-Id: I2f84a8e6795732c8a70692d2b205f3d36bdd2f2b
Reviewed-on: http://review.couchbase.org/31390
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Do not cycle backup nodes on initial connection

Also the patch return meaningful error message to the user:

  $ cbc cat -h localhost:12345 foo
  ERROR: Connection failure
  	"Failed to connect to "localhost:12345": Connection refused"

Change-Id: I9760226c232d3f44c9db80417ee719c5c7138a80
Reviewed-on: http://review.couchbase.org/31676
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-299 fix constant name in the docs

Change-Id: Ifc32216939eb5c99164c587965d64169eb03f423
Reviewed-on: http://review.couchbase.org/30882
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Add hostlist

Change-Id: I2909bdb21da6404e2d285c5ef2fc52ea3f06066e
Reviewed-on: http://review.couchbase.org/31391
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Use host_s instead of s_host which is #defined on win32

Change-Id: I29ae09f714f0f085acc082a4753ad1b796d6295a
Reviewed-on: http://review.couchbase.org/31699
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Cleanup packet handling functions

Make a unified 'packet_info' structure for passing around a header and
its payload.

Change-Id: I893d7b6f93a717ead2314e5b608a2c2c097ea048
Reviewed-on: http://review.couchbase.org/31405
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Provide extended timer types/options

Change-Id: Id2198d532303025114af8307bdd952d1b780058a
Reviewed-on: http://review.couchbase.org/31389
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Refactor SASL negotiation

NOTE: the sockrw_flushed check has been removed from
lcb_server_has_pending because it causes test failures and is not needed
in this function. Specifically there is never a case when the server
has data to flush and does _not_ have a pending command somewhere. Even
if it did have data to flush, we shouldn't hold up the event loop for
that anyway.

Additionally, the negotiation callback will reset the buffers, ensuring
that if the connection's output buffer is still pending, it will be set
on V1 plugins

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

This file contained a simple set/get function which didn't warrant its
own file.

Change-Id: I7cb82f55c84794f501c398879b1b99eb8408652b
Reviewed-on: http://review.couchbase.org/31423
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Create settings structure

Change-Id: I91a83f6e2655dc5100647651f962aaf2b1af637f
Reviewed-on: http://review.couchbase.org/31407
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Add -DLIBCOUCHBASE_INTERNAL for lcbutils

Change-Id: I71a7a0955ff9c55e0621ccbfbfae0345a228a8fc
Reviewed-on: http://review.couchbase.org/31679
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-305: Create logging hooks

Change-Id: Ida74498b60fecd0b1f19a53b0d7fee9fade28e85
Reviewed-on: http://review.couchbase.org/31409
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Corrected off-by-one error on timer comparison.

Change-Id: I0498980c2c6ec8fd0df651fbf8224c678cbb3b36
Reviewed-on: http://review.couchbase.org/31793
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Brett Lawson <brett19@gmail.com>
Select: Don't call select() if there are only timers

We can sleep manually and wait for them to expire. Otherwise we get a
SOCKET_ERROR on win32 which quits the event loop

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