CCBC-178: short require 2byte alignment

Change-Id: I556b4a19d495c46cfbdb9d4f8b4ad17789d11dd0
Reviewed-on: http://review.couchbase.org/24597
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
CCBC-180 Do not destroy event struct in release_socket()

Segmentation fault when the hostname resolved into several addresses
and first of them reject couchbase connections. In this case
libcouchbase releases socket and destroys the the event structure, so
that subsequent calls will try to dereference NULL-event.

Change-Id: I963691e36e21d9e8c322f9dc9e5c9ec36e02ba37
Reviewed-on: http://review.couchbase.org/24620
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Fix possible illegal memory access

Change-Id: If0998373f306adf4f87ed4904e467f65b64f8c1b
Reviewed-on: http://review.couchbase.org/24646
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
CCBC-182 Fix mistyped condition in the loop

The library stops iterating backup nodes list if next one isn't
accessible

Change-Id: Ia583257f6d8291e468bf23a983738c9e2f52c7d4
Reviewed-on: http://review.couchbase.org/24623
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-185: Try to validate the bootstrap hosts

Change-Id: I13c4a16df29dce074ea7de60625e322ab17c3b40
Reviewed-on: http://review.couchbase.org/24619
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Remove compile warnings

Change-Id: Ib2f208340e20e3fef79707ac7a95e08efecf396c
Reviewed-on: http://review.couchbase.org/24772
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Link with libxnet on HP-UX

Change-Id: I4c9279613e30d852fa9a82f6b41395eca6d9d027
Reviewed-on: http://review.couchbase.org/24539
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Yury Alioshinov <haster2010@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Describe how to create design document

In reply to http://www.couchbase.com/forums/thread/create-view-c-api

Change-Id: I05e6c1b6e5df64c2820e176d60b40edd85296d3d
Reviewed-on: http://review.couchbase.org/24892
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Fix build break on win32

Change-Id: I3b317e6d6a0d6123e73067d88aba194c54ed00bf
Reviewed-on: http://review.couchbase.org/24988
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Update meta data for release 2.0.4

Change-Id: Ic3d640d0f126ce6ccdb2d59656a6e672b92bbfe2
Reviewed-on: http://review.couchbase.org/25001
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Extend pillowfight a bit

Change-Id: I575bcfba3951f1e5327ee0c22aae9043f28cf2db
Reviewed-on: http://review.couchbase.org/24987
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Fix spelling in lcb_behavior_get_syncmode man page

Change-Id: I46e2d3b87757818573621a5f767c1b65b7816f99
Reviewed-on: http://review.couchbase.org/25017
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
Initialize seqno array with rand()

Change-Id: I8e46e48cf3b279c31476887c6d36a704e90c6a9d
Reviewed-on: http://review.couchbase.org/25075
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Put newline after document body for interactive users

Change-Id: Idf59dd25ccd0e9fef9fe6a3fe3bbbca757810c38
Reviewed-on: http://review.couchbase.org/25079
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
pillowfight.cc: initialize data blob with pattern

To avoid valgrind warnings like this

==19854== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s)
==19854==    at 0x5AD7A90: __sendmsg_nocancel (syscall-template.S:82)
==19854==    by 0x618727D: lcb_io_sendv (plugin-libevent.c:177)
==19854==    by 0x4E3577A: do_send_data (event.c:281)
==19854==    by 0x4E358B0: lcb_server_event_handler (event.c:325)
==19854== Memcheck, a memory error detector
==19854== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==19854== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==19854== Command: /home/avsej/code/couchbase-sdk/lcb/example/pillowfight/.libs/lt-pillowfight -t1 -Q1 -I1

Change-Id: I1a444ab568e9451c22fa19f2f5184d15c563ad88
Reviewed-on: http://review.couchbase.org/25081
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
pillowfight.cc: fix leaking event loop descriptors

==31400== FILE DESCRIPTORS: 4 open at exit.
==31400== Open file descriptor 3:
==31400==    at 0x5AD6047: epoll_create1 (syscall-template.S:82)
==31400==    by 0x638BC9C: epoll_init (ev_epoll.c:239)
==31400==    by 0x638CED1: loop_init (ev.c:2610)
==31400==    by 0x638D67B: ev_loop_new (ev.c:2787)
==31400==    by 0x6186829: lcb_create_libev_io_opts (plugin-libev.c:399)
==31400==    by 0x4E46B57: create_v1 (iofactory.c:232)
==31400==    by 0x4E46A73: create_v0 (iofactory.c:198)
==31400==    by 0x4E469A4: lcb_create_io_ops (iofactory.c:172)
==31400==    by 0x404F20: ThreadContext::ThreadContext(unsigned long) (pillowfight.cc:278)
==31400==    by 0x40417D: main (pillowfight.cc:592)

Change-Id: I8b30d6b0a6e778918be4ec2efed780393a2c4ad4
Reviewed-on: http://review.couchbase.org/25082
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
pillowfight.cc: allow gracefully terminate the loop

The benefit of this changes is that pillowfight application won't mess
valgrdind output on premature termination because signal handler will
call destructor of ThreadContext

Change-Id: I3629d1df44f09f1c51ee1bb0da6897cacb81a67e
Reviewed-on: http://review.couchbase.org/25086
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Disable pillowfight for win32

Change-Id: I5404860d97cc13baaf9d0df3e9152c241e40a2d7
Reviewed-on: http://review.couchbase.org/25094
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
pillowfight.cc: use C linkage for signal handlers

Change-Id: I8447fdf23bbf11d30ca1e49c75a58775f93373b4
Reviewed-on: http://review.couchbase.org/25102
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
pillowfight.cc: put new lines before connect errors

Change-Id: I98955500785ec92c12f19290f3a34b5e77e37dac
Reviewed-on: http://review.couchbase.org/25103
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>