Replace evws_send with evws_send_text, and introduce new API -
evws_send_binary, that can be used to send binary frames.
But note, that this commit breaks the ABI compatibility, but it should be OK,
since there was only alpha release with evws_send, and nobody should rely on
this, and I hope nobody does (we decided to go this way to avoid supporting
deprecated API).
Previous settings caused install outside CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
to use install_name "lib/" in place of the expected (and useful) "@rpath/".
Handle cases where ${CMAKE_INSTALL_LIBDIR} is not ${CMAKE_INSTALL_PREFIX}/lib .
Also, preserve user provided ${CMAKE_INSTALL_RPATH} .
fixup for 41a7393f3ecd1e9f58331df4653dac2e6739304e
_WIN32_WINNT and WIN32_LEAN_AND_MEAN need to be defined
before the windows.h is included for the first time.
Avoid the confusion of indirect #include by defining
before any.
Now, it 20min for sequential runs is not enough already, I've tested it
on t3.medium manually and got the same:
Total Test time (real) = 1275.03 sec
And also if I run tests in parallel then I had few failures:
bufferevent/bufferevent_connect_fail:
FAIL /root/libevent/test/regress_bufferevent.c:865: didn't fail? what 128
FAIL /root/libevent/test/regress_bufferevent.c:906: assert(test_ok == 1): 0 vs 1
FAIL /root/libevent/test/regress_bufferevent.c:839: assert(n_events_invoked == 1): 2 vs 1bufferevent/bufferevent_connect_fail_eventcb_defer:
FAIL /root/libevent/test/regress_bufferevent.c:839: assert(n_events_invoked == 1): 2 vs 1bufferevent/bufferevent_connect_fail_eventcb: 3/386 TESTS FAILED. (45 skipped)
v2: Increase timeout more (for netbsd)
signalfd may behave differently to sigaction/signal, so to avoid
breaking libevent users (like [1], [2]) disable it by default.
[1]: https://github.com/tmux/tmux/pull/3621
[2]: https://github.com/tmux/tmux/pull/3626
Also signalfd is not that perfect:
- you need to SIG_BLOCK the signal before
- blocked signals are not reset on exec
- blocked signals are allowed to coalesce - so in case of multiple
signals sent you may get the signal only once (ok for most of the
signals, but may be a problem for SIGCHLD, though you may call
waitpid() in a loop or use pidfd)
- and also one implementation problem -
sigprocmask is unspecified in a multithreaded process
Refs:
- https://lwn.net/Articles/415684/
- https://ldpreload.com/blog/signalfd-is-useless
Refs: https://github.com/libevent/libevent/issues/1460
Refs: #1342 (cc @dmantipov)
I faced with strange problem: event loop doesn't exit after dns resolving with
`EVDNS_BASE_DISABLE_WHEN_INACTIVE`.
Stand:
- Ubuntu 22;
- libevent release-2.1.12-stable
- `resolve.conf` contains 2 nameservers;
- I use `evdns_base_new` with `EVDNS_BASE_DISABLE_WHEN_INACTIVE | EVDNS_BASE_INITIALIZE_NAMESERVERS` to avoid OS specific code.
After small investigation, look like events related with dns sockets added to
event_base before `evdns->disable_when_inactive` was initialized. `libevent`
did epoll_ctl(DEL) after resolving completed on the first socket, but the
second socket remained in the `epoll` interest list.
The benefit of this optimization is questionable for the following
reasons:
- libevent uses CLOCK_MONOTONIC_COARSE which is fast enough (on my
desktop CLOCK_MONOTONIC/CLOCK_MONOTONIC_RAW works 40/50 millions of
ops per second, and CLOCK_MONOTONIC_COARSE is faster)
- libevent has caching of time (EVENT_BASE_FLAG_NO_CACHE_TIME)
So I don't see any reason for using one more caching - lazy comparsion
(whatever you call it).
This replaces malloc and free in wepoll.c with mm_malloc and mm_free. I'm using event-internal.h instead of mm-internal.h. Using only mm-internal.h in wepoll.c can cause errors regarding the export symbol macros.
Both cmake and autoconf are capable of automatically detecting the presence of OpenSSL and MbedTLS. However, the present build time logic doesn't do this.
With cmake, my starting point is to preserve the reversed logic of `EVENT__DISABLE_OPENSSL` and `EVENT__DISABLE_MBEDTLS`, adding a third option `AUTO` as the new default. I'm following the pattern of this [post on the cmake list](https://cmake.org/pipermail/cmake/2016-October/064342.html). `OFF` and `ON` should continue with their present behaviors.
With autoconf, I've tried to implement what I understand to be conventional behavior. eg. `--enable-openssl` and `--disable-openssl` should continue to have the same effect. The default if neither is passed is equivalent to the new `--enable-openssl=auto`.
I've also added another commit removing what I think is an unnecessary `break` in `m4/libevent_mbedtls.m4`, which I suspect is leftover from some copy+paste from `m4/libevent_openssl.m4`. Surprisingly to me, a `break` outside of any loop does not seem to be treated as an error.
I've created the SECURITY.md file following a GitHub's template and considering the report vulnerability through security advisory, which is a handy new GitHub feature (but it's still in beta and has to be enabled).
Closes#1461
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
* changelog-improvements:
Generate changelog in a reverse order
Add PR number into the changelog
Use authors of the real patches instead of merge commits
Cleanup changelog.py
After rebasing I broke the initial intention of this patch, so it simply
should be reverted.
This reverts commit 81c6b8823c1b58d7837e827bb1098aa5f9e5956b.
* ssl-read-pull:
ssl: add some comments for lack of notify_close
Drop unused le_ssl_ops::err_is_ok
More SSL_read() to fill big buffer
Make bufferevent_set_max_single_read() effect