mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Merge branch 'release-2.2-pull' - 2.2.1-alpha (#1380)
* release-2.2-pull: Bump version to 2.2.1 Update ChangeLog and whatsnew for 2.2.1 Update contributors (for 2.2 release)
This commit is contained in:
commit
fe9dc8f614
@ -89,7 +89,7 @@ set(EVENT_ABI_LIBVERSION_AGE 0)
|
||||
# equals to RELEASE in Makefile.am
|
||||
set(EVENT_PACKAGE_RELEASE 2.2)
|
||||
|
||||
set(EVENT_NUMERIC_VERSION 0x02020001)
|
||||
set(EVENT_NUMERIC_VERSION 0x02020100)
|
||||
|
||||
# only a subset of names can be used, defaults to "beta"
|
||||
set(EVENT_STAGE_NAME ${EVENT_VERSION_STAGE})
|
||||
|
151
CONTRIBUTORS.md
151
CONTRIBUTORS.md
@ -203,3 +203,154 @@ _If we have forgotten your name, please contact us_
|
||||
* Philip Prindeville
|
||||
* Vis Virial
|
||||
* Sayan Nandan
|
||||
* Aapeli
|
||||
* Aleksandr-Melnikov
|
||||
* Alex Budovski
|
||||
* Andreas Gustafsson
|
||||
* Andre Pereira Azevedo Pinto
|
||||
* Andrey Okoshkin
|
||||
* an-tao
|
||||
* ayuseleznev
|
||||
* baixiangcpp
|
||||
* Berbe
|
||||
* Bernard Spil
|
||||
* Biswapriyo Nath
|
||||
* Bogdan Harjoc
|
||||
* Boris.Dergachov
|
||||
* Borys Smejda
|
||||
* Carlo Marcelo Arenas Belón
|
||||
* chenguolong
|
||||
* Christopher Chavez
|
||||
* chux0519
|
||||
* Cristian Morales Vega
|
||||
* cui fliter
|
||||
* Dan Rosen
|
||||
* David Benjamin
|
||||
* David Disseldorp
|
||||
* Dimo Markov
|
||||
* Dmitry Alimov
|
||||
* Dmitry Antipov
|
||||
* Dmitry Ilyin
|
||||
* Dominic Chen
|
||||
* dota17
|
||||
* dpayne
|
||||
* ejurgensen
|
||||
* Emil Engler
|
||||
* Enji Cooper
|
||||
* Fabrice Fontaine
|
||||
* fanquake
|
||||
* Fredrik Strupe
|
||||
* Gerry Garvey
|
||||
* Gonçalo Ribeiro
|
||||
* guoxiang1996
|
||||
* Haowei Hsu
|
||||
* Igor Klemenski
|
||||
* ihsinme
|
||||
* Isidor Kouvelas
|
||||
* iysheng
|
||||
* JackBoosY
|
||||
* jackerli(李剑)
|
||||
* James Synge
|
||||
* Jan Beich
|
||||
* Jan Kasiak
|
||||
* Jay Freeman (saurik)
|
||||
* jeremyerb
|
||||
* Jesse Fang
|
||||
* Jessica Clarke
|
||||
* Jiri Luznicky
|
||||
* John Fremlin
|
||||
* José Luis Millán
|
||||
* Joseph Coffland
|
||||
* Kamil Rytarowski
|
||||
* Keelan Cannoo
|
||||
* Keith Smiley
|
||||
* kenping
|
||||
* Kiyoshi Aman
|
||||
* Leon George
|
||||
* Leon M. George
|
||||
* Leo Zhang
|
||||
* lightningkay
|
||||
* lilei
|
||||
* linxiaohui
|
||||
* Loïc Yhuel
|
||||
* Luke Dashjr
|
||||
* Marcin Szewczyk
|
||||
* Marek Sebera
|
||||
* mareksm
|
||||
* Mario Emmenlauer
|
||||
* Maximilian Brunner
|
||||
* Maya Rashish
|
||||
* Michael Davidsaver
|
||||
* Michael Madsen
|
||||
* Mike Sharov
|
||||
* MKCKR
|
||||
* mkm
|
||||
* mohuang
|
||||
* moonlightsh
|
||||
* Murat Demirten
|
||||
* Nathan French
|
||||
* neil
|
||||
* Nick Grifka
|
||||
* Nicolas J. Bouliane
|
||||
* Nikita Gorskikh
|
||||
* Nikolay Edigaryev
|
||||
* nntrab
|
||||
* OgreTransporter
|
||||
* okhowang(王沛文)
|
||||
* Paul Osborne
|
||||
* Paweł Wegner
|
||||
* Peter Edwards
|
||||
* Philip Herron
|
||||
* Philip Homburg
|
||||
* Pierce Lopez
|
||||
* Redfoxmoon
|
||||
* Ryan Pavlik
|
||||
* Sean Young
|
||||
* seleznevae
|
||||
* Seong-Joong Kim
|
||||
* Sergey Fionov
|
||||
* Sergey Matveychuk
|
||||
* Srivatsan Iyer
|
||||
* stenn
|
||||
* SuckShit
|
||||
* Syedh30
|
||||
* The Gitter Badger
|
||||
* Theo Buehler
|
||||
* Thomas Perrot
|
||||
* tim-le
|
||||
* Tobias Heider
|
||||
* Tobias Stoeckmann
|
||||
* Tomas Gonzalez
|
||||
* Vincent JARDIN
|
||||
* Wataru Ashihara
|
||||
* wenyg
|
||||
* William A Rowe Jr
|
||||
* William Marlow
|
||||
* Xiang Zhang
|
||||
* Xiaozhou Liu
|
||||
* yangyongsheng
|
||||
* Yi Fan Yu
|
||||
* yongqing.jiao
|
||||
* Yongsheng Xu
|
||||
* Yong Wu
|
||||
* yuangongji
|
||||
* Yury Korzhetsky
|
||||
* zhenhaonong
|
||||
* zhongzedu
|
||||
* zhuizhuhaomeng
|
||||
* Cœur
|
||||
* Daniel Kempenich
|
||||
* DavidKorczynski
|
||||
* Diogo Teles Sant'Anna
|
||||
* Edoardo Lolletti
|
||||
* Jonathan Ringer
|
||||
* liaotonglang
|
||||
* Liao Tonglang
|
||||
* lilinjie
|
||||
* mdavidsaver
|
||||
* Michael Ford
|
||||
* Tobias Mayer
|
||||
* Zhipeng Xue
|
||||
* Ingo Bauersachs
|
||||
* Jeremy W. Murphy
|
||||
* Thuan Tran
|
||||
|
321
ChangeLog
321
ChangeLog
@ -1,3 +1,320 @@
|
||||
Changes in version 2.2.1-alpha (FIXME)
|
||||
Changes in version 2.2.1-alpha (21 May 2023)
|
||||
|
||||
Libevent 2.2.1-alpha.
|
||||
Libevent 2.2.1-alpha includes a number of new features and performance
|
||||
improvements.
|
||||
|
||||
The log below tries to organize them by rough area of effect.
|
||||
|
||||
This release contains around 1000 patches (without merges) with 151 new
|
||||
contributors!
|
||||
|
||||
This changelog omits some commits which were pure bugfixes on other commits
|
||||
listed below. typos, some minor CI changes and similar things.
|
||||
|
||||
Some keywords highlights of this major release:
|
||||
- wepoll backend (by Nick Grifka)
|
||||
- signalfd backend (by Dmitry Antipov)
|
||||
- DNS over TCP for evdns (by ayuseleznev)
|
||||
- websockets layer (by Dmitry Ilyin)
|
||||
- "prepare" and "check" watchers (by Dan Rosen)
|
||||
- MbedTLS support (okhowang)
|
||||
- unix domain sockets for HTTP
|
||||
- cmake over autotools/automake
|
||||
- extensive CI
|
||||
|
||||
For more detail, see the git changelogs. For more insight, see the
|
||||
"whatsnew-2.2.txt" document included in the Libevent 2.2.1-alpha
|
||||
distribution.
|
||||
|
||||
SSL layer gains MbedTLS support, and had been tested with LibreSSL too. And
|
||||
of course with OpenSSL 1.1/3.0.
|
||||
|
||||
From now on, the autotools is considered as deprecated, and you should use
|
||||
cmake instead.
|
||||
|
||||
And now we are using github actions for CI, previously we had travis-ci for
|
||||
linux/macos and appveyor for win32 (removed in #951), and also I used testing
|
||||
vagrant for some time, but it had been moved into a separate repository
|
||||
(8c1838be). But actually this is not required anymore since github actions
|
||||
supports:
|
||||
- linux
|
||||
- freebsd
|
||||
- windows
|
||||
- osx
|
||||
- openbsd
|
||||
- and also tests under Thread/Address/Undefind sanitizers
|
||||
|
||||
Now documentation is automatically deployed to https://libevent.org/doc/
|
||||
|
||||
CI:
|
||||
o Merge branch 'github-actions-v2' (#951) (0b6f29ac yuangongji, Azat Khuzhin)
|
||||
o ci: add CIFuzz Github action (#1382) (d8ecb88f DavidKorczynski)
|
||||
o Add CI checks for OpenBSD (#1326) (45c66e48 neil)
|
||||
o ci/linux: add dist check (512c88ce Azat Khuzhin)
|
||||
o Add API/ABI checker (using LVC) (735c891e, 448a478a, 889ad6d6, 15917b42, 1cea01d6 yuangongji, Azat Khuzhin)
|
||||
o Merge branch 'tests-under-sanitizers' (d5aa783b Azat Khuzhin)
|
||||
o Rework CI to keep everything in one workflow (by using reusable workflow) (587f26fb Azat Khuzhin)
|
||||
|
||||
Samples:
|
||||
o sample/https-client: use host SSL certificate store by default (e139cbac David Disseldorp)
|
||||
o Improvements for internal http-server (9a4b8ec1 Azat Khuzhin)
|
||||
o sample: add https-client-mbedtls (#1098) (b45a02ef okhowang(王沛文))
|
||||
o http-server: add cli argument for max body size (852af060 Azat Khuzhin)
|
||||
o New utility becat (analog of ncat but uses bufferevents, useful for testing) (d5b24cc0 Azat Khuzhin)
|
||||
o https-client: add -4/-6 switches (67180f8c Azat Khuzhin)
|
||||
|
||||
SSL:
|
||||
o Mbed-TLS support (#1028) (0e339b04 Jesse Fang, okhowang(王沛文), Azat Khuzhin)
|
||||
o Introduce new BUFFEREVENT_SSL_BATCH_WRITE flag to avoid Nagle effect in SSL (a490172d Azat Khuzhin)
|
||||
o Do not try to do SSL handshake if the connect() fails (59e31c96 Azat Khuzhin)
|
||||
o Support disabled renegotiation in mbedTLS (f02fa339 Azat Khuzhin)
|
||||
o Merge branch 'mbedtls-3' (#1299) (20977eae William Marlow, Azat Khuzhin)
|
||||
o Initial OpenSSL 3.0 support (#1288) (69e9f7ee William Marlow, Azat Khuzhin)
|
||||
o More SSL_read() to fill big buffer (ef51444f Thuan Tran)
|
||||
o Make bufferevent_set_max_single_read() effect (4ab3242d Thuan Tran)
|
||||
|
||||
SSL bugfixes:
|
||||
o Explicitly call SSL_clear when reseting the fd. (#498) (c6c74ce2 David Benjamin)
|
||||
o fix handling of close_notify (ssl) in http with openssl bufferevents (da3f2ba2 Azat Khuzhin)
|
||||
o be_openssl: avoid leaking of SSL structure (acf09c00 Azat Khuzhin)
|
||||
o Fix ssl/bufferevent_wm_filter when bev does not reach watermark on break (9d93fbe7 Azat Khuzhin)
|
||||
o Don't loose top error in SSL (a30d6d85 Yury Korzhetsky)
|
||||
o Use heap-bases contexts for MbedTLS handles (#1355) (285fc7cc Dmitry Ilyin)
|
||||
o Deal with partial writes on SSL write (fc568ff0 zhenhaonong)
|
||||
o Avoid EOF in rare (or not that rare) cases - #1451 (e8cbe7b6 Azat Khuzhin)
|
||||
|
||||
HTTP (evhttp):
|
||||
o http: add callback to allow server to decline (and thereby close) incoming connections. (727bcea1 John Fremlin)
|
||||
o Add evhttp_parse_query_str_flags() (26ef859a Azat Khuzhin)
|
||||
o http: implement separate timeouts for read/write/connect phase (5ee507c8 Azat Khuzhin)
|
||||
o http: add WebDAV methods support (#789) (68eb526d Alexander Drozdov)
|
||||
o Added http method extending (c80f6be1 Thomas Bernard)
|
||||
o Make http-connect workth with pproxy (462f2e97 Azat Khuzhin)
|
||||
o Add callback support for error pages (02905413 nntrab)
|
||||
o Added evhttp max simultaneous connection limiting (#592) (7426a568 Joseph Coffland, Azat Khuzhin)
|
||||
o http: add EVHTTP_URI_HOST_STRIP_BRACKETS (67180f8c Azat Khuzhin)
|
||||
o http: eliminate redundant bev fd manipulating and caching (afa66ea4 Azat Khuzhin)
|
||||
o http: support unix domain sockets (f446229b Sean Young)
|
||||
o Add more HTTP_ response codes (05a03d4a Dmitry Ilyin)
|
||||
o evhttp_bound_set_bevcb() (77a9b60e Leon M. George, Azat Khuzhin)
|
||||
o Add minimal WebSocket server implementation for evhttp (#1322) (e8313084 Dmitry Ilyin)
|
||||
|
||||
HTTP bugfixes (evhttp):
|
||||
o Fix crashing http server when callback do not reply in place (5ff8eb26 Azat Khuzhin)
|
||||
o Do not crash when evhttp_send_reply_start() is called after a timeout. (99d0a952 Andreas Gustafsson)
|
||||
o Allow bodies for GET/DELETE/OPTIONS/CONNECT (db483e3b Azat Khuzhin)
|
||||
o Fix crashing http server when callback do not reply in place from *gencb* (306747e5 Azat Khuzhin)
|
||||
o CONNECT method only takes an authority (65eb529a Greg Hazel)
|
||||
o http: fix leaks in evhttp_uriencode() (61c21492 Azat Khuzhin)
|
||||
o Fix evhttp_connection_get_addr() fox incomming http connections (367cd9e5 Greg Hazel, e4edc7fc Azat Khuzhin)
|
||||
o Improve request line parsing (0ec12bc8 Azat Khuzhin)
|
||||
o Fix conceivable UAF of the bufferevent in evhttp_connection_free() (5dc88b38 Azat Khuzhin)
|
||||
o http: fix connection retries when there more then one request for connection (f3f7aa5a Azat Khuzhin)
|
||||
o http: Preserve socket error from listen across closesocket cleanup (28d7221b Luke Dashjr)
|
||||
o http: try to read existing data in buffer under EVHTTP_CON_READ_ON_WRITE_ERROR (7bfe9388 Azat Khuzhin)
|
||||
o http: avoid use of uninitialized value for AF_UNIX/AF_LOCAL sockaddr (76eded24 Azat Khuzhin)
|
||||
o http: make sure the other fields in ext_method are not changed by the callback (1c78451f yuangongji)
|
||||
o http: fix EVHTTP_CON_AUTOFREE in case of connection error (083c6d54 Azat Khuzhin)
|
||||
o http: fix EVHTTP_CON_AUTOFREE in case of timeout (and some else) (eee26dee Azat Khuzhin)
|
||||
o Check error code of evhttp_add_header_internal() in evhttp_parse_query_impl() (4528d8e9 Azat Khuzhin)
|
||||
o http: fix undefined-shift in EVUTIL_IS*_ helpers (37dbb350 Azat Khuzhin)
|
||||
o http: fix invalid unsigned arithmetic (#1134) (d13b7bbf ihsinme)
|
||||
o Fix the value is never actually read from 'argument' in evhttp_parse_query_impl() (#1424) (3bcc92cf Cœur)
|
||||
|
||||
DNS (evdns):
|
||||
o evdns: handle NULL filename explicitly (3e6553a1 Bogdan Harjoc)
|
||||
o Added DNS header mask definitions. (fb134939 Nathan French)
|
||||
o evdns: add DNS_OPTION_NAMESERVERS_NO_DEFAULT/EVDNS_BASE_NAMESERVERS_NO_DEFAULT (e5b8f4c1 Azat Khuzhin)
|
||||
o evdns: add new options -- so-rcvbuf/so-sndbuf (538141eb Azat Khuzhin)
|
||||
o evdns: Add additional validation for values of dns options (#1018) (8fe35c76 ayuseleznev)
|
||||
o DNS over TCP (#1004) (028842aa ayuseleznev, Azat Khuzhin)
|
||||
o evdns: Add support for setting maximum UDP DNS message size. (#1032) (83c58d49 seleznevae)
|
||||
o evdns: add max-probe-timeout/probe-backoff-factor settings (#1128) (617ba838 chux0519)
|
||||
o evdns: add ability to get CNAME (#1154) (19b3fd0b Sergey Matveychuk)
|
||||
o feat: add `evdns_base_get_nameserver_fd` method (#1238) (cd6a41ec Yongsheng Xu)
|
||||
o evdns: integrate deferred_response_callback into evdns_request (#1367) (8800b17a mkm)
|
||||
o Allow evdns_base_new to succeed with no nameservers configured (#1389) (3d138bda Daniel Kempenich)
|
||||
|
||||
DNS bugfixes (evdns):
|
||||
o evdns: fix race condition in evdns_getaddrinfo() (ee12c516 Sergey Fionov, Sergey Fionov)
|
||||
o evdns: fix lock/unlock mismatch in evdns_close_server_port() (8701d0d3 zhuizhuhaomeng)
|
||||
o Fix checking return value of the evdns_base_resolv_conf_parse() (c3f35345 Azat Khuzhin)
|
||||
o evdns: fix a crash when evdns_base with waiting requests is freed (#962) (4da9f87c ayuseleznev)
|
||||
o recreate socket when udp failed (#1031) (efbe563b okhowang(王沛文))
|
||||
o evdns: do not pass NULL to memcpy() in evdns_server_request_format_response() (c424594b Azat Khuzhin)
|
||||
o evdns: fix "Branch condition evaluates to a garbage value" in reply_parse (#1423) (e96e98ae Cœur)
|
||||
|
||||
RPC (evrpc):
|
||||
o evrpc: avoid NULL dereference on request is not EVHTTP_REQ_POST (8483c535 Azat Khuzhin)
|
||||
|
||||
Core (events, buffers, utils, threads):
|
||||
o Return from event_del() after the last event callback termination (0b4b0efd José Luis Millán, 5ff83989 Azat Khuzhin)
|
||||
o Add convenience macros for user-triggered events (d2acf67e Philip Prindeville)
|
||||
o Filter link-local IPv4 addresses in evutil_found_ifaddr() (b2667b76 Azat Khuzhin)
|
||||
o assert that fds are nonblocking in debug mode (9d3a415a, 6f988ee1 Greg Hazel, Azat Khuzhin)
|
||||
o buffer: make evbuffer_prepend() of zero-length array no-op (c4fbae3a Azat Khuzhin)
|
||||
o Add support for EV_TIMEOUT to event_base_active_by_fd (62df1301 John Ohl)
|
||||
o Maximum evbuffer read configuration (8c2001e9 Azat Khuzhin)
|
||||
o evwatch: Add "prepare" and "check" watchers. (#793) (2f184f8b, 1cd8830d Dan Rosen)
|
||||
o evutil: implement socketpair with unix domain socket on Win10 (#913) (dda8968c, 1ba94bdf yuangongji)
|
||||
o Add support for priority inheritance (#934) (f76456b0 Andre Pereira Azevedo Pinto, 972289f3 Azat Khuzhin)
|
||||
o evutil_time: Implements usleep() using wait funtion on Windows (#939) (6412f34f yuangongji)
|
||||
o Add EVENT_BASE_FLAG_EPOLL_DISALLOW_TIMERFD flag (fixes: #958) (9a9b92ed Azat Khuzhin)
|
||||
o evutil_time: improve evutil_gettimeofday on Windows (#1003) (f0b3160f Nick Grifka)
|
||||
o Support EV_CLOSED on linux for poll(2) (4c13afae Azat Khuzhin)
|
||||
o Add wepoll support to light up the epoll backend on Windows (#1006) (83ef3216 Nick Grifka, 45c3fc29 fanquake)
|
||||
o Convert from WinCrypt to Windows BCrypt (eb7bed03 Gerry Garvey)
|
||||
o Merge #1176 - make evthread_use_pthreads() a MT-Safe function (3d48c756 moonlightsh)
|
||||
o buffer: do not round up allocation for reference-type chain objects (#1203) (b926af26 Pierce Lopez)
|
||||
o Add check of mmap64 function and use it when available rather that mmap (#1320) (99fd68ab Dmitry Ilyin)
|
||||
o Make rekey interval less predictable (#1331) (bb41229f Keelan Cannoo)
|
||||
o epoll: use epoll_pwait2() if available (117ee9a0 Dmitry Antipov)
|
||||
o signal: new signal handling backend based on signalfd (#1342) (1af745d0 Dmitry Antipov)
|
||||
o Exclude arc4random_buf implementation if it's already present in the platform (#1375) (7a18af8c Srivatsan Iyer)
|
||||
o buffer: use pread() for evbuffer_file_segment_materialize() (#1392) (0b79a002 Dmitry Antipov)
|
||||
|
||||
Core bugfixes (events, buffers, utils):
|
||||
o Fix wrong assert in evbuffer_drain() (b26996a0 Azat Khuzhin)
|
||||
o Fix race in access to ev_res from event loop with event_active() (27934f0b James Synge)
|
||||
o If precise_time is false, we should not set EVENT_BASE_FLAG_PRECISE_TIMER (6cce7458 yongqing.jiao)
|
||||
o buffer: fix incorrect unlock of the buffer mutex (for deferred callbacks) (93913da1 Azat Khuzhin)
|
||||
o Fix base unlocking in event_del() if event_base_set() runned in another thread (08a0d366 Azat Khuzhin)
|
||||
o Fix assert() condition in evbuffer_drain() for IOCP (ab3224c3 SuckShit)
|
||||
o Notify event base if there are no more events, so it can exit without delay (23c2914f Azat Khuzhin)
|
||||
o Do not loose ET flag in case of multiple events for the same fd added (33053cdd Isidor Kouvelas, Azat Khuzhin)
|
||||
o IOCP fixes (to make it possible to work with HTTP layer) (3d815cf2 Azat Khuzhin)
|
||||
o Add error-handling routine for arc4_seed() #769 (8d5b14d4 Seong-Joong Kim)
|
||||
o buffer: fix evbuffer_remove_buffer() with empty chain in front (fdfabbec Azat Khuzhin)
|
||||
o buffer: do not rely on ->off in advance_last_with_data() (5b19c9f6 Azat Khuzhin)
|
||||
o Protect min_heap_push_ against integer overflow. (176fd566 Tobias Stoeckmann)
|
||||
o Prevent endless loop in evmap_make_space (#804) (c6becb26 Tobias Stoeckmann)
|
||||
o Prevent integer overflow in kq_build_changes_list. (#811) (cf8acae3 Tobias Stoeckmann)
|
||||
o kqueue: Avoid undefined behaviour. (2707a4ff Tobias Stoeckmann)
|
||||
o evbuffer: fix last_with_datap after prepend with empty chain (401bd1c0 Azat Khuzhin)
|
||||
o evutil: set the have_checked_interfaces in evutil_check_interfaces() (0de2b145 jeremyerb)
|
||||
o buffer: fix possible NULL dereference in evbuffer_setcb() on ENOMEM (#856) (bdcade47 Azat Khuzhin)
|
||||
o Fix memory corruption in EV_CLOSURE_EVENT_FINALIZE with debug enabled (#885) (445027a5 Jan Kasiak)
|
||||
o arc4random: replace sysctl() with getrandom (on linux) (86f55b04, 194a5d82 Azat Khuzhin)
|
||||
o evutil_time: detect and use _gmtime64_s()/_gmtime64() (#898) (148d12ad yuangongji)
|
||||
o evbuffer_add_file: fix freeing of segment in the error path (4727150a Azat Khuzhin)
|
||||
o Parse IPv6 scope IDs. (#923) (9fecb59a Philip Homburg)
|
||||
o event_base_once: fix potential null pointer threat (#956) (968bbd5c chenguolong)
|
||||
o increase segment refcnt only if evbuffer_add_file_segment() succeeds (#964) (114b3836 yuangongji)
|
||||
o Avoid triggering wrong events with EV_ET set (9543f31a Azat Khuzhin)
|
||||
o epoll: handle EV_ET for EV_CLOSED too (e703c034 Azat Khuzhin)
|
||||
o Fix EV_CLOSED detection/reporting (epoll only) (972b456b Azat Khuzhin)
|
||||
o There is typo in GetAdaptersAddresses windows library. It should be iphlpapi.dll (#1012) (61fc2bf2 Aleksandr-Melnikov)
|
||||
o buffer: do not pass NULL to memcpy() from evbuffer_pullup() (a0c642ac Azat Khuzhin)
|
||||
o Fix leaks of signal handlers for select/poll backends (f6bfa8b3 Azat Khuzhin)
|
||||
o Handle return value from getrandom() (#1070) (efa57159 Gerry Garvey)
|
||||
o Retry write on EINTR in signal handler (#1158) (4f8a6144 Mike Sharov)
|
||||
o Properly initialize sockaddr length on systems with sin_len. (#1177) (5c0e75c3 Tobias Heider)
|
||||
o buffer: fix CreateFileMapping() leak from evbuffer_add_file() (6f139b87 Azat Khuzhin)
|
||||
o evutil: Fix evutil_freeaddrinfo (#1223) (9a38bc5f Tomas Gonzalez)
|
||||
o Fix socketpair failure when temporary directory has non-latin character (f8bb9d84 zhenhaonong)
|
||||
o fix: arc4_getword integer overflow, detected by -fsanitize=undefined (b5b4c7fe jackerli(李剑))
|
||||
o fixed missing check for null after strdup in evutil_inet_pton_scope (#1366) (ff99f67a Michael Madsen)
|
||||
o Optimize arc4random_uniform() (by syncing with OpenBSD implementation) (#1422) (557990ca Cœur)
|
||||
o Always have evutil_secure_rng_add_bytes available (#1427) (4e6375e8 Kurt Roeckx)
|
||||
|
||||
Bufferevent:
|
||||
o Adjust evbuffer max read for bufferevents (5357c3d6 Azat Khuzhin)
|
||||
o Implement bufferevent_socket_connect_hostname_hints() (5e137f37 Joseph Spadavecchia)
|
||||
o bufferevent: allow setting priority on socket and openssl type (#1011) (bdc5200a Nicolas J. Bouliane)
|
||||
|
||||
Bufferevent bugfixes:
|
||||
o Remove check against passed bufferevent in bufferevent_socket_connect() (a10a6f4e Ivan Maidanski, Azat Khuzhin)
|
||||
o Call underlying bev ctrl GET_FD on filtered bufferevents (40550814 Greg Hazel)
|
||||
o Fix timeout resets for filters (4ba48739 Greg Hazel)
|
||||
o bufferevent_socket_connect{,_hostname}() missing event callback and use ret code (f7bc1337 Jesse Fang)
|
||||
o Fix hangs due to watermarks overruns in bufferevents implementations (878bb2d3 Azat Khuzhin)
|
||||
o Simplify bufferevent timeout tests to reduce CPU usage in between start/compare (6ac8e775 Azat Khuzhin)
|
||||
o Fix leaks in error path of the bufferevent_init_common_() (6995b9a8 Azat Khuzhin)
|
||||
o Check return value of evbuffer_remove() in bufferevent_read() (#1133) (bc25889f lilei)
|
||||
|
||||
Listeners:
|
||||
o Immediately stop trying to accept more connections if listener disabled (416b48ba John Fremlin, Azat Khuzhin)
|
||||
o listener: ipv6only socket bind support (387d91f9 Murat Demirten)
|
||||
o listener: Preserve last error in evconnlistener_new_bind() before close (#1269) (d96457e1 kenping)
|
||||
o Add LEV_OPT_BIND_IPV4_AND_IPV6 flag (#1400) (f9134df7 Edoardo Lolletti)
|
||||
|
||||
Listeners bugfixes:
|
||||
o Fix evconnlistener_free() closes already established connections (bc65ffc1 Azat Khuzhin)
|
||||
o Fix deadlock in case of evconnlistener_disable() in parallel with callback (#1226) (12cedc8a moonlightsh)
|
||||
|
||||
Docs:
|
||||
o Move list of contributors into separate file (56c9551e Sayan Nandan)
|
||||
o doc: cmake command on Windows (b002f04f yuangongji (A))
|
||||
o Deploy documentation to https://libevent.org/doc/ (05467445 Azat Khuzhin)
|
||||
o Doxygen documentation improvements (620a3fa1, 1d1c1909, f9c6a14e yuangongji)
|
||||
o Add vcpkg installation instructions (#953) (ec775a96 JackBoosY)
|
||||
o Remove man pages from repo (they can be generated via doxygen) (31a5cfd3 Azat Khuzhin)
|
||||
o Various documentation improvements (#842) (cdeb3242 yuangongji)
|
||||
o Merge pull request #1441 from fanquake/autoconf_doc_updates (612a74c7 fanquake)
|
||||
|
||||
Tests:
|
||||
o test: fix 32bit linux regress (#554) (63c4bf78 Carlo Marcelo Arenas Belón)
|
||||
o test: avoid regress hanging in macOS (#757) (a86f89d3 Carlo Marcelo Arenas Belón)
|
||||
o Avoid possible SEGVs in select() (in unit tests) (33baa4e5 Philip Prindeville)
|
||||
o Intorduce TT_RETRIABLE (4d2f013b Azat Khuzhin)
|
||||
o test-ratelim: calculate timers bias (for slow CPUs) to avoid false-positive (8a348699 Azat Khuzhin)
|
||||
o Merge branch 'osx-clock' (a6f81aa4 Azat Khuzhin)
|
||||
o Fix some OpenSSL 3 test issues (#1291) (29032da6 Peter Edwards)
|
||||
|
||||
Fixes for various OS:
|
||||
o Enable kqueue for APPLE targets (#849) (0d7d85c2 Keith Smiley)
|
||||
o Enable _GNU_SOURCE for Android (#850) (41c95abb Keith Smiley)
|
||||
o Fix compat with NetBSD >= 10 (#909) (72e6eff0 Kamil Rytarowski)
|
||||
o RTEMS has no SA_RESTART (#1172) (73ca1801 Michael Davidsaver)
|
||||
|
||||
Build fixes:
|
||||
o Include openssl-compat.h into dist archive (7bc822ca Azat Khuzhin)
|
||||
o Unbreak build with LibreSSL after openssl 1.1 support added (d057c45e Jan Beich)
|
||||
o Fix RPATH for APPLE (cc0e04d7 Trond Norbye)
|
||||
o Fixes for ERR_remove_*state() (98faf198 Pierce Lopez)
|
||||
o Various cmake fixes (65870949 Shuo Chen)
|
||||
o cmake: autotools compatibility (5aade2d3, 489991a2, 882f537c, 8348b413 Marek Sebera, Azat Khuzhin)
|
||||
o Fixes win32 builds after some previous patches (d84f0205 Azat Khuzhin)
|
||||
o Fix arc4random_addrandom() detecting and fallback (regression) (266f43af Azat Khuzhin)
|
||||
o Add missing print-winsock-errors.c into dist archive (8d89c212 Azat Khuzhin)
|
||||
o Fix visibility issues (mostly on win32) (fb866645, ce3af533, cd285e42 Azat Khuzhin)
|
||||
o Add configure check for midipix (94e5cc84 Redfoxmoon)
|
||||
o autotools: pass $(OPENSSL_INCS) for samples (FTBFS macOS) (0ec5edde Carlo Marcelo Arenas Belón)
|
||||
o autotools: confirm openssl is working before using (506df426 Carlo Marcelo Arenas Belón)
|
||||
o Port `event_rpcgen.py` and `test/check-dumpevents.py` to Python 3. (8b0aa7b3 Kiyoshi Aman)
|
||||
o Fix generation of LibeventConfig.cmake for the installation tree (#576) (6ee73ea9 Andrey Okoshkin)
|
||||
o Provide Makefile variables LIBEVENT_{CFLAGS,CPPFLAGS,LDFLAGS} (1a448088 stenn)
|
||||
o Fix build with LibreSSL 2.7 (28b80754 Bernard Spil)
|
||||
o cmake: ensure windows dll's are installed as well as lib files (0fa43c99 Philip Herron)
|
||||
o Fix out-of-tree builds (a5f19422 Cristian Morales Vega)
|
||||
o config.h can't be prefixed unconditionally (587e9f58 Philip Prindeville)
|
||||
o Define __EXT_POSIX2 for QNX (99a3887d Maya Rashish)
|
||||
o libevent.pc: link against core/extra (731469b3 Mike Frysinger)
|
||||
o Merge branch 'win32-visibility-event_debug_logging_mask_' (fb866645, cd285e42 Azat Khuzhin)
|
||||
o cmake: introduce EVENT__LIBRARY_TYPE option (c9a073ea Azat Khuzhin)
|
||||
o cmake: do not build both (SHARED and STATIC) for MSVC/win32 (90d80ef4 Azat Khuzhin)
|
||||
o cmake: support static runtime (MSVC) (246f4404 Azat Khuzhin)
|
||||
o Eliminate fd conversion warnings and introduce EVUTIL_INVALID_SOCKET (windows) (b29207dc Azat Khuzhin)
|
||||
o Define `_GNU_SOURCE` properly/consistently per autoconf (5f87be42 Enji Cooper)
|
||||
o Fixes for uchex static analyzer (da33f768 Azat Khuzhin)
|
||||
o cmake: add missing autotools targets (doxygen, uninstall, event_rpcgen.py) (7201062f yuangongji)
|
||||
o cmake: set library names to be the same as with autotools (669a53f3 yuangongji)
|
||||
o cmake: install shared library only if it was requested (55d1e20e Azat Khuzhin)
|
||||
o Added uninstall target check to cmakelists (#948) (f0e79baf Dimo Markov)
|
||||
o Build doxygen documentation via cmake (to fill variables) (095c8ae1 Azat Khuzhin)
|
||||
o Merge #929 -- cmake package improvements (8be8ac46 yuangongji)
|
||||
o cmake: do not link libevent with libevent_core (#1123) (657e1806 Loïc Yhuel)
|
||||
o cmake: Fix generted pkgconfig files. (#1165) (1fe8b3d6 Biswapriyo Nath)
|
||||
o cmake: don't override CMAKE_CONFIGURATION_TYPES. (#1166) (087bbc57 Paweł Wegner)
|
||||
o CheckWorkingKqueue.cmake: fix missing headers (#1225) (89505f85 Christopher Chavez)
|
||||
o cmake: Fix Android build. (8f47d8de Ryan Pavlik)
|
||||
o cmake: do influence CMAKE_DEBUG_POSTFIX of the outer project (if any) (650d8619 Azat Khuzhin)
|
||||
o cmake: remove redundant _GNU_SOURCE definition (82af0ea4 Azat Khuzhin)
|
||||
o Various autotools build improvements (#1171) (6d800fd6 fanquake)
|
||||
o Require libevent_core not libevent for pkg-config (#1257) (66861f88 moonlightsh)
|
||||
o -Werror fixes andCI (#1297) (7aeecb60 Azat Khuzhin)
|
||||
o Add postfix for Debug configuration. (dd610b77 Haowei Hsu)
|
||||
o Fix ignoring return value of arc4random() warning (with _FORTIFY_SOURCE defined) (#1394) (c01cb1d6 liaotonglang)
|
||||
o Merge pull request #1418 from fanquake/use_fortify_source_3 (bcefdbc6 fanquake)
|
||||
o Use GNUInstallDirs - #1397 (4dee61c0 Tobias Mayer, Jonathan Ringer, Azat Khuzhin)
|
||||
o Make dependency paths relocatable (#1385) (acfac7ae Ingo Bauersachs)
|
||||
|
@ -70,7 +70,7 @@ VERSION_INFO = 1:0:0
|
||||
# 2.1.8-stable-- 2.1 6:2:0 (ABI changed slightly)
|
||||
#
|
||||
# For Libevent 2.2:
|
||||
# 2.2.0-alpha -- 2.2 1:0:0
|
||||
# 2.2.1-alpha -- 2.2 1:0:0
|
||||
|
||||
# ABI version history for this package effectively restarts every time
|
||||
# we change RELEASE. Version 1.4.x had RELEASE of 1.4.
|
||||
|
@ -6,7 +6,7 @@ dnl
|
||||
dnl Original version Dug Song <dugsong@monkey.org>
|
||||
|
||||
AC_PREREQ([2.67])
|
||||
AC_INIT(libevent,2.2.0-alpha-dev)
|
||||
AC_INIT(libevent,2.2.1-alpha-dev)
|
||||
AC_CONFIG_SRCDIR(event.c)
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
@ -20,7 +20,7 @@ dnl make compilation quiet unless V=1 is used
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
AC_CONFIG_HEADERS(config.h evconfig-private.h:evconfig-private.h.in)
|
||||
AC_DEFINE(NUMERIC_VERSION, 0x02020001, [Numeric representation of the version])
|
||||
AC_DEFINE(NUMERIC_VERSION, 0x02020100, [Numeric representation of the version])
|
||||
|
||||
dnl Try and get a full POSIX environment on obscure systems
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
480
whatsnew-2.2.txt
480
whatsnew-2.2.txt
@ -1,100 +1,420 @@
|
||||
...
|
||||
What's new in Libevent 2.2
|
||||
Azat Khuzhin
|
||||
|
||||
* Building libevent as a sub-project using GNU Auto* tools
|
||||
0. Before we start
|
||||
|
||||
Some projects will choose to include libevent in their source distribution,
|
||||
and build libevent as a sub-project. This may be effected by putting the
|
||||
line:
|
||||
0.1. About this document
|
||||
|
||||
AC_CONFIG_SUBDIRS([path/to/libevent])
|
||||
This document describes the key differences between Libevent 2.1 and
|
||||
Libevent 2.2. It's a work in progress.
|
||||
|
||||
in the master configure.ac file for the master project.
|
||||
For better documentation about libevent, see the links at
|
||||
http://libevent.org/
|
||||
|
||||
There are cases where the master project will want to pass in additional
|
||||
flags for CFLAGS, CPPFLAGS, or LDFLAGS. Since these variables are reserved
|
||||
for the user, and AM_CFLAGS, AM_CPPFLAGS, and AM_LDFLAGS are reserved for
|
||||
each package, libevent offers the following variables for a master package
|
||||
to tell libevent that there are additional compile/link values:
|
||||
Libevent 2.2 would not be possible without the generous help of numerous
|
||||
contributors. For a list of who did what in Libevent 2.2, please see the
|
||||
CONTRIBUTORS.md!
|
||||
|
||||
LIBEVENT_CFLAGS
|
||||
LIBEVENT_CPPFLAGS
|
||||
LIBEVENT_LDFLAGS
|
||||
0.2. Where to get help
|
||||
|
||||
A master package can set these variables in its configure.ac file.
|
||||
Try looking at the other documentation too. All of the header files have
|
||||
documentation in the doxygen format; this gets turned into nice HTML and
|
||||
linked to from the libevent.org website.
|
||||
|
||||
Here's an example:
|
||||
You can ask the questions by creating an issue on github.
|
||||
|
||||
configure.ac:
|
||||
...
|
||||
EXTRA_CFLAGS=...
|
||||
EXTRA_CPPFLAGS=...
|
||||
EXTRA_LDFLAGS=...
|
||||
...
|
||||
dnl ac_configure_args is undocumented but widely abused, as here,
|
||||
dnl to modify the defaults of the libevent subpackage, by prefixing
|
||||
dnl our changes to the child configure arguments already assembled.
|
||||
dnl User-supplied contradictory choices should prevail thanks to
|
||||
dnl "last wins".
|
||||
ac_configure_args=" --disable-openssl${ac_configure_args}"
|
||||
ac_configure_args=" --disable-shared${ac_configure_args}"
|
||||
ac_configure_args=" --disable-libevent-regress${ac_configure_args}"
|
||||
ac_configure_args=" --disable-libevent-install${ac_configure_args}"
|
||||
ac_configure_args=" --enable-silent-rules${ac_configure_args}"
|
||||
ac_configure_args=" --enable-function-sections${ac_configure_args}"
|
||||
ac_configure_args=" LIBEVENT_CFLAGS='${EXTRA_CFLAGS}'${ac_configure_args}"
|
||||
ac_configure_args=" LIBEVENT_CPPFLAGS='${EXTRA_CPPFLAGS}'${ac_configure_args}"
|
||||
ac_configure_args=" LIBEVENT_LDFLAGS='${EXTRA_LDFLAGS}'${ac_configure_args}"
|
||||
AC_CONFIG_SUBDIRS([libevent])
|
||||
...
|
||||
Note, that the following communication channels had been deprecated:
|
||||
- #libevent IRC channel at irc.oftc.net
|
||||
- libevent-users@freehaven.net mailing list
|
||||
|
||||
The space after the initial '"' is significant.
|
||||
0.3. Compatibility
|
||||
|
||||
* "Prepare" and "check" watchers
|
||||
Our source-compatibility policy is that correct code (that is to say, code
|
||||
that uses public interfaces of Libevent and relies only on their documented
|
||||
behavior) should have forward source compatibility: any such code that worked
|
||||
with a previous version of Libevent should work with this version too.
|
||||
|
||||
Libevent now has a new mechanism for hooking into the event loop: "prepare" and
|
||||
"check" watchers. A "prepare" watcher is a callback that fires immediately
|
||||
before polling for I/O. A "check" watcher is a callback that fires immediately
|
||||
after polling and before processing any active events. This may be useful for
|
||||
embedding other libraries' event loops (e.g. UI toolkits) into libevent's. It's
|
||||
also useful for monitoring server performance. For example, if you measure the
|
||||
time between "prepare" and "check," that is the polling duration; the difference
|
||||
between the expected and actual polling duration provides an indication of
|
||||
kernel scheduling delay. And if you measure the time between "check" and the
|
||||
next "prepare" (in the next iteration of the event loop), that is a good
|
||||
approximation of the amount of time handling events; this provides a convenient
|
||||
way to monitor whether any event handlers are blocking or otherwise performing
|
||||
heavy computation.
|
||||
We don't try to do binary compatibility except within stable release series,
|
||||
so binaries linked against any version of Libevent 2.1 will probably need to
|
||||
be recompiled against Libevent 2.2 if you want to use it. It is probable that
|
||||
we'll break binary compatibility again before Libevent 2.2 is stable.
|
||||
|
||||
The watcher API is defined in <event2/watch.h>. A concrete example of how
|
||||
watchers can help monitor server performance is available in
|
||||
"sample/watch-timing.c".
|
||||
1. Core New APIs and features
|
||||
|
||||
* Support for custom HTTP methods
|
||||
1.1. "Prepare" and "check" watchers
|
||||
|
||||
Libevent HTTP code now supports defining custom HTTP methods. It is done
|
||||
through a callback:
|
||||
Libevent now has a new mechanism for hooking into the event loop: "prepare" and
|
||||
"check" watchers. A "prepare" watcher is a callback that fires immediately
|
||||
before polling for I/O. A "check" watcher is a callback that fires immediately
|
||||
after polling and before processing any active events. This may be useful for
|
||||
embedding other libraries' event loops (e.g. UI toolkits) into libevent's. It's
|
||||
also useful for monitoring server performance. For example, if you measure the
|
||||
time between "prepare" and "check," that is the polling duration; the difference
|
||||
between the expected and actual polling duration provides an indication of
|
||||
kernel scheduling delay. And if you measure the time between "check" and the
|
||||
next "prepare" (in the next iteration of the event loop), that is a good
|
||||
approximation of the amount of time handling events; this provides a convenient
|
||||
way to monitor whether any event handlers are blocking or otherwise performing
|
||||
heavy computation.
|
||||
|
||||
#define EVHTTP_REQ_CUSTOM ((EVHTTP_REQ_MAX) << 1)
|
||||
static int ext_method_cb(struct evhttp_ext_method *p)
|
||||
{
|
||||
if (p == NULL)
|
||||
return -1;
|
||||
if (p->method) {
|
||||
if (strcmp(p->method, "CUSTOM") == 0) {
|
||||
p->type = EVHTTP_REQ_CUSTOM;
|
||||
p->flags = 0; /*EVHTTP_METHOD_HAS_BODY*/
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (p->type == EVHTTP_REQ_CUSTOM) {
|
||||
p->method = "CUSTOM";
|
||||
return 0;
|
||||
The watcher API is defined in <event2/watch.h>. A concrete example of how
|
||||
watchers can help monitor server performance is available in
|
||||
"sample/watch-timing.c".
|
||||
|
||||
1.2. Ability to configure read/write buffer sizes for evbuffer/bufferevents
|
||||
|
||||
This allows to increase the IO throughtput.
|
||||
|
||||
Here is some numbers for the single max read in evbuffer impact:
|
||||
function client() { becat "$@" | pv > /dev/null; }
|
||||
function server() { cat /dev/zero | becat -l "$@"; }
|
||||
|
||||
Plain bufferevent:
|
||||
|
||||
- 40K
|
||||
$ server -R $((40<<10)) & client -R $((40<<10))
|
||||
700MiB/s
|
||||
|
||||
- 16K *default now*
|
||||
$ server & client
|
||||
1.81GiB/s
|
||||
|
||||
- 4K
|
||||
$ server -R $((4<<10)) & client -R $((4<<10))
|
||||
1.05GiB/s
|
||||
|
||||
With OpenSSL (-S):
|
||||
|
||||
- 40K *default now*
|
||||
$ server -S -R $((40<<10)) & client -S -R $((40<<10))
|
||||
900MiB/s
|
||||
|
||||
- 16K *default now*
|
||||
$ server -S & client -S
|
||||
745MiB/s
|
||||
|
||||
- 4K
|
||||
$ server -S -R $((4<<10)) & client -S -R $((4<<10))
|
||||
593MiB/s
|
||||
|
||||
So as you can see without openssl 16K is faster then 40K/4K, while for
|
||||
openssl 40K is still faster then 16K (I guess that this is due to with
|
||||
openssl SSL_read() more at at time, while with plain we have some
|
||||
allocations splits in evbuffer and maybe due to some buffer in openssl)
|
||||
|
||||
1.3. New backend for windows - wepoll
|
||||
|
||||
wepoll is a epoll replacement on windows.
|
||||
|
||||
wepoll features, from the official project page [1]:
|
||||
- Can poll 100000s of sockets efficiently.
|
||||
- Fully thread-safe.
|
||||
- Multiple threads can poll the same epoll port.
|
||||
- Sockets can be added to multiple epoll sets.
|
||||
- All epoll events (EPOLLIN, EPOLLOUT, EPOLLPRI, EPOLLRDHUP) are supported.
|
||||
- Level-triggered and one-shot (EPOLLONESTHOT) modes are supported
|
||||
- Trivial to embed: you need only two files.
|
||||
|
||||
[1]: https://github.com/piscisaureus/wepoll
|
||||
|
||||
The default backend on Windows is still select, just because it is well
|
||||
tested, and there is no other reasons. That said, that there is no know
|
||||
issues with wepoll, so please, use it and report any issues!
|
||||
|
||||
1.4. Unix sockets under Windows
|
||||
|
||||
Since Windows 10 there is support for unix domain sockets, and Libevent also
|
||||
supports this, via evutil_socketpair().
|
||||
|
||||
1.5. Priority inheritance for pthreads
|
||||
|
||||
Now you can use
|
||||
evthread_use_pthreads_with_flags(EVTHREAD_PTHREAD_PRIO_INHERIT) to use
|
||||
priority inheritance.
|
||||
|
||||
1.6. signalfd support
|
||||
|
||||
Linux-specific signal handling backend based on signalfd(2) system call, and
|
||||
public function event_base_get_signal_method() to obtain an underlying kernel
|
||||
signal handling mechanism.
|
||||
|
||||
2. HTTP New APIs and features
|
||||
|
||||
2.1. Support for custom HTTP methods
|
||||
|
||||
Libevent HTTP code now supports defining custom HTTP methods. It is done
|
||||
through a callback:
|
||||
|
||||
#define EVHTTP_REQ_CUSTOM ((EVHTTP_REQ_MAX) << 1)
|
||||
static int ext_method_cb(struct evhttp_ext_method *p)
|
||||
{
|
||||
if (p == NULL)
|
||||
return -1;
|
||||
if (p->method) {
|
||||
if (strcmp(p->method, "CUSTOM") == 0) {
|
||||
p->type = EVHTTP_REQ_CUSTOM;
|
||||
p->flags = 0; /*EVHTTP_METHOD_HAS_BODY*/
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (p->type == EVHTTP_REQ_CUSTOM) {
|
||||
p->method = "CUSTOM";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
And to register this callback with http server you can use:
|
||||
evhttp_set_ext_method_cmp(http, ext_method_cb);
|
||||
And to register this callback with http server you can use:
|
||||
evhttp_set_ext_method_cmp(http, ext_method_cb);
|
||||
|
||||
Or registering callback with one client only:
|
||||
evhttp_connection_set_ext_method_cmp(evcon, ext_method_cb);
|
||||
Or registering callback with one client only:
|
||||
evhttp_connection_set_ext_method_cmp(evcon, ext_method_cb);
|
||||
|
||||
2.2. Separate timeouts for read/write/connect phase in HTTP
|
||||
|
||||
New API:
|
||||
|
||||
- client:
|
||||
evhttp_connection_set_connect_timeout_tv() -- for connect
|
||||
evhttp_connection_set_read_timeout_tv() -- for read
|
||||
evhttp_connection_set_write_timeout_tv() -- for write
|
||||
|
||||
- server:
|
||||
evhttp_set_read_timeout_tv() -- for read
|
||||
evhttp_set_write_timeout_tv() -- for write
|
||||
|
||||
It also changes a logic a little, before there was next fallbacks which
|
||||
does not handled in new API:
|
||||
- HTTP_CONNECT_TIMEOUT
|
||||
- HTTP_WRITE_TIMEOUT
|
||||
- HTTP_READ_TIMEOUT
|
||||
|
||||
And introduce another internal flag (EVHTTP_CON_TIMEOUT_ADJUSTED) that
|
||||
will be used in evrpc, which adjust evhttp_connection timeout only if it
|
||||
is not default.
|
||||
|
||||
2.3. Add callback support for error pages
|
||||
|
||||
Now there is evhttp_set_errorcb(), that could be used to change error pages
|
||||
of your http server.
|
||||
|
||||
This can be used for multi lingual support, or to overcome some browser
|
||||
limitations (for example Microsoft Internet Explorer may display its own
|
||||
error pages if ones sent by an HTTP server are smaller than certain sizes)
|
||||
|
||||
2.4. Minimal WebSocket server implementation for evhttp
|
||||
|
||||
Adds few functions (for more details see event2/ws.h) to use evhttp-based
|
||||
webserver to handle incoming WebSockets connections. We've tried to use both
|
||||
libevent and libwebsockets in our application, but found that we need to have
|
||||
different ports at the same time to handle standard HTTP and WebSockets
|
||||
traffic. This change can help to stick only with libevent library.
|
||||
|
||||
Implementation was inspired by modified Libevent source code in ipush project
|
||||
[1].
|
||||
|
||||
[1]: https://github.com/sqfasd/ipush/tree/master/deps/libevent-2.0.21-stable
|
||||
|
||||
Also, WebSocket-based chat server was added as a sample.
|
||||
|
||||
2.5. evhttp_bound_set_bevcb()
|
||||
|
||||
Like evhttp_set_bevcb(), but for evhttp_bound_socket, and callback of
|
||||
evhttp_set_bevcb() will not be called if evhttp_bound_set_bevcb() returns
|
||||
bufferevent.
|
||||
|
||||
2.6. evhttp max simultaneous connection limiting
|
||||
|
||||
When the max connection limit is enabled and the limit is reached, the server
|
||||
will respond immediately with 503 Service Unavailable. This can be used to
|
||||
prevent servers from running out of file descriptors. This is better than
|
||||
request limiting because clients may make more than one request over a single
|
||||
connection. Blocking a request does not necessarily close the connection and
|
||||
free up a socket.
|
||||
|
||||
There are two new API:
|
||||
|
||||
- evhttp_set_max_connections()
|
||||
- evhttp_get_connection_count()
|
||||
|
||||
2.7. Support for Unix Domain Sockets in evhttp
|
||||
|
||||
This can be done using evhttp_connection_base_bufferevent_unix_new()
|
||||
|
||||
There are no standard for encoding a unix socket in an url. nginx uses:
|
||||
|
||||
http://unix:/path/to/unix/socket:/httppath
|
||||
|
||||
The second colon is needed to delimit where the unix path ends and where
|
||||
the rest of the url continues.
|
||||
|
||||
3. Bufferevents
|
||||
|
||||
3.1. SSL layer
|
||||
|
||||
SSL layer has gained Mbed-TLS support, it is implemented in a different
|
||||
library - event_mbedtls (remember that for OpenSSL, event_openssl should be
|
||||
used).
|
||||
|
||||
LibreSSL is also supported, but you don't need separate library for this,
|
||||
since LibreSSL is compatible with OpenSSL.
|
||||
|
||||
The library known to work with OpenSSL 3.0 as well, though the performance
|
||||
with 3.0 is worser.
|
||||
|
||||
Some changes in API, the following had been deprecated:
|
||||
- bufferevent_openssl_get_allow_dirty_shutdown()
|
||||
- bufferevent_openssl_set_allow_dirty_shutdown()
|
||||
- bufferevent_mbedtls_get_allow_dirty_shutdown()
|
||||
- bufferevent_mbedtls_set_allow_dirty_shutdown()
|
||||
|
||||
And instead, the following should be used:
|
||||
- bufferevent_ssl_set_flags()
|
||||
- bufferevent_ssl_clear_flags()
|
||||
- bufferevent_ssl_get_flags()
|
||||
|
||||
Also there is new flag BUFFEREVENT_SSL_BATCH_WRITE, that allows to avoid
|
||||
Nagle effect in SSL.
|
||||
|
||||
4. DNS layer
|
||||
|
||||
4.1. TCP support
|
||||
|
||||
Libevent now has support for DNS requests via TCP.
|
||||
|
||||
By default, requests are done via UDP. In case truncated response is received
|
||||
new attempt is done via TCP connection.
|
||||
|
||||
2 new macros DNS_QUERY_USEVC and DNS_QUERY_IGNTC had been added to force all
|
||||
requests to be done via TCP and to disable switch to TCP in case of truncated
|
||||
responses.
|
||||
|
||||
Possibility for DNS server to listen and receive requests on TCP port also
|
||||
had been added.
|
||||
|
||||
Fallback to TCP in case of truncated DNS requests is done automatically.
|
||||
To imitate the old behaviour macros DNS_QUERY_IGNTC should be used. To
|
||||
force all DNS requests to be done via TCP one should use the flag
|
||||
DNS_QUERY_USEVC. Names DNS_QUERY_IGNTC, DNS_QUERY_USEVC were chosen to
|
||||
imitate similar flags in c-ares and glibc.
|
||||
|
||||
4.2. New evdns options
|
||||
|
||||
- evdns-udp-size - allows to configure maximum allowed size of UDP DNS
|
||||
messages
|
||||
|
||||
- probe-backoff-factor - backoff factor of probe timeout
|
||||
|
||||
- max-probe-timeout - maximum timeout between two probe packets will change
|
||||
initial-probe-timeout when this value is smaller
|
||||
|
||||
And also evdns now can handle CNAME.
|
||||
|
||||
4.3. evdns now has ability to not add default nameservers
|
||||
|
||||
By default evdns adds "127.0.0.1" if there is no other nameservers.
|
||||
|
||||
Two new options had been added:
|
||||
|
||||
- DNS_OPTION_NAMESERVERS_NO_DEFAULT
|
||||
|
||||
Do not "default" nameserver (i.e. "127.0.0.1:53") if there is no nameservers
|
||||
in resolv.conf, (iff DNS_OPTION_NAMESERVERS is set)
|
||||
|
||||
- EVDNS_BASE_NAMESERVERS_NO_DEFAULT
|
||||
|
||||
If EVDNS_BASE_INITIALIZE_NAMESERVERS isset, do not add default
|
||||
nameserver if there are no nameservers in resolv.conf (just set
|
||||
DNS_OPTION_NAMESERVERS_NO_DEFAULT internally)
|
||||
|
||||
5. Listeners new flags
|
||||
|
||||
- LEV_OPT_BIND_IPV6ONLY - bind only to IPv6
|
||||
|
||||
- LEV_OPT_BIND_IPV4_AND_IPV6 -- bind to both to IPv4 and IPv6
|
||||
|
||||
10. Building
|
||||
|
||||
10.1. autotools is deprecated, use cmake
|
||||
|
||||
Building with autotools/automake is considiered as deprecated, instead, cmake
|
||||
is recommended.
|
||||
|
||||
CMake is crossplatform so you don't need to support multiple files for
|
||||
various operation systems, like before.
|
||||
|
||||
Libevent has find_package() support, and this is very flexible way of using
|
||||
the library in your project, since it is very easy to use even local builds
|
||||
(for more information read more about CMake User Registry).
|
||||
|
||||
10.2. Building libevent as a sub-project using GNU Auto* tools
|
||||
|
||||
Some projects will choose to include libevent in their source distribution,
|
||||
and build libevent as a sub-project. This may be effected by putting the
|
||||
line:
|
||||
|
||||
AC_CONFIG_SUBDIRS([path/to/libevent])
|
||||
|
||||
in the master configure.ac file for the master project.
|
||||
|
||||
There are cases where the master project will want to pass in additional
|
||||
flags for CFLAGS, CPPFLAGS, or LDFLAGS. Since these variables are reserved
|
||||
for the user, and AM_CFLAGS, AM_CPPFLAGS, and AM_LDFLAGS are reserved for
|
||||
each package, libevent offers the following variables for a master package
|
||||
to tell libevent that there are additional compile/link values:
|
||||
|
||||
LIBEVENT_CFLAGS
|
||||
LIBEVENT_CPPFLAGS
|
||||
LIBEVENT_LDFLAGS
|
||||
|
||||
A master package can set these variables in its configure.ac file.
|
||||
|
||||
Here's an example:
|
||||
|
||||
configure.ac:
|
||||
...
|
||||
EXTRA_CFLAGS=...
|
||||
EXTRA_CPPFLAGS=...
|
||||
EXTRA_LDFLAGS=...
|
||||
...
|
||||
dnl ac_configure_args is undocumented but widely abused, as here,
|
||||
dnl to modify the defaults of the libevent subpackage, by prefixing
|
||||
dnl our changes to the child configure arguments already assembled.
|
||||
dnl User-supplied contradictory choices should prevail thanks to
|
||||
dnl "last wins".
|
||||
ac_configure_args=" --disable-openssl${ac_configure_args}"
|
||||
ac_configure_args=" --disable-shared${ac_configure_args}"
|
||||
ac_configure_args=" --disable-libevent-regress${ac_configure_args}"
|
||||
ac_configure_args=" --disable-libevent-install${ac_configure_args}"
|
||||
ac_configure_args=" --enable-silent-rules${ac_configure_args}"
|
||||
ac_configure_args=" --enable-function-sections${ac_configure_args}"
|
||||
ac_configure_args=" LIBEVENT_CFLAGS='${EXTRA_CFLAGS}'${ac_configure_args}"
|
||||
ac_configure_args=" LIBEVENT_CPPFLAGS='${EXTRA_CPPFLAGS}'${ac_configure_args}"
|
||||
ac_configure_args=" LIBEVENT_LDFLAGS='${EXTRA_LDFLAGS}'${ac_configure_args}"
|
||||
AC_CONFIG_SUBDIRS([libevent])
|
||||
...
|
||||
|
||||
The space after the initial '"' is significant.
|
||||
|
||||
11. Continious Integration
|
||||
|
||||
Now Libevent uses github actions for CI, previously we had travis-ci for
|
||||
linux/macos and appveyor for win32 (removed in #951), and also I used testing
|
||||
vagrant for some time, but it had been moved into a separate repository
|
||||
(8c1838be). But actually this is not required anymore since github actions
|
||||
supports:
|
||||
- linux
|
||||
- freebsd
|
||||
- windows
|
||||
- osx
|
||||
- openbsd
|
||||
- and also tests under Thread/Address/Undefind sanitizers
|
||||
|
||||
So no need to test something locally before releases.
|
||||
|
||||
One thing that worth to mention, now, CI depends on public workers, and they
|
||||
are pretty limited, so it take some time to run the whole CI.
|
||||
|
||||
12. Documentation
|
||||
|
||||
Now documentation is automatically deployed to https://libevent.org/doc/
|
||||
|
Loading…
x
Reference in New Issue
Block a user