ioctx: Don't invoke flush_ready() callback when entered

This saves a lot of performance for being able to pipeline writes

Change-Id: Ie757d3aa700d801973c900be974b72668d829f60
Reviewed-on: http://review.couchbase.org/38986
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-459: Add error categories for server load and server responses

[ Ported from release23 ]

This commit adds two new error classifiers:

- LCB_ERRTYPE_SRVGEN for replies which are mapped one-to-one with a
  server reply.
- LCB_ERRTYPE_SRVLOAD for replies which unequivocally indicate the
  server is under load.

Change-Id: I51b3e8a843cf48276dbd4735526f78154f502d32
Reviewed-on: http://review.couchbase.org/39022
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
api3: Normalize command names

- lcb_counter3(), lcb_CMDCOUNTER, lcb_RESPCOUNTER,
  LCB_CALLBACKTYPE_COUNTER

- lcb_remove3(), lcb_CMDREMOVE, lcb_RESPREMOVE, LCB_CALLBACKTYPE_REMOVE

Change-Id: Ieb14ed062d20736c4f03e548184bdf976f84d2a7
Reviewed-on: http://review.couchbase.org/39037
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
api3: Pass int as callbacktype, rather than enum

int is more ABI-safe and shorter to type. We should convert most of our
APIs requesting 'enum' as a type over to 'int'.. that's another story
though

Change-Id: Id20755d14744a59b9fc8313d691b70121e738cae
Reviewed-on: http://review.couchbase.org/39038
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
select: stylistic changes

While trying to fork the select plugin, I realized the original could
do with some better naming conventions and use of proper typedefs for
handler types.

None of the logic was actually changed, just some whitespace and naming
fixes:

- We should use either unqualified or sel_-prefixed functions. There is
  no reason for each function to be prefixed with lcb_io_foo. Not only
  does this make the name longer, it also makes it sound like this
  function is actually exported somewhere rather than being static.

- Use prefixed names rather than the '_t' suffix.

Change-Id: I2b7f6a50a36ddaf7e30ef00425bcfaded175ccef
Reviewed-on: http://review.couchbase.org/39054
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
cliopts: don't assign progname if NULL

Logic should be inverted

Change-Id: Iec46673a75801adff5a565dd361255611f427e3a
Reviewed-on: http://review.couchbase.org/39094
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-472: update ht_nodes when receiving new config

This lets lcb_get_server_list work properly to receive new nodes

Change-Id: I5b4a06c5a83f0f5db5f21e89ec4bd6195cc9d6a4
Reviewed-on: http://review.couchbase.org/39158
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
mcserver: timeout scheduling logs should be DEBUG

These don't reflect any kind of state change or error notification

Change-Id: I534237c2c52236ef02df090fcd348fe38e41d944
Reviewed-on: http://review.couchbase.org/39159
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
autoconf: Include generate manpages in distribution

Change-Id: Id804c0fc23ac4b70172a03461087f5b008ae62df
Reviewed-on: http://review.couchbase.org/39168
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-456: Replace 'abort' with more 'robust' equivalent

Stuff might still crash, but hey, we tried.

Change-Id: I9c4f4a01cc81a1964a311d9924ea83af2b11cf63
Reviewed-on: http://review.couchbase.org/38817
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
api3: Implement HTTP functionality

This is still a bit rough around the edges as HTTP really goes through a
whole different code path

Change-Id: I8c783cc2bfcf7b7faf856673f51a79064aa4583d
Reviewed-on: http://review.couchbase.org/39145
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-430: Provide openssl locking callbacks

This will install lock callbacks for SSL, but only if they aren't there
already -- to prevent clobbering another library's handlers.

Change-Id: I2defd2666f6536f1f3b13756535abaa3cef7f2d8
Reviewed-on: http://review.couchbase.org/39202
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-471: HTTP - only increment pendops once

Change-Id: I95931cbd4b1aec1fb8b0686699606058cb871203
Reviewed-on: http://review.couchbase.org/39143
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Use newer fixed-width numeric typedefs in header files

We want to show a unified API system in our header files. We still have
a long way to go with other stuff, but the lcb_Uxx has proliferated most
of the codebase already so it's time to just change everything over.

Change-Id: I3890bc050b3b5a77356fcbc9e56e1c04464ef7e2
Reviewed-on: http://review.couchbase.org/39059
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Expose retry interval and backoff settings

- LCB_CNTL_RETRY_INTERVAL (how often to retry)
- LCB_CNTL_RETRY_BACKOFF (factor by which interval increases for each
  additional retry)

Change-Id: I12a8a791f2897d17acf85ebec5da91c4f38730c7
Reviewed-on: http://review.couchbase.org/39141
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-226: Use keepalive for views

This changeset creates a socket pool (lcbio_MGR) instance for HTTP
connections. In order to avoid situations where a pooled connection is
no longer functional, its use scope is limited to view requests and the
socket is only placed back into the pool if the underlying parser object
(via http_parser) indicates that the connection is keepalive-enabled.

Change-Id: I063ffcc67feee990d489816dbbd184e9affe7ad3
Reviewed-on: http://review.couchbase.org/39146
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Default retry interval should be 10ms, not 100ms

Change-Id: Idcd865054c7743d5e9a844706958ffc1846e73d0
Reviewed-on: http://review.couchbase.org/39142
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
http: Don't use old lcb_timer APIs

Use the new lcbio_timer ones

Change-Id: Ibfc05e2a0f2ee2ff8a5461988b426e56152e2666
Remove lcb_timer_* usage from bootstrap.c

Behavior is still in tact. In order to maintain previous behavior:

- lcb_aspend* functions are used during initial bootstrap to keep the
  event loop alive
- new macros were added allowing to switch the callback target for the
  timer

Change-Id: I6a169bdf3d177315e6414bc0b85fd69f054e9d2e
bc_file: use lcbio_timer instead of lcb_timer

Change-Id: I282e9fe463fd56c45af938f6a3a4af25b5cb8fc5