retrychk.c: ADD is not a 'GET' operate, but it is 'SAFE'

Retrying an ADD will lead to errors if the first attempt was a success,
but it will not lead to unintended data manipulation.

Change-Id: Ib32225e22a7ef22338cd3cf3382b02ff97ecf69f
Reviewed-on: http://review.couchbase.org/37597
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
cbc: use lcb_durability_poll()

Change-Id: Ic694ee9312ed1580de79c390f09e63f5e7df0575
Reviewed-on: http://review.couchbase.org/37598
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Update memcached and ep-engine headers

Change-Id: I7f9f78a1486dc3187b419150c0bc5bed34c35e3e
Reviewed-on: http://review.couchbase.org/37599
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Import snappy 1.1.1

Change-Id: I513f94708a8c7e623b049c2850f990caab3f2add
Reviewed-on: http://review.couchbase.org/37601
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Fix windows build failures

Change-Id: Ib4d5cd9131911a71d534ed7ff8dcfa13b0c90f41
Reviewed-on: http://review.couchbase.org/37602
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
iotests: provider wrappers around lcb_create()

Because we now use the terse URI which the Java mock does not handle too
nicely, we are forced to disable the terse URI or risk random oddities
taking place in tests.

Provided is a doLcbCreate() function which wraps creation with various
'ctl' settings needed to ensure proper functionality within the test
environment.

Change-Id: Ibdd3eb16a1561056afcd0ee8d4dad08cbc655c05
Reviewed-on: http://review.couchbase.org/37615
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Add HELLO support

This only adds the barebones 'HELLO' support. It does not yet support
datatype handling.

Change-Id: Iefa263656f8d2299ce28e7af4d60742807036292
Reviewed-on: http://review.couchbase.org/37600
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-390: Implement "Datatype" handling

This introduces "Datatype" handling. _Datatype_ is the name of a byte in
the protocol field which was previously unused, and of which Couchbase
Server 3.0 utilizes the two low bits to indicate if a value is JSON
and/or compressed.

This patch:

- Exposes options controlling compression and inflation
- Optionally compresses and inflates outgoing and incoming data
- Advertises the datatype support in the HELLO negotiation
- Handles relocation of compressed payloads by inflating them before
  being retried.

Change-Id: I222fd140507be1f02409be29efd56cd5733fa207
Reviewed-on: http://review.couchbase.org/37616
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
retrychk: declare local variable as proper enum type

Change-Id: If4616b39dfa93ca21cbd222bb36320b7ed2eca72
Reviewed-on: http://review.couchbase.org/37617
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Rename mc_SASL* stuff to mc_SESS* stuff

Session initialization will do more than SASL now

Change-Id: Ib2dd39336554583375fd11d06728d06b33232485
Reviewed-on: http://review.couchbase.org/37618
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Let mc_SESSION perform SSLify

Change-Id: Ia44aa5d3c5ab5ac0727649b7d897ccba58578393
Reviewed-on: http://review.couchbase.org/37619
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-433/CCBC-440 A new randomization algorithm.

Now using a Fisher–Yates shuffle to randomize the host list.

Change-Id: Ic9c8c862a4041b190b4c1ec0847f59a8b375ee9b
Reviewed-on: http://review.couchbase.org/37790
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
dup_packet: readjust body len after inflation

Change-Id: I00b70f9bfb7c4ed27dd975c4154805b383a8b91b
Reviewed-on: http://review.couchbase.org/37782
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Silence some more annoying Clang warnings

Such as -Wcast-align from char to other types

Change-Id: Ic670529c170c096ce33e33ffbfb32eff77a520c1
Reviewed-on: http://review.couchbase.org/37783
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
vbucket: add lcbvb_genconfig_ex()

This allows to generate a configuration handle using more detailed input
parameters. Provided to better test forwarding emulation

Change-Id: Ic9a767b72aa4536737ffe7eaf2c0f506b7c0c280
Reviewed-on: http://review.couchbase.org/37784
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-441: Set expiration from old-style to new style command

Change-Id: I4a14643d3835475bc1b67e20c47e2a14d6edda40
Reviewed-on: http://review.couchbase.org/37785
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Brett Lawson <brett19@gmail.com>
operations: add mcreq_sched_enter() usage

Even though this function is currently a noop, it's still good to have

Change-Id: Ib141b8c4573e8b8c6ca31696fc64d627ee4ad7a5
Reviewed-on: http://review.couchbase.org/37786
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
lcb_config_transport: add constant indicating maximum value

Change-Id: I5ef2e879986e21d5d77961a45845c7bab3b433fd
Reviewed-on: http://review.couchbase.org/37787
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-442: Allow string key=value mode for lcb_cntl()

Change-Id: I3c18bfe4ec79bf249f36cbfef6083cac38ad1ab4
Reviewed-on: http://review.couchbase.org/37788
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-436: Allow more robust checks for exists of ctls

This implements the missing compmode handler and adds a test to ensure
that all control codes actually exist.

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