Include <arpa/inet.h> when checking for htonll

Otherwise we clobber htonll in OS X Yosemite

Change-Id: Ica6b24e6752e7f4d68974ea613d460d8b94bacea
Reviewed-on: http://review.couchbase.org/42283
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Update release metadata for 2.4.3

Change-Id: I3158f023a6292bcb6b63df5b92c60a6835b592cc
Reviewed-on: http://review.couchbase.org/42325
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-528: Fix potential buffer corruption if observe body > 512b

If a single observe command exceeds 512 bytes, we might end up in a
situation where the values are silently discarded away.

This patch fixes this by replacing the ringbuffer system with the newer
and more straight-forward lcb_string (we don't need an erasable buffer).

Change-Id: I6d4ccd39659713af8c13e75abaa74038e75ae98a
Reviewed-on: http://review.couchbase.org/42287
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Never retry node-specific commands

Items placed in the retry queue are rerouted based on their vbucket.
Commands which have no vbucket and thus may be sent to any server; or
commands which are forwarded to a specific server should never be
retried.

Change-Id: I1d6417e541dbcb0591a8bcdb2faa40d818e4aaa4
Reviewed-on: http://review.couchbase.org/42285
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
mcreq_dump_packet: Provide string interpretations of flags

Change-Id: I9049ec7065ac4338899977d0014fab00b55c47e0
Reviewed-on: http://review.couchbase.org/42286
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Rename 'timeoutTest' to 'OpFromCallback'.

The test implies nothing about timeouts at all, just a large amount of
operations from within the callback.

Change-Id: I71aeb7f94a0539af0605ad0260277edd27fd6d0d
Reviewed-on: http://review.couchbase.org/42282
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-527: Durability timer fixes

Change-Id: I1d0a9138f1018b1408fc8e89b452fbbbcbe0dbc5
Reviewed-on: http://review.couchbase.org/42284
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-529: Return error when conflicting options are found

Change-Id: I1bf63308d7ab157eebc1d48a332a8f869b81eda4
Reviewed-on: http://review.couchbase.org/42356
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Cmake: General improvements:

Fix up rpath settings:

CMake is typically used for developer builds; and as such, we should
make an attempt to have our own libraries and tools _not_ pick up system
libraries, unless we are a system install. This mimics existing
autotools behavior.

Silence CMP0026 warning on Windows

This "old" behavior here is intended, because the `LOCATION` property
can give us the name of the install path before the project has been
generated, allowing us to transform their names into proper PDB paths to
include within the final distribution.

Add package name for VC12 (VS 2013)

We don't build these packages officially yet, but it still makes it
nicer.

Use homebrew OpenSSL if available
The default OS X OpenSSL spams us with deprecation warnings; we'd be
better off using Homebrew's version.

Change-Id: I99af9f8e9b94f77e8f16cba80481645a30564f12
Reviewed-on: http://review.couchbase.org/42443
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-529/CCBC-532: More conflicting option enforcement

This adds enforcement on not passing `exptime` if no `create` option was
set for `lcb_arithmetic`. Additionally, some more documentation was
added to the headers to inform the user of these restrictions.

Change-Id: I93189a270fd3629bdf198f823160de3cb8b11e6f
Reviewed-on: http://review.couchbase.org/42393
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-531: Document 64 bit counter on server

Change-Id: I0739573a197223d680774332840a457548638640
Reviewed-on: http://review.couchbase.org/42444
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-507: Add vbucket test cases for malformed/empty configs

Change-Id: I0d261f71887337cddfdd8a3419911150d5c49c88
Reviewed-on: http://review.couchbase.org/42447
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
mcserver: log if vbucket master is heuristically changed

Change-Id: Ic700abeccfe1ad0b68898c54bc7f524ea68caa36
Reviewed-on: http://review.couchbase.org/42402
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Rename lcbio_EASYPROCS to lcbio_CTXPROCS

The older lcbio stuff called this "EASY" because there were two
variants. Now that there's only one, the old name no longer makes sense.

Change-Id: I3f0275c4ba137921cad2719faebc1d09c69f8e60
Reviewed-on: http://review.couchbase.org/42448
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
api3: Allow lcb_install_callback3 to accept NULL

Unlike the older v2 callbacks, where a `NULL` parameter means to return
the current callback, in the v3 callbacks, a `NULL` simply means to
utilize the `LCB_CALLBACK_DEFAULT` callback.

This also adds an `lcb_get_callback3()` function, by which it is
possible to explicitly obtain the older callback (without changing the
current one); something not possible with this version of
install_callback3()

Change-Id: If8b7c8e03a2ef9daed7343f7bb2e82b791543325
Reviewed-on: http://review.couchbase.org/42474
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Assign `authority` field when generating vbucket config

This is used by comparison functions later on to determine if the config
has changed. The need for this change was detected when trying to
reconnect to a dead memcached server (using memcached:// ), upon which
the library crashed.

Change-Id: If7ed310724ce1438ed3886fb82bd55947f856d83
Reviewed-on: http://review.couchbase.org/42475
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Fix up various compilation warnings

Most of these warnings relate to not casting to void for the `%p` printf
specifier, which for some reason warns on GCC/Linux, but not clang.

Change-Id: I7e5ba55350f8ccff6cdd56620bbb9e71fbc83f13
Reviewed-on: http://review.couchbase.org/42476
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-331: Relocate commands on topology changes for memcached bucket

This simply ignores `hashkey` (considering as it's going the way of the
dodo) and simply rehashes the item based on their ketama values.

Interesting to note that since we maintain server connections in tact by
default, this new patch simply forwards commands to other servers
(despite them already being sent to the existing server), in order to
minimize the chance of receiving errors.

Change-Id: I171aaef70116cc166e4aa6956169b3dacf4f2d63
Add AddressSanitizer support via CMake

Change-Id: I55dc5ef0972f6c51d59b2ff52276062965e04a90
Add cmake option for coverage support

Change-Id: I58a2ee2a7d5d6f030a53a251dd2f0f92acf72cc3