Fix build breakage with cmake 2.8

Change-Id: Ida32c782f6e7bf09bb3f16447be9092c15854986
Reviewed-on: http://review.couchbase.org/42542
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
t_misc: reformat timings tests

Change-Id: Ib0ef828186cb32e12ae5bb3637af2f23bda15e32
Reviewed-on: http://review.couchbase.org/42544
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Add test for lcb_dump()

Change-Id: I5a1a02c7f76557ede7b22dcfa4016cfe1b875838
Reviewed-on: http://review.couchbase.org/42546
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Add test for lcb_refresh_config

This test doesn't actually check for anything, except that we don't
crash when trying to refresh the config manually at the user's behest.

Change-Id: I67d205df327e94b0788cb3188383334472adb71b
Reviewed-on: http://review.couchbase.org/42547
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Add AddressSanitizer support via CMake

Change-Id: I55dc5ef0972f6c51d59b2ff52276062965e04a90
Reviewed-on: http://review.couchbase.org/42540
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Add cmake option for coverage support

Change-Id: I58a2ee2a7d5d6f030a53a251dd2f0f92acf72cc3
Reviewed-on: http://review.couchbase.org/42541
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
Reviewed-on: http://review.couchbase.org/42445
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Fix up internal.h

This rearranges some indentation and migrates some "cached"
configuration variables to the actual vbucket configuration via widely
used macros.

Change-Id: I02414913ecb68d445b73198f98144929ac1f8a92
Reviewed-on: http://review.couchbase.org/42401
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Add Priority and Issue sections for memcached relocation fix

Change-Id: Ia79f6232316c4bc19d2c5e5a9a05e86c6048bfaa
Reviewed-on: http://review.couchbase.org/42612
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-530: Persist vbucket configuration heuristics across updates

Change-Id: I2b5d3390c8566fed705c2eaec5d421973bb68ec9
Reviewed-on: http://review.couchbase.org/42405
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-534: Internal v2 wrappers should use lcb_sched_leave()

This enables lcb_sched_flush and LCB_CNTL_IMPLICIT_FLUSH to work
properly.

Change-Id: I6a2c703f823cb7a9f7ac81457ae178b64ca898fd
Reviewed-on: http://review.couchbase.org/42613
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-536: lcb_durability_poll should return error on schedule failure

Previously this was ignoring the return value of `mctx->done()`, which
could return with an error code.

Change-Id: I2d133a0e1cb29f271f7397e1e4cf463a63b0d010
Reviewed-on: http://review.couchbase.org/42643
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-537: cancel_http_request should call request_finish

This fixes some bugs where the request wouldn't be decremented.

Change-Id: If27026fde886983a1820612e2ffd8ba75ad7e8ae
Reviewed-on: http://review.couchbase.org/42614
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Apply AsanFlags to all build components

Previously we wouldn't get full coverage because only the 'core' objects
were compiled with the proper flags. This makes the flags apply
universally.

Change-Id: I9a2fa1c44b5e3340469c85d36915082b0e030ea2
Reviewed-on: http://review.couchbase.org/42698
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Add additional mock-compatible HTTP tests

These tests use the admin API, which is available on the mock

Change-Id: I183df65bcdb2ae8f7d6c55c8df246bfb6534e4e0
Reviewed-on: http://review.couchbase.org/42615
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-538: Fix memory leak for http requests with body

Change-Id: I446b39a7dcdca01dfea66b12ed5302be78c734b2
Reviewed-on: http://review.couchbase.org/42697
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
mcserver: clarify partial packet handling

This commit rearranges some bits of the try_read() function to make the
logic easier to follow. The code semantics itself are not changed.

Change-Id: Ib3c9ba352d909ed5a133e8ce4d8fcfb6500a5d36
Reviewed-on: http://review.couchbase.org/42549
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Move get_tmp_dir to lcb_get_tmpdir()

Makes it more testable!

Change-Id: I6572924e64c5f4673db6ffcedd450adf11d5ec31
Reviewed-on: http://review.couchbase.org/42548
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Add cmake dist target

Change-Id: I46c8cccdbe8b68ed95fdc10ed99596dbe085fc70
Reviewed-on: http://review.couchbase.org/42616
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CMake fixes for building with mingw

- Only use /usr/src/gtest if not building for Windows.
  On debian the gtest includes are placed in /usr/include, which is not
  in the compiler search path for mingw

- Change test platform liner inputs, so that ws2_32 appears at the end

- Build gtest as a static library on mingw; this allows the library to
  build with -static-libgcc

Change-Id: Ic4ecf24387db5ca87c1320b3cc8da1af869de196
Reviewed-on: http://review.couchbase.org/42767
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>