Refactor not-my-vbucket handling into own function

This patch is intended to be cosmetic only, and should not change any
behavior

Change-Id: I647fc90056ef8ebe648aeaa37ad73e94a2fb651b
Reviewed-on: http://review.couchbase.org/29921
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
If not retrying a NOT_MY_VBUCKET response, dispatch it

Change-Id: Iccc0fc7db983f90c5926dc3f4ae4c9bb707669bf
Reviewed-on: http://review.couchbase.org/29922
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-288: Fail NOT_MY_VBUCKET responses on timeout

Unfortunately we don't have a proper way of verifying this for now. The
mock should be updated to simulate more realistic rebalance scenarios

Change-Id: I6b66b69552abe68545086be0b1a6e8d058f7138a
Reviewed-on: http://review.couchbase.org/29924
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Pass lcb_t to map_error

This can be used to allow for more elaborate error handling schemes

Change-Id: Ic5a362f88be76e2bcd8a4e371809453afe07a487
Reviewed-on: http://review.couchbase.org/29928
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Allow hooks for mapping server codes to errors

This also helps handle sane behavior if a new error code is introduced,
or allow user-defined logging when a specific error code is received.

Change-Id: I6530aa7efceec2b7c26ddc14edab581dd48f3f6e
Reviewed-on: http://review.couchbase.org/29929
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-204: Don't use config cache with memcached buckets

Change-Id: Ie355f428f42d09962787da8a8e58ad02509fdab1
Reviewed-on: http://review.couchbase.org/29932
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reset backup_idx when necessary

backup_idx is incremented for each attempt, but if we run out of nodes
to connect to, future connection attempts will fail unless we set this
number properly.

Change-Id: I20125aeda81f5b468e580ef9034a422347f52545
Reviewed-on: http://review.couchbase.org/29986
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Add simple tool for putting load on views

Change-Id: I741c85b764435f32c97bd8db4a59dffb2a728983
Reviewed-on: http://review.couchbase.org/29057
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-286: uv: use same CRT for free/malloc

Change-Id: If394801246ac5ac40575e48760dee5e50c86a7ba
Reviewed-on: http://review.couchbase.org/29751
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Fixed compiler warning in cbsasl with msvc.

Change-Id: Ic62b38eedeb1c065492281f4938327c24bb593b1
Reviewed-on: http://review.couchbase.org/29766
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Added support for building cbsasl statically with msvc.

Change-Id: Ib2dd4f58384c151177308d5424f6295e514b3bee
Reviewed-on: http://review.couchbase.org/29765
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Fix build failure on windows

tests\regression-unit-test.cc(130): error C2057: expected constant expression
tests\regression-unit-test.cc(130): error C2466: cannot allocate an array of constant size 0
tests\regression-unit-test.cc(130): error C2133: 'cmds' : unknown size
tests\regression-unit-test.cc(131): error C2057: expected constant expression
tests\regression-unit-test.cc(131): error C2466: cannot allocate an array of constant size 0
tests\regression-unit-test.cc(131): error C2133: 'cmdlist' : unknown size
tests\regression-unit-test.cc(136): error C2070: 'lcb_get_cmd_t []': illegal sizeof operand
tests\regression-unit-test.cc(138): warning C4018: '<' : signed/unsigned mismatch

Change-Id: Ia6f3521247576de7edcb133a09ef98c9e1c9e111
Reviewed-on: http://review.couchbase.org/30031
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Brett Lawson <brett19@gmail.com>