CCBC-438: Set proper datatype flags for incoming data

Change-Id: Ida66185da6ebf0c1b9a2ff6e3090fd50971638b1
Reviewed-on: http://review.couchbase.org/37803
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Add additional tests for string lcb_cntl()

Change-Id: I13c9c62c5723a68d49d3f899c77f3bba57375d37
Reviewed-on: http://review.couchbase.org/37804
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
logging.h: undefine DEBUG, ERROR, and WARN

These macros are erroneously defined by other subsystems, we undefine
them with a warning if they are already defined.

Change-Id: I97bed7d15d54f81fa72d1a0a598d9980c961692b
Reviewed-on: http://review.couchbase.org/37855
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
http: remove extraneous printf

Change-Id: I89b4fa38a4d28e671fd0e0ab59784824beca37c6
Reviewed-on: http://review.couchbase.org/37856
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
bc_http: call reset_stream_state on new connection

Previously we called this inside the error handlers, but it makes more
sense (and is less error prone) to reset the state once we actually get
a new stream.

Change-Id: I931446b246e296d50e13bab1d62e38feb36508ce
Reviewed-on: http://review.couchbase.org/37857
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
lcbht: fix lcbht_reset()

lcbht_reset() should also call http_parser_init() to reset the inner
state. This should also be called from lcbht_new() as well.

Change-Id: Iaf882733828c311ecd1787223f0fb52df69b067e
Reviewed-on: http://review.couchbase.org/37858
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
http: set named susbsytem to "capi/mgmt".

Helps us identify these types of connections better in the logs

Change-Id: I01870af7cf3610529b0cf00deaae9e2f6856227d
Reviewed-on: http://review.couchbase.org/37859
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Update vbucket functionality to latest build

- Remove code for the old 3.0.0-6xx builds which used 'nodes' for SSL
  information
- Remove old config samples from 6xx. Replace them with their 7xx
  equivalents.
- Fix buffer overflow

Change-Id: I8d98c53b0e806b08102c703524600762f3c8a749
Reviewed-on: http://review.couchbase.org/37860
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Redefine 'LOG(' macro to only expand level base argument once

Change-Id: I492d823465bad3d17650865138fdfb8f7fd38909
Reviewed-on: http://review.couchbase.org/38080
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Revert "logging.h: undefine DEBUG, ERROR, and WARN"

This reverts commit db216729ced1b2cf72b716325271c7207347cd39.

We don't need this as the problem is with the double expansion of the
LOG() macros, rather than the LOGARGS() macros. The LOG() macros invoke
LOGARGS expanding the parameter before it is passed to the second macro.

Change-Id: Iaa2a28321ec0330ecbc90eb22b51ac6e898c3329
Reviewed-on: http://review.couchbase.org/38079
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Migrate smoke-test into gtest

Change-Id: I90ccb68890b7864d02929680e63987dd9e8700d5
Reviewed-on: http://review.couchbase.org/38081
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
lcbio: free resources upon lcbio_cancel()

Don't wait for the next event loop iteration, otherwise we might end up
leaving events/sockets in scope after a call to lcb_destroy()

Change-Id: Id4f37417179d66a4286e03ddee562a7579c01974
Reviewed-on: http://review.couchbase.org/38100
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
remove unused 'bummer' field from settings

- Also fixup cntl.c to better handle some opcodes

Change-Id: I61718896d445224e3da900fd85729533410740b4
Reviewed-on: http://review.couchbase.org/38082
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
vbucket-test: fixed path handling

Prepend a '/' to our desired destination

Change-Id: I7611d18d5ba3fecf7916d2addd7aa7b7e7373de1
Reviewed-on: http://review.couchbase.org/38085
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
netbuf: remove list element after freeing

Change-Id: I40e7d73fd136925bea18a548e0e957900c315c21
Reviewed-on: http://review.couchbase.org/38098
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
lcb_remove3_cmd => lcb_CMDREMOVE

Change-Id: I8f7173ba1519faf2c1280ac4f220d54c3b0ceec0
Reviewed-on: http://review.couchbase.org/38087
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Get-With-Replica - fix lots of breakage

Untested code resulted in several crashes:

- Assign strategy properly
- Copy over header to packet buffer
- Assign opaque to header
- Fix incorrect loop logic with 'FIRST' strategy
- Fix bad conditional logic when checking if there are sufficient
  replicas

Change-Id: Iaaa743740c05377dd9e0ee6af534c4bd5a6e0db4
Reviewed-on: http://review.couchbase.org/38089
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Add some more comments about how stat responses work

Change-Id: Iab00a25480f7903a8772e406be5e92b2bba8ecc0
Reviewed-on: http://review.couchbase.org/38093
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
api3: reference lcb_sched_*, not mcreq_sched_* in docs

The former are public API wrappers for the latter

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

This adds a function to decode strings encoded in 'percent encoding'.
This is needed for the URI handling within the library.

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