Log

Author Commit Date CI Message
Azat Khuzhin 1df324d4 2020-05-05T00:21:18 Fix EV_CLOSED detection/reporting (epoll only) - EV_CLOSED is EPOLLRDHUP in epoll - EPOLLRDHUP reported w/o EPOLLHUP if the socket closed with shutdown(SHUT_WR) - EPOLLRDHUP reported w/ EPOLLHUP if the socket closed with close() so in this case epoll backend will detect this event as error (EV_READ|EV_WRITE), since the epoll_ctl() will return EPOLLRDHUP with EPOLLHUP set, but this is not correct, let's fix this. Fixes: #984 (cherry picked from commit 972b456bf60e9a2f550ec45a14921c06e252c793)
Azat Khuzhin db2efdf5 2020-05-05T00:05:49 Merge branch 'EV_CLOSED-and-EV_ET-fixes' * EV_CLOSED-and-EV_ET-fixes: Avoid triggering wrong events with EV_ET set epoll: handle EV_ET for EV_CLOSED too test: cover EV_CLOSED with lots of possible scenarious test: rename simpleclose to simpleclose_rw (since it works via write/read) (cherry picked from commit c10cde4c617979e951352775a9685a47bf9c6acd)
yuangongji a6974d11 2020-05-01T09:51:29 cmake: set a default value for LIBEVENT_STATIC_LINK (cherry picked from commit 86eafc03433cb5719e5b75ff99ffab8633433a17)
Azat Khuzhin f0ded5f3 2020-03-28T16:02:39 Merge branch 'event_rpcgen.py-cleanup' * event_rpcgen.py-cleanup: event_rpcgen.py: fix arguments-differ event_rpcgen.py: fix attribute-defined-outside-init event_rpcgen: suppress some warnings to make pylint clean Don't accumulate arguments in `Entry.GetTranslation` Fix improper string concatenations in lists Fix warnings regarding unused variables Don't override the `type` built-in Call `super` to call methods from the parent class Address `no-self-use` issues reported by pylint Run the code through the black formatter Reformat strings to template Add `argparse` support Precompile regular expressions Use bools instead of ints values where possible Rename all global variables to match the PEP8 spec Handle file pointers with context suite patterns Iterate over `tokens` with a for instead of while Fix indentation for `RpcGenError` Don't override `file` built-in Resolve variable name issues per PEP8 Sort imports per PEP8 (cherry picked from commit dd02ad9544ec857412e8a5a0462ddcb29e8045f6)
Nick Grifka a8219143 2020-04-27T15:02:25 evutil_time: improve evutil_gettimeofday on Windows If present, use GetSystemTimePreciseAsFileTime instead of GetSystemTimeAsFileTime. Available since Windows 8. (cherry picked from commit f0b3160f8ce7fbd411493dcd023f562f4f9d17ee)
Nicolas J. Bouliane 4dd3acdd 2020-05-03T00:32:10 bufferevent: allow setting priority on socket and openssl type (cherry picked from commit bdc5200acdf0a004ddc805b87bf09439fe2ebe7f)
Nick Grifka 1fce771d 2020-04-16T12:08:02 bench: Allow backend method selection -l list available methods -m <name> use method (cherry picked from commit 5caffa7a5b3ce67e074e2ee99fc553c1cac0712c)
Azat Khuzhin 9ed49f2d 2020-04-08T00:29:40 cmake: missing test-closed binary (cherry picked from commit 57862901095a97306e74b2944d5808051f813ed5)
yuangongji 13af9d26 2020-03-20T17:49:37 cmake: replace CheckFunctionExists with CheckSymbolExists Checking functions with `CheckFunctionExists` may get wrong results, we should replace it with `CheckSymbolExists`, which is recommended by the cmake official documentation. Before using `CheckSymbolExists`, we use `CheckIncludeFiles` to check header files and save the available header files in a variable that guarantees `CheckSymbolExists` and `CheckTypeSize` to work correctly. This approach is modeled after the cmake scripts of `curl`. The following functions or files were not found before modification, they can now be found: - msys2 + mingw-8.1.0 on Windows10 or mingw-7.3.0 on Ubuntu-18.04 timerclear timercmp timerisset - windows10 getaddrinfo getnameinfo getprotobynumber getservbyname putenv strtoll timerclear timercmp timerisset - ubuntu-18.04 sys/sysctl.h timeradd timerclear timercmp timerisset - MacOS 10.13 sys/random.h timeradd timerclear timercmp timerisset (cherry picked from commit 41d1d75a84e03219ec037b0f7982a67fb031eae7)
Mario Emmenlauer 640f9cf6 2020-03-03T19:02:24 LibeventConfig.cmake: restore CMAKE_FIND_LIBRARY_SUFFIXES and LIBEVENT_STATIC_LINK default The current cmake/LibeventConfig.cmake.in has a few problems and I'm not sure how cleanly developed it is. It seems rater complex for the little things I would assume it needs to do. I found two problems that are fixed in this PR: - If the downstream user does not explicitly set LIBEVENT_STATIC_LINK before calling find_package(libevent) then they will not be able to detect the static library, even if its the only one that exists. Since this may be rather strict, I've changed the behavior so that LIBEVENT_STATIC_LINK can be set to ON or OFF, but if unset, it defaults to whatever configuration libevent was built as. - The other problem is a bug. The package configuration needs to unset CMAKE_FIND_LIBRARY_SUFFIXES after use, otherwise all packages that are detected after libevent will be "infected" by this setting. This was a significant problem for us, and is very hard to detect in downstream project, because the order of dependencies will lead to different search results. (cherry picked from commit 1675a55620e6f0bbba5776f2df72cd48920421c2)
yuangongji dea51c2e 2020-03-16T20:11:06 cmake: fix getaddrinfo checking error Using `CheckFunctionExists` on Windows to check `getaddrinfo` will get `not found`, but it actually exists. Using `CheckSymbolExists` with headers will get correct results. Other functions such as `getnameinfo`,`inet_ntop`,etc. have the same issue. (cherry picked from commit 503ba1d36571e3cb01826d15dc462b7d8b5094de)
yuangongji 88384865 2020-03-16T18:57:54 cmake: remove CheckFunctionExistsEx `CheckFunctionExistsEx` is copied from the cmake modules before 3.1.2, which is the minimum required version of libevent. The internal module `CheckFunctionExists`of cmake can completely replace it. (cherry picked from commit 61c5c19bfdabd2f16407a3ed615060c9d0502e82)
yuangongji 30662a3c 2020-02-29T17:47:47 increase segment refcnt only if evbuffer_add_file_segment() succeeds (cherry picked from commit 114b3836755f1e526e658b248464465136bd87b8)
ayuseleznev 6f8e0e97 2020-02-27T16:59:45 evdns: fix a crash when evdns_base with waiting requests is freed Fix undefined behaviour and application crash that might take place in some rare cases after calling evdns_base_free when there are requests in the waiting queue. Current cleanup procedure in evdns_base_free_and_unlock function includes 2 steps: 1. Finish all inflight requests. 2. Finish all waiting requests. During the first step we iterate over each list in req_heads structure and finish all requests in these lists. With current logic finishing an inflight request (function request_finished) removes it from the inflight requests container and forces a wating connection to be sent (by calling evdns_requests_pump_waiting_queue). When these new requests are sent it is possible that they will be inserted to the list in req_heads that we've already cleaned. So in some cases container of the inflight requests is not empty after this procedure and some requests are not finished and deleted. When timeouts for these requests expire evdns_request_timeout_callback is called but corresponding evdns_base has been already deleted which causes undefined behaviour and possible applicaton crash. It is interesting to note that in old versions of libevent such situation was not possible. This bug was introduced by the commit 14f84bbdc77d90b1d936076661443cdbf516c593. Before this commit nameservers were deleted before finishing the requests. Therefore it was not possible that requests from the waiting queue be sent while we finish the inflight requests. (cherry picked from commit 4da9f87ccbe71edb3b3aaf74b8b64d7e9c41dcaf)
chenguolong 2e9ceb16 2020-02-04T16:05:02 event_base_once: fix potential null pointer threat supposing if base is null, EVBASE_ACQUIRE_LOCK and EVBASE_RELEASE_LOCK would get a coredump, so we add a guard for protection. Signed-off-by: chenguolong <cgl.chenguolong@huawei.com> (cherry picked from commit 968bbd5c918568eb95b493af05c464ddfc36671b)
yuangongji 9e993c3c 2020-02-11T14:33:15 test-ratelim: add missing free (cherry picked from commit 5fbe6313ae7e81cde3e056b29171a6346c54aa0b)
Azat Khuzhin 8a9b5655 2020-01-21T20:10:15 Do not use shared global structures on CYGWIN Fixes: #950 (cherry picked from commit 2c473056abdf710b6c476b7b19777d5313e71d8a)
yuangongji b9bf7fa7 2020-03-14T11:13:38 autoconf: fix getaddrinfo checking errors on mingw `AC_CHECK_FUNCS` can not properly check `getaddrinfo` because this function requires some special headers on mingw. Using `AC_CHECK_DECL` can effectively solve this issue. Same for - getnameinfo - getprotobynumber - getservbyname - inet_ntop - inet_pton (cherry picked from commit 6d54be2cc078351b4ce1e469bedc4a976f4e3636)
Azat Khuzhin e41a1969 2020-03-01T15:47:40 test-time: do not use deprecated API - event_init() -> event_base_new() - event_set() -> event_new() - check return value of event_base_dispatch() - use EXIT_SUCCESS/EXIT_FAILURE (cherry picked from commit 4e5a41ca0f668da1a18832e5cb02b4afeae074ff)
Azat Khuzhin 29e2c7f2 2020-03-01T14:54:36 test-time: enable debug mode if EVENT_DEBUG_LOGGING_ALL env set (cherry picked from commit a11edbfa369f7a99886359b3f4baa69686dc275f)
Azat Khuzhin 0ef87f5f 2020-01-14T21:45:01 test: move thread into realtime class even on EVENT__DISABLE_THREAD_SUPPORT (cherry picked from commit ca2b72c546d80dfb4fa255b20ef4a829ed102a70)
Azat Khuzhin 5a400c1f 2020-01-14T10:20:12 test: fix compilation without thread support (EVENT__DISABLE_THREAD_SUPPORT=ON) (cherry picked from commit d0adbc05654eca27384b6496cfd8a22ed4dfb4fb)
Azat Khuzhin 1121ebed 2020-01-14T02:14:16 test: fix bufferevent/bufferevent_connect_fail_eventcb* under osx/freebsd For OSX the socket should be closed, otherwise the "connection refused" will not be triggered. And freebsd can return error from the connect(). (cherry picked from commit 30fe125041ab38045487bd3af60d2f564dffc81c)
Azat Khuzhin d5d18a56 2020-01-14T00:38:06 test: fix dst thread in move_pthread_to_realtime_scheduling_class (osx) Fixes the following tests on osx: - del_wait - no_events Refs: #940 (cherry picked from commit 10504fcab927e8b226ef2e988b1b3f175c3e9f71)
Azat Khuzhin 265cbe10 2020-01-14T00:27:21 test: fix compilation under win32 (rearrange thread_setup() code) (cherry picked from commit 34d51e1bc9c650c4d012fe3024f7777c819ba969)
Azat Khuzhin 8991346d 2020-01-14T00:41:48 test: use THREAD_* wrappers over pthread* in del_notify (cherry picked from commit 391003e9b78acff0ee5096c592fc4b601a02648d)
Azat Khuzhin e85afbe3 2020-01-13T23:36:40 Merge branch 'osx-clock' Moves the thread into real-time scheduling class, as recommended in [1], it fixes the separate test provided by @ygj6 [2] everywhere (github actions, travis-ci, appveyor) under osx. [1]: https://developer.apple.com/library/archive/technotes/tn2169/_index.html [2]: https://github.com/azat-archive/osx-timers/commit/dde1a6e4d04506d0e0fb193ebb9f49ae25873be6 Although even after this changes the following time-related tests failed on travis-ci: - no_events - del_wait But anyway I guess #940 can be closed, since this fixes the issue in common. * osx-clock: test: Use THREAD_* wrappers in del_notify/del_wait test: move threads created with THREAD_START() to realtime scheduling class too test: put thread into real time scheduling class on osx for better latencies Closes: #940 (cherry picked from commit a6f81aa45455c8afb69980f7026a0e706f4f9387)
Dimo Markov 3f1fb1f9 2020-01-08T20:37:16 Added uninstall target check to cmakelists (cherry picked from commit f0e79bafd8823aedf535e9b344d4cf9a4f9747e5)
Azat Khuzhin 677378ea 2020-01-13T22:24:54 cmake: do not print used method (EVENT_SHOW_METHOD) while running tests autotools don't, plus this will make CI logs cleaner (cherry picked from commit f8a6f12712e775720b36e0c4375a5fd6870bb737)
Azat Khuzhin 70ac2144 2020-01-13T22:24:54 cmake: run regress test quietly like autotools (makes CI logs cleaner) (cherry picked from commit fa33819e3b0f706a0c8b6bcb6eb2c6646609542a)
Azat Khuzhin e2424229 2020-01-12T15:34:51 Merge branch 'http-connect' After this patchset http-connect works with pproxy [1]: $ pproxy -l http://:8000/ -vvv & $ http-connect //127.1:8000 http://kernel.org:80/ [1]: https://pypi.org/project/pproxy/ * http-connect: http-connect: do not check connection on GET cb http-connect: set Host header (for CONNECT and GET) (like curl) http-connect: cleanup and helpers http: do not close connection for CONNECT http: do not assume body for CONNECT Fixes: #946 (cherry picked from commit 462f2e97660cc2b6af563ab631050a83c3e0935b)
Azat Khuzhin 1b42270b 2020-01-12T13:43:18 http: do not assume body for CONNECT (cherry picked from commit 998e68340e5cd289a16f340cc5c625e984e1f762)
Azat Khuzhin 921bdcdd 2020-01-05T19:02:22 Fix compilation without OPENSSL_API_COMPAT Use the following for openssl 1.1+: - X509_getm_notBefore over X509_get_notBefore - X509_getm_notAfter over X509_get_notAfter - use OPENSSL_VERSION_NUMBER over SSLeay() - add missing headers Refs: openssl/openssl@0b7347effee5 (cherry picked from commit 08981f8d752ad23e21887b42944783e843b2e281)
yuangongji d42240d1 2019-12-27T17:53:28 evutil_time: Implements usleep() using wait funtion on Windows (cherry picked from commit 6412f34f242e9b5b87f0378715baf97ba0bf1a8c)
yangyongsheng d9da4126 2019-12-29T20:52:17 Initialize variable to 0 replace use memset function in sample/hello-world.c (cherry picked from commit 1edb6f6188d5dd2155c6e8ad997eaca11157e95f)
Azat Khuzhin 2db851a9 2019-11-30T15:48:36 cmake: set CMAKE_{RUNTIME,LIBRARY,ARCHIVE}_OUTPUT_DIRECTORY they are not defined This will allow overriding them in parent cmake rules, i.e. if libevent is used via add_subdirectory(). Closes: #931 (cherry picked from commit 8f13c170cf6e9a02dec410b967884ec5e08947ab)
Azat Khuzhin 47eb8c12 2019-11-30T15:53:52 cmake: use CMAKE_LIBRARY_OUTPUT_DIRECTORY for the final shared library symlink Fixes: 669a53f3 ("cmake: set library names to be the same as with autotools") (cherry picked from commit b9f442e2d7af8b01cd34f75f2f404763b76d42dc)
Azat Khuzhin 8ad26d0b 2019-11-17T18:13:51 test-ratelim: calculate timers bias (for slow CPUs) to avoid false-positive This can be/should be done for regression tests too. Refs: https://ci.appveyor.com/project/libevent/libevent/builds/28916689/job/kg621aa194a0qbym Refs: https://github.com/libevent/libevent/pull/917#issuecomment-553811834 v2: EVENT_BASE_FLAG_PRECISE_TIMER (cherry picked from commit 8a34869984c470fb243fc9587c469b316add2f7e)
Azat Khuzhin ffc528e9 2019-11-17T15:41:22 mailmap: add name/email aliases for yuangongji (name and email) Before: $ git log --format='%aE %aN' --author=yuangongji | sort | uniq -c 30 82787816@qq.com yuangongji 1 82787816@qq.com yuangongji (A) After: $ git log --format='%aE %aN' --author=yuangongji | sort | uniq -c 34 yuangongji@foxmail.com yuangongji (cherry picked from commit 026590f908f8ef8602d54bd680c8bef9f4552d55)
yuangongji baec84f2 2019-11-14T18:28:31 cmake: test for find_package() (cherry picked from commit cd15112b620feadafe8fd3531043870a5c19a4a6)
yuangongji 1c047618 2019-11-07T18:26:47 cmake: improve package config file (cherry picked from commit dc4be869d5009f38e0ef02ff07dd799f9c2fef2f)
Azat Khuzhin 976f7d34 2019-11-06T21:41:38 Link with iphlpapi only on windows Fixes: 9fecb59a ("Parse IPv6 scope IDs.") Refs: #923 (cherry picked from commit 1495f8b67a6061ac5c8dcbc42dd71398d6355c9a)
Philip Homburg f602211f 2019-10-29T15:48:53 Parse IPv6 scope IDs. (cherry picked from commit 9fecb59a94ef246088d7f3e0365c2fe80d0df2f4)
Azat Khuzhin ca92a755 2019-10-31T09:18:58 Relax bufferevent_connect_hostname_emfile Do not do any assumptions on the error for the EMFILE from getaddrinfo(), expect just any error. Fixes: #924 (cherry picked from commit 4436287d1247fb2e9c80560debf852a94657e485)
yuangongji 93174bb5 2019-10-26T22:31:18 autotools: fails build when need but can not find openssl (cherry picked from commit 53b3be4ee9e814a22876675c0ee004f0ebfb8535)
yuangongji a9d1121d 2019-10-25T21:54:13 cmake: eliminate duplicate installation of public headers (cherry picked from commit 5fe83d7433022e29a401753f64ec78faaf25e0a7)
Michael Davidsaver 87c6f735 2019-10-21T10:36:49 append to CMAKE_MODULE_PATH Don't override any -DCMAKE_MODULE_PATH= passed from CLI to eg. test custom Platform/ support. (cherry picked from commit 84affc1837a727640f46eff2723c1364d2cd1695)
Azat Khuzhin d2871a37 2019-10-16T01:11:51 Do not use sysctl.h on linux (it had been deprecated) It had been deprecated for a long time (AFAIK), but since glibc-2.29.9000-309-g744e829637 it produces a #warning (cherry picked from commit b9b9f19058dc04b7ad4d079a38f6b86c0e7b1072)
yuangongji e35e02e6 2019-10-08T21:38:58 sample/https-client: link crypt32 explicitly when build with mingw-w64 (cherry picked from commit 78b5bca6d83a70a0b9dfc438898d5c1908cc3c2a)
Kamil Rytarowski 5febb4e1 2019-10-04T01:26:47 Fix compat with NetBSD >= 10 kevent::udata was switched from intptr_t to void*. Handle both cases with the GCC extension typeof(). (cherry picked from commit 72e6eff0251bffec72e0b8b2cedf72f173c8b9e9)
William A Rowe Jr 50b9be00 2019-10-03T11:40:52 Avoid transforming base C_FLAGS set deliberately The CMAKE_C_FLAGS_DEBUG, CMAKE_C_FLAGS_RELEASE, CMAKE_C_FLAGS_MINSIZEREL and CMAKE_C_FLAGS_RELWITHDEBINFO options are correctly and deliberately toggled to use the libcmt (/MT) flag options in place of the usual msvcrt (/MD) options, but this isn't necessarily desired by the user. The default choice can be overriden with the EVENT__MSVC_STATIC_RUNTIME cmake option. However, the /MD flag that is the choice of CMake only enters into play for the four types of builds above. If the user introduces another CMAKE_BUILD_TYPE, the base CMAKE_C_FLAGS must not be manipulated, as that value (and the CMAKE_C_FLAGS_{custom} value) have been explicitly chosen by the user/developer deploying this library, and the mismatch between these flags in different dependencies results in link errors. The CMake build schema itself doesn't place an /MD flag in CMAKE_BUILD_TYPE so any /M compile option in that variable needs to be retained. Signed-off-by: William Rowe <wrowe@pivotal.io> Signed-off-by: Yechiel Kalmenson <ykalmenson@pivotal.io> (cherry picked from commit af4b07a55cc0ff0298cbd26c87b3f6a08f84c394)
yuangongji 794e8f75 2019-09-26T21:47:51 tinytest: support timeout on Windows (cherry picked from commit 8d5c5650d281019832fa7b5133b85c7ad29f664e)
Azat Khuzhin a4f0387c 2019-09-22T18:44:55 Merge branch 'upstream/pr/899' (evbuffer_freeze testcase enhancements) * upstream/pr/899: improve the description of parameter to evbuffer_read() regress_buffer: improve testcase for evbuffer_freeze() (cherry picked from commit a977d6963611c729b75108d31bf74718b7b3e06d)
Azat Khuzhin 5f017bde 2019-09-21T23:30:48 evbuffer_add_file: fix freeing of segment in the error path if evbuffer_add_file_segment() fails it returns -1, so we should call evbuffer_file_segment_free() only on error, and this -1 not 0. Fixes: 6a81b1f5 ("Avoid double-free on error in evbuffer_add_file. Found by coverity.") Backport-to: 2.1 (cherry picked from commit 4727150a54e21725f0ef4f43ca5028cc6f353664)
yuangongji f4a6152c 2019-09-19T15:24:51 evutil_time: detect and use _gmtime64_s()/_gmtime64() (cherry picked from commit 148d12ad31b03a813f4ffd9df14a85392aa74130)
yuangongji c169bdcb 2019-09-18T23:12:59 http: rename bind_socket_ai() to create_bind_socket_nonblock() (cherry picked from commit 0cd536b0b33d2aa59cee3805846f81cf4e4a5ce9)
yuangongji e9478640 2019-09-15T21:45:26 https-client: load certificates from the system cert store on Windows (cherry picked from commit 572a565130d40172e1f2b5ac83d0cdffd502105b)
Azat Khuzhin fc51bf2c 2019-09-05T23:31:19 Fix checking return value of the evdns_base_resolv_conf_parse() Reported-by: Maxim Gorbachyov <maxim.gorbachyov@gmail.com> (cherry picked from commit c3f353450e94248ee677a068ed2c4ed29d64f79e)
Azat Khuzhin e0e5f3bd 2019-09-04T00:46:01 cmake: fix getrandom() detection Fixes: 86f55b04 ("arc4random: replace sysctl() with getrandom (on linux)") (cherry picked from commit 194a5d822651c03fc988c1bf087e65ed20f453f7)
Azat Khuzhin 66ec78fd 2019-09-03T00:34:35 arc4random: replace sysctl() with getrandom (on linux) Since sysctl() is deprecated for a long-long time, according to sysctl(2): Since Linux 2.6.24, uses of this system call result in warnings in the kernel log. Fixes: #890 Suggested-by: Pierce Lopez (cherry picked from commit 86f55b0420f864b518475f781ce7a3c619180b12)
yuangongji 45da7d9d 2019-08-30T10:21:07 Upgrade autoconf (after upgrading minimum required to 2.67) - AC_PROG_SED - AC_USE_SYSTEM_EXTENSIONS - AC_TRY_COMPILE -> AC_COMPILE_IFELSE - AC_TRY_RUN -> AC_RUN_IFELSE ... Also use: - AC_CONFIG_AUX_DIR Refs: #870 Fixes: 3f09e923 ("Change the minimum version of automake to 1.13 and autoconf to 2.67") (cherry picked from commit 13b8fc39fd4000de2c836b0acdc52ae5b4c757c7)
Azat Khuzhin 71f5c0d3 2019-08-29T22:57:44 Revert "Warn if forked from the event loop during event_reinit()" Thinking about this more and realizing that this was a mistake, so should be reverted. In a nut shell I guess most of the apps calls event_reinit() from the loop (see [1] for example), and this should be totally fine (the bit with the signals [2] handled in event_reinit() gracefully) [1]: https://archives.seul.org/libevent/users/Aug-2019/msg00009.html [2]: https://github.com/libevent/libevent/pull/833#issuecomment-501834453 This reverts commit 497ef904d544ac51de43934549dbeccce8e6e8f8. Reported-by: mikulas@twibright.com Backport-to: 2.1 (cherry picked from commit ddacaef59ab6808a0801007d0a681f2415af4871)
yuangongji 9e468c77 2019-08-28T11:41:53 eliminate some C4267 warnings in Windows (cherry picked from commit 6f970267b6ba68c9dd9090d789c928529745dc68)
yuangongji 5d1e8570 2019-08-23T22:31:28 autotools: attach doxygen target into all target v2: disable man pages by default (cherry picked from commit f9c6a14ee089452c74e492edc674260a3717763e)
yuangongji 7a85300a 2019-08-23T21:48:05 cmake: attach doxygen target into all target v2: Disable non-html generator for doxygen by default v3: convert cmake option to doxygen config (cherry picked from commit 1d1c19091f13b7e19015698a23f454aa85f17ac3)
Jan Kasiak 8ccd8f56 2019-08-22T16:36:12 Fix memory corruption in EV_CLOSURE_EVENT_FINALIZE with debug enabled Call event_debug_note_teardown_ before evcb_evfinalize to avoid possible UAF (if finalizer free's event). (cherry picked from commit 445027a5dcfe0acce431b7d4065d2ac1f6b270d7)
Jan Kasiak 23af76de 2019-08-27T01:00:56 test: prevent duplicate event_enable_debug_mode() for TT_ENABLE_DEBUG_MODE (cherry picked from commit 70daa93a514075eb0102eec4c6e5002b114264a9)
Azat Khuzhin 0126814f 2019-08-26T22:43:35 test: introduce TT_ENABLE_DEBUG_MODE flag (cherry picked from commit 6186d3126f124494dd90b14f62c17b47f7a7f484)
David Disseldorp 4a6f1ccf 2019-08-21T01:10:19 sample/http-server: fix parameter parsing argv[1] is currently unconditionally passed as the docroot to send_document_cb(). This is broken if any optional parameters are provided, such as -p <port>. Signed-off-by: David Disseldorp <ddiss@samba.org> (cherry picked from commit 7d71214e02646a31eede66ad5badf695a2ab2058)
David Disseldorp f9d7ac0d 2019-08-21T01:00:07 sample/signal-test: fix use of uninitialized variable signal_int is uninitialized in the !base error path. Signed-off-by: David Disseldorp <ddiss@samba.org> (cherry picked from commit a0276292a5e783c30643992897c7597f0db2cc96)
dota17 ec52e6af 2019-08-06T18:19:15 Fix typos in comments (sample/test/event-internal.h) (cherry picked from commit 9c151f3c3413c5ee6bad498aca84be481196bbc7)
dota17 317b026b 2019-08-08T21:28:20 sample/signal-test: add NULL checks Fixes: #865 (cherry picked from commit 101fbe31005c07cde0fdbdb38a4f6c3499e07edc)
ygj6 fdb8fb66 2019-08-08T21:48:21 Change the minimum version of automake to 1.13 and autoconf to 2.67 When I run make check via automake with a version of 1.12.6 or lower, I got this error: /bin/sh: line 9: ./test_runner_epoll: No such file or directory FAIL: test_runner_epoll /bin/sh: line 9: ./test_runner_select: No such file or directory FAIL: test_runner_select /bin/sh: line 9: ./test_runner_kqueue: No such file or directory FAIL: test_runner_kqueue /bin/sh: line 9: ./test_runner_evport: No such file or directory FAIL: test_runner_evport /bin/sh: line 9: ./test_runner_devpoll: No such file or directory FAIL: test_runner_devpoll /bin/sh: line 9: ./test_runner_poll: No such file or directory FAIL: test_runner_poll /bin/sh: line 9: ./test_runner_win32: No such file or directory FAIL: test_runner_win32 /bin/sh: line 9: ./test_runner_timerfd: No such file or directory FAIL: test_runner_timerfd /bin/sh: line 9: ./test_runner_changelist: No such file or directory FAIL: test_runner_changelist /bin/sh: line 9: ./test_runner_timerfd_changelist: No such file or directory FAIL: test_runner_timerfd_changelist Open the Makefile generated by command ./autogen.sh && ./configure I can see the errors are caused by this line: if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then $${dir}$$tst will expand to ./test_runner_epoll, but test_runner_epoll is only a target in test/include.am, not a file, so it print: /bin/sh: line 9: ./test_runner_epoll: No such file or directory. It seems like a bug in automake 1.12.6. The errors will disappear if I simply upgrade automake to 1.13, and upgrade autoconf to 2.65 (2.65 is the lowest version dependent by automake-1.13). When I build with automake-1.13 and autoconf-2.66, I got another error: configure.ac:667: error: AC_CHECK_SIZEOF: requires literal arguments The code in configure.ac line 667 is : AC_CHECK_SIZEOF(void *) It is a bug in autoconf-2.66 : http://gnu-autoconf.7623.n7.nabble.com/AC-CHECK-SIZEOF-int-is-error-in-autoconf-2-66-td13537.html Finally, everything works fine when using automake-1.13 and autoconf-2.67. Refs: #858 (cherry picked from commit 3f09e9230ab45008e0016b63fc1d3b05eb23e6ec)
Azat Khuzhin 877f2355 2019-08-03T14:32:21 Add Uninstall.cmake.in into dist archive Fixes: #863 (cherry picked from commit f05ba671931e2b4e38459899f6f63f79f99869fe)
Azat Khuzhin 4c908dde 2019-08-02T00:37:51 Merge branch 'release-2.1.11-stable-pull' into patches-2.1 * release-2.1.11-stable-pull: Bump version to 2.1.11-stable (with ABI breakage) Bump ChangeLog Bump AUTHORS.md ...
Azat Khuzhin 5b723a66 2019-08-02T00:23:11 Bump version to 2.1.11-stable (with ABI breakage)
Azat Khuzhin 70026169 2019-08-02T00:20:30 Bump ChangeLog
Azat Khuzhin b9c364e4 2019-08-02T00:12:11 Bump AUTHORS.md
Azat Khuzhin 598f247d 2019-07-31T10:34:38 buffer: fix possible NULL dereference in evbuffer_setcb() on ENOMEM [ @azat: - add return heredoc for evbuffer_setcb() - add unit test with event_set_mem_functions() - look through the report from abi-compliance-checker/abi-dumper ] Closes: #855 (cherry picked from commit bdcade47224f154052c927aed3c363a18b37112e)
yuangongji 2a333008 2019-07-27T22:41:39 Change autoconf version to 2.62 and automake version to 1.11.2 On my computer, the version of autoconf is 2.59 and automake is 1.9 I build with autogen.sh & configure & make and failed. I find In Makefile.am: include/event2/event-config.h: config.h make-event-config.sed $(AM_V_GEN)test -d include/event2 || $(MKDIR_P) include/event2 $(AM_V_at)$(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T $(AM_V_at)mv -f $@T $@ There are three undefined variables: MKDIR_P, AM_V_GEN and AM_V_at. Then I tried: - autoconf-2.60 / automake-1.10 - autoconf-2.61 / automake-1.11 - autoconf-2.62 / automake-1.11.2 And only autoconf-2.62 & automake-1.11.2 is ok. Therefore, I recommend changing the autoconf version from 2.59 to 2.62 and automake version from 1.9 to 1.11.2. Plus autoconf 2.59 is too old - 2003.12.16 [1], so as automake 1.9 - 2004.08.11 [2], while $(AM_V_GEN)/$(AM_V_at) had been introduced in 371a1237 back in 2012. [1]: http://ftp.gnu.org/gnu/autoconf/ [1]: http://ftp.gnu.org/gnu/automake/ Fixes: 371a1237 ("Make quiet build even quieter") (cherry picked from commit 1947dd0ddbced0d8f9891656c820353f82261c52)
Azat Khuzhin 596855f7 2019-07-12T00:00:12 cmake: install shared library only if it was requested $ cmake -DEVENT__LIBRARY_TYPE=static .. ... CMake Error: Error evaluating generator expression: $<TARGET_FILE_DIR:event_core_shared> No target "event_core_shared" Fixes: #853 Fixes: 669a53f3 ("cmake: set library names to be the same as with autotools") (cherry picked from commit 55d1e20e1a5dbd1188f4143968f7cafee33edc0d)
yuangongji 9559349c 2019-07-03T00:27:22 Missing <winerror.h> on win7/MinGW(MINGW32_NT-6.1)/MSYS (cherry picked from commit 7806f3ec78368d69bfcf53cdffcdb424a528a113)
yuangongji 305251b9 2019-07-10T00:30:12 cmake: set library names to be the same as with autotools libtool has VERSION_INFO [1], cmake has SOVERSION/VERSION instead (although it has different format). Also libtool has RELEASE [2] while cmake do not have analog yet [3], hence manual symlinks should be created. [1]: https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html [2]: https://www.gnu.org/software/libtool/manual/html_node/Release-numbers.html [3]: https://gitlab.kitware.com/cmake/cmake/issues/17652 Plus osx has compatibility_version/current_version dylib properties and cmake do not have separate properties for them [4], hence manual LINK_FLAGS. And also there INSTALL_NAME_DIR property which should be adjusted too. [4]: https://public.kitware.com/Bug/view.php?id=4383 So after all changes, here is an example before/after for osx and linux: # osx # autotools .libs/libevent_pthreads-2.2.1.dylib .libs/libevent_pthreads.dylib -> libevent_pthreads-2.2.1.dylib /usr/local/lib/libevent_pthreads-2.2.1.dylib (compatibility version 2.0.0, current version 2.0.0) # cmake # before patch lib/libevent_pthreads.2.2.0.dylib lib/libevent_pthreads.dylib -> libevent_pthreads.2.2.0.dylib @rpath/libevent_pthreads.2.2.0.dylib (compatibility version 2.2.0, current version 0.0.0) # after patch lib/libevent_pthreads-2.2.1.dylib lib/libevent_pthreads.dylib -> libevent_pthreads-2.2.1.dylib /vagrant/.cmake/inst/lib/libevent_pthreads-2.2.1.dylib (compatibility version 2.0.0, current version 2.0.0) # linux # autotools .libs/libevent_pthreads-2.2.so.1 -> libevent_pthreads-2.2.so.1.0.0 .libs/libevent_pthreads-2.2.so.1.0.0 .libs/libevent_pthreads.so -> libevent_pthreads-2.2.so.1.0.0 # cmake # before patch lib/libevent_pthreads.so -> libevent_pthreads.so.2.2.0 lib/libevent_pthreads.so.2.2.0 # after patch lib/libevent_pthreads-2.2.so -> libevent_pthreads-2.2.so.1 lib/libevent_pthreads-2.2.so.1 -> libevent_pthreads-2.2.so.1.0.0 lib/libevent_pthreads-2.2.so.1.0.0 lib/libevent_pthreads.so -> libevent_pthreads-2.2.so.1.0.0 Closes: #838 (cherry-picked) Closes: #760 (cherry picked from commit 669a53f341e192657140952cfe025c260da2b1c1)
Keith Smiley f013fc7d 2019-07-08T14:06:55 Enable _GNU_SOURCE for Android When targeting the Android NDK _GNU_SOURCE is not enabled by default: ``` /* * With bionic, you always get all C and POSIX API. * * If you want BSD and/or GNU extensions, _BSD_SOURCE and/or _GNU_SOURCE are * expected to be defined by callers before *any* standard header file is * included. * * In our header files we test against __USE_BSD and __USE_GNU. */ #if defined(_GNU_SOURCE) # define __USE_BSD 1 # define __USE_GNU 1 #endif ``` Because of this `pipe2` is not available: ``` #if defined(__USE_GNU) int pipe2(int __fds[2], int __flags) __INTRODUCED_IN(9); #endif ``` The function used to check if it does exist: ``` CHECK_FUNCTION_EXISTS_EX(pipe2 EVENT__HAVE_PIPE2) ``` Just check that the _linking_ succeeds, which it does, it's just not visible in the import, leading to a warning (or error): ``` evutil.c:2637:6: error: implicit declaration of function 'pipe2' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (pipe2(fd, O_NONBLOCK|O_CLOEXEC) == 0) ^ ``` When targeting the NDK it should be safe to always opt into this. Clang would pass the right flag for us automatically _if_ the source was C++ instead of C. (cherry picked from commit 41c95abb9930b0c13c238e110b857acb810ad7b9)
Keith Smiley 3aa68a82 2019-07-02T10:47:47 Enable kqueue for APPLE targets The CMAKE_CROSSCOMPILING variable is not set for Apple targets seemingly because of cmake implementation details (more info https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING.html). Since Apple targets have working kqueue implementations this check makes sure we enable it always when those are the targets, without users having to explicitly set EVENT__HAVE_WORKING_KQUEUE (cherry picked from commit 0d7d85c2083f7a4c9efe01c061486f332b576d28)
Azat Khuzhin b75922ae 2019-07-01T23:54:02 Warn if forked from the event loop during event_reinit() Calling fork() from the event loop is not a great idea, since at least it shares some internal pipes (for handling signals) before event_reinit() call Closes: #833 (cherry picked from commit 497ef904d544ac51de43934549dbeccce8e6e8f8)
Azat Khuzhin 5349a07e 2019-06-26T09:36:49 autotools: do not install bufferevent_ssl.h under --disable-openssl Refs: https://github.com/libevent/libevent/issues/760#issuecomment-502345788 (cherry picked from commit 5388a002f5ad3bdfc756584dc58485fc3db135d0)
Azat Khuzhin c9ce638c 2019-06-26T01:27:20 cmake: link against shell32.lib/advapi32.lib Fixes: #844 Refs: #760 (cmake-vs-autotools) (cherry picked from commit 69466cde0382ab3df12e3a011720f87af3998081)
Azat Khuzhin 3660a4cc 2019-06-26T01:20:53 Add README.md into dist archive Fixes: #841 (cherry picked from commit 97488b2c28473b6be339e4c2325372d2425fe0aa, only the README.md part)
Azat Khuzhin 546a366c 2019-06-15T23:18:05 evdns: add new options -- so-rcvbuf/so-sndbuf This will allow to customize SO_RCVBUF/SO_SNDBUF for nameservers in this evdns_base, you may want to adjust them if the kernel starts dropping udp packages. (cherry picked from commit 538141eb7e590bc94c043b43b5e5483b13bc9c5e)
Azat Khuzhin a09265ac 2019-06-15T00:16:00 evutil: drop force_check from evutil_check_interfaces() (unused) (cherry picked from commit 4f6fc092b3ee0b996b50df3c0d22b356f0a9236c)
jeremyerb ef498aa2 2019-06-14T10:19:51 evutil: set the have_checked_interfaces in evutil_check_interfaces() Closes: #836 (cherry-picked) Fixes: #834 (cherry picked from commit 0de2b1455b348466e8e29704ba8760127cd63528)
yuangongji 2d65071c 2019-06-09T20:15:37 cmake: add missing autotools targets (doxygen, uninstall, event_rpcgen.py) Close: #832 (cherry-picked) (cherry picked from commit 7201062f3ef505a77baa6ccaf1cf73812462308a)
Fabrice Fontaine d4056e59 2019-06-08T23:44:37 m4/libevent_openssl.m4: fix detection of openssl Since commit 506df426dbeb0187bbd3654bd286b4100628fb16, OPENSSL_INCS is added to CPPFLAGS without any white space, as a result openssl detection fails on: configure:10395: checking openssl/ssl.h usability configure:10395: /home/fabrice/buildroot-test/buildroot/output/host/bin/riscv32-linux-gcc -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -Wall -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64-I/home/fabrice/buildroot-test/buildroot/output/host/bin/../riscv32-buildroot-linux-gnu/sysroot/usr/include conftest.c >&5 <command-line>:0:0: warning: "_FILE_OFFSET_BITS" redefined <command-line>:0:0: note: this is the location of the previous definition <command-line>:0:23: error: division by zero in #if Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> (cherry picked from commit 0374b55942e533a3c3997439481a8d05d6c8f729)
Azat Khuzhin 7fd7c5ef 2019-06-02T20:20:02 Fix detection of the __has_attribute() for apple clang [ci skip] Fixes build on the next osx env: - Mac OS 10.9/clang 600 - Mac OS 10.8/clang 500 Refs: https://github.com/libevent/libevent/issues/447#issuecomment-497908488 (cherry picked from commit 7d569b0fafe76e9036695ccc9d22d2195c214bce)
wenyg a8a04565 2019-05-30T17:38:49 https-client: correction error checking When connecting to a non-existent HTTPS service, the "req" is not null but the "evhttp_request_get_response_code(req)" is zero. Closes: #822 (cherry-picked) (cherry picked from commit 891dd1880fed8c5e1e98f122daeb1ae8414f6b1c)
yuangongji 483f8a29 2019-05-31T02:12:55 typo error in header file (cherry picked from commit c03dabd76aced01a9c8d253381c2ed6f3ad46b4f)
Tobias Stoeckmann 8c899768 2019-04-16T21:12:21 Protect min_heap_push_ against integer overflow. On 64 bit systems with a lot of memory it is possible to overflow the counter s->n (unsigned int) which keeps track of the amount of elements within the heap. On 32 bit systems with tightly packed memory layout (and adding the same pointer again and again) an integer overflow could occur if "a" reaches 2^30 because the multiplication with sizeof *p (4) would overflow, effectively freeing memory of s->p which eventually leads to a double free. No sign of issue for any sane setup and therefore a purely defensive measurement. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Refs: #799 (first version of the patch for backporting to 2.1.x only) See-also: 181049739478d57500bd564539f17407437bfe8f ("Revert "Protect min_heap_push_ against integer overflow."") (cherry picked from commit stoeckmann/libevent@47d348a63130c91f2a6aadef291ff5687275df72)
Azat Khuzhin 18104973 2019-07-31T11:25:47 Revert "Protect min_heap_push_ against integer overflow." This patch breaks the ABI compatibility, due to min_heap_idx expansion [1] And since major distros did not updated to 2.1.10 yet, this patch will be reverted: - debian: https://packages.debian.org/search?keywords=libevent-dev - ubuntu: https://packages.ubuntu.com/search?keywords=libevent-dev - fedora: https://apps.fedoraproject.org/packages/libevent-devel Also there is one that upgraded already: - archlinux: https://www.archlinux.org/packages/?q=libevent But archlinux is for developers, so it should be fine I guess. [1]: https://abi-laboratory.pro/index.php?view=objects_report&l=libevent&v1=2.1.9&v2=2.1.10 - struct event_base Change: Size of this type has been changed from 672 bytes to 664 bytes. Effect: The fields or parameters of such data type may be incorrectly initialized or accessed by old client applications. abi-compliance-checker diff with 2.1.9 before this patch: Binary compatibility: 69.2% Source compatibility: 100% Total binary compatibility problems: 1, warnings: 1 Total source compatibility problems: 0, warnings: 0 after: Binary compatibility: 100% Source compatibility: 100% Total binary compatibility problems: 0, warnings: 0 Total source compatibility problems: 0, warnings: 0 This reverts commit 0b46bb8cc9c0337b5fa0186d9cb031ff4f4ceb9a
Azat Khuzhin 047cd8a9 2019-05-26T00:27:56 Fix git command for the changes since 2.1.9-beta (copy-paste issue)