OpenSSL doesn't document the behaviour of these functions when given a
NULL BIO, and it happens to return zero at the moment. But don't depend
on that.
Closes: #406 (cherry-picked)
Something that should help with reviewing patches.
* contrib-guide-v2:
Add CONTRIBUTING.md (with checkpatch.sh examples)
Add checkpatch script
Add config for clang-format
Add config for uncrustify
Refs: #301
macOS 10.12 introduced `clock_gettime` to libsystem. This means, built
on OS X 10.12 application would crash on earlier versions of OS X
because it will try to call clock_gettime. This options is useful to
make backwards compatible macOS apps.
Fixes: #398Fixes: #399Fixes: #400
http_uriencode_test() (in test/regress_http.c) has been failed after
72afe4c as "hello\0world" is encoded to "hello" instead of
"hello%00world". This is because of a misplaced overflow check which
causes the non-negative "size" specified in parameter being ignored in
within-bound URI.
Fixes: #392
According to solaris docs:
"One instance of a SIGCHLD signal is queued for each child process whose
status has changed. If waitpid() returns because the status of a child
process is available, and WNOWAIT was not specified in options, any pending
SIGCHLD signal associated with the process ID of that child process is
discarded. Any other pending SIGCHLD signals remain pending."
And interesting thing that it works if you add sleep(1) before waitpid(), and
also if you run with --verbose (some race or what).
But linux doesn't support WNOWAIT in waitpid() so add detection into
cmake/autotools.
Fixes: #387
Link: https://bugzilla.redhat.com/show_bug.cgi?id=840782
About this syncing pair:
- read endpoint, must be blocked, to make it a checkpoint or smth like this
- write endpoint, must be nonblocking, to avoid readcb hung
Refs: #387
During testing sometimes bufferevent/bufferevent_connect_fail_eventcb fails,
and after some digging I found that this was the case when connect() doesn't
return ECONNREFUSED immediately, and instead next operation will return it (in
our case evbuffer_read()->readv(), needless to say that after this
bufferevent_writecb() called and it checks error with getsockopt() but of
course it doesn't return any error), so this patch checks "errno" after
"readv()" and installs "bufev::connection_refused" flag, to handle this from
writecb and only once.
Fixes: bufferevent/bufferevent_connect_fail_eventcb
Fixes: bufferevent/bufferevent_connect_fail_eventcb_defer
Refs: #388
During testing on solaris 11.3, util/getaddrinfo failed at:
memset(&hints, 0, sizeof(hints));
hints.ai_flags = EVUTIL_AI_NUMERICHOST;
r = evutil_getaddrinfo("1.2.3.4", NULL, &hints, &ai);
tt_assert(ai_find_by_protocol(ai, IPPROTO_TCP));
And this is because solaris's getaddrinfo() returns:
$6 = {
ai_flags = 32,
ai_family = 2,
ai_socktype = 0,
ai_protocol = 0, <-- no proto
ai_addrlen = 16,
ai_canonname = 0x0,
ai_addr = 0x815d658,
ai_next = 0x0 <-- nothing else
}
So we should emulate this too.
Plus introduce helper that will search through all results, not only first one.
Fixes: util/getaddrinfo
Fixes: #354
Otherwise we will not detect next functions for instance:
- gethostbyname_r # and related
And now both autotools/cmake builds passes all regress tests in basic env (on
solaris of course).
Fixes: dns/client_fail_requests_getaddrinfo
This patch set introduces matrix for appveyor and fixes bugs related to win32,
during debugging this matrix. This should greatly reduce number of work for
making a release ('check under windows' part only).
Right now tests on appveyor still failes in summary, but we should dig into
problems, not hide them.
Test matrix looks like this:
- autotools
- autotools --disable-openssl
- autotools --disable-thread-support
- autotools --disable-debug-mode
- autotools --disable-malloc-replacement
- cmake
- cmake -DEVENT__DISABLE_OPENSSL=ON
- cmake -DEVENT__DISABLE_THREAD_SUPPORT=ON
- cmake -DEVENT__DISABLE_DEBUG_MODE=ON
- cmake -DEVENT__DISABLE_MM_REPLACEMENT=ON
- cmake -DEVENT__ENABLE_VERBOSE_DEBUG=ON
- cmake -DCMAKE_C_FLAGS='-DUNICODE -D_UNICODE'
And takes 90min (was 7min, and this is the sad part).
* appveyor-cmake-v6:
test/ssl: use send()/recv()/EVUTIL_ERR_RW_RETRIABLE()/EVUTIL_SOCKET_ERROR() to fix win32
test/https_basic: increase timeout for complete write (fixes win32)
cmake: check for ZLIB_INCLUDE_DIR, since we can have only library without headers
autotools/win32: fix searching ssl library
appveyor/autotools: link with openssl by passing LDFLAGS/CFLAGS
appveyor: image already had openssl installed
cmake/win32: do not compile regress_thread on -DEVENT__DISABLE_THREAD_SUPPORT=ON
cmake/win32: do not compile evthread_win32 on -DEVENT__DISABLE_THREAD_SUPPORT=ON
appveyor: check -DUNICODE -D_UNICODE according to ReleaseChecklist (cmake only)
cmake: fix -DEVENT__ENABLE_VERBOSE_DEBUG (typo on -DUSE_DEBUG)
test: fix building with --disable-thread-support under win32
cmake: do not use stderr for notifications/version-info
autoconf: fix --disable-thread-support build under win32
appveyor: ignore failure of mingw-get
appveyor: drop shallow_clone, since we use tags for detecting version in cmake
appveyor: support cmake & autotools using build matrix (like travis-ci has)
Fixes: #364
This will allow us to avoid possible compilation regressions, and also some
failures in different environments (for example because of different
sizeof(size_t)).
For example we can avoid next issues:
- #361
- #314
- #311
(And I'm pretty sure that this is not complete list)
And of course it reduce job for maintainers.
But it also have one downside, appveyor doesn't have such concurrency like
travis-ci, so it can take a while to finish the whole build, but we can resolve
this later, or reduce build matrix to only one for autotools and one for cmake.
Fixes: #364