Log

Author Commit Date CI Message
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 e35e02e6 2019-10-08T21:38:58 sample/https-client: link crypt32 explicitly when build with mingw-w64 (cherry picked from commit 78b5bca6d83a70a0b9dfc438898d5c1908cc3c2a)
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)
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)
yuangongji a9d1121d 2019-10-25T21:54:13 cmake: eliminate duplicate installation of public headers (cherry picked from commit 5fe83d7433022e29a401753f64ec78faaf25e0a7)
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)
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 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)
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 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)
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)
Azat Khuzhin 64a25bcd 2019-05-26T00:14:14 Merge branch 'release-2.1.10-stable-pull' into patches-2.1 * release-2.1.10-stable-pull: Bump version to 2.1.10-stable everywhere Bump ChangeLog Bump AUTHORS section ... Tested on (cmake/autotools): - ubuntu - freebsd - osx - windows - netbsd - solaris - centos
Azat Khuzhin f5bfd721 2019-05-25T22:33:45 Bump version to 2.1.10-stable everywhere
Azat Khuzhin 1972c52d 2019-05-25T21:57:37 Bump ChangeLog
Azat Khuzhin e2790a7f 2019-05-25T23:41:38 http: do not name variable "sun" since this breaks solaris builds -bash-3.2$ /opt/csw/bin/gcc -xc /dev/null -dM -E | grep '#define sun' #define sun 1 (cherry picked from commit 1c573ab3a9037c560981ea325170ca6044c2dff6)
Azat Khuzhin 8a24ff20 2019-05-25T21:50:55 Bump AUTHORS section
Azat Khuzhin 3da21a94 2019-05-25T17:28:53 cmake: add -Wmissing-prototypes (like autotools has) (cherry picked from commit 49a367e6cfb9b9bc8d1b04cbfb834ec3e0c1d84d)
Azat Khuzhin faa4e373 2019-05-21T10:59:05 time-test: disable buffering (mostly for windows) (cherry picked from commit 4c774b6ceb94d7c40c459e39c82ae7eb782823f8)
Azat Khuzhin 2fea04b3 2019-05-16T10:25:50 Merge branch 'evbuffer-fixes-806-v2' * evbuffer-fixes-806-v2: evbuffer: fix last_with_datap after prepend with empty chain test: regression for evbuffer_expand_fast_() with invalid last_with_datap test: cover adjusting of last_with_datap in evbuffer_prepend() Fixes: #806 (cherry picked from commit 3b1864b625ec37c3051512845982f347f4cc5621)
Azat Khuzhin 7042ff24 2019-05-15T21:29:03 Add getopt into dist archive Fixes: #815 (cherry picked from commit c8b403a81bda3a9603ffda9c393a823719fda196)
Azat Khuzhin 7c4da937 2019-05-12T19:06:43 Merge branch 'issue-807-accept4-getnameinfo-AF_UNIX' * issue-807-accept4-getnameinfo-AF_UNIX: http-server: add usage/help dialog http: avoid use of uninitialized value for AF_UNIX/AF_LOCAL sockaddr http-server: add ability to bind to unix-socket build: struct sockaddr_un detection (sys/un.h, afunix.h) Fixes: #807 (cherry picked from commit 76eded24d3b0c3fc48c5a888906cc9043223101b)
Tobias Stoeckmann e70e18e9 2019-05-10T23:54:14 kqueue: Avoid undefined behaviour. As ploxiln pointed out in pull request 811 the check "newsize < 0" is undefined behaviour (signed int overflow). Follow the advice and check kqop->changes_size instead. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Closes: #813 (cherry-picked) (cherry picked from commit 2707a4ffabe539999f37a0364f7b0ef44a90589a)
Tobias Stoeckmann 43a55a23 2019-05-07T20:53:17 Prevent integer overflow in kq_build_changes_list. On amd64 systems with kqueue (e.g. *BSD systems) an integer overflow could be triggered with an excessively huge amount of events. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> (cherry picked from commit cf8acae36a580935c42228f3d30f3e96c8a3ef59)
zhuizhuhaomeng 54103883 2019-05-06T11:37:02 evdns: fix lock/unlock mismatch in evdns_close_server_port() Closes: #809 (cherry-picked) (cherry picked from commit 8701d0d3d2519800f46ab031a0b0d887b6eb1359)
Azat Khuzhin 87fa93a8 2019-04-30T08:43:27 Merge remote-tracking branch 'official/pr/804' * official/pr/804: Added test for evmap slot validations. Prevent endless loop in evmap_make_space. Enforce limit of NSIG signals. (cherry picked from commit c6becb26cad8dab2668fe3d913e5ee757bade2fd)
Tobias Stoeckmann 0b46bb8c 2019-04-16T21:12:21 Protect min_heap_push_ against integer overflow. Converting unsigned to size_t for size of memory objects allows proper handling of very large heaps on 64 bit systems. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Closes: #799 (cherry-picked) (cherry picked from commit 176fd5665512db95b1cf38fc647a7c706d80c14d)
linxiaohui 2a1e1530 2019-04-18T17:10:33 le-proxy: initiate use of the Winsock DLL Closes: #803 (cherry-picked) (cherry picked from commit 16d8564a2cd2ec665b577f39eea6583d4b651e92)
Azat Khuzhin d83a517c 2019-04-04T09:09:09 Remove experimental note for finalizers API (cherry picked from commit 55f9863b18fe21ddd220d98941b7ac777593dde5)
Azat Khuzhin c0adad8f 2019-04-03T23:22:54 https-client: do not try to free not initialized base Otherwise: $ https-client --help Syntax: https-client -url <https-url> [-data data-file.bin] [-ignore-cert] [-retries num] [-timeout sec] [-crt crt] Example: https-client -url https://ip.appspot.com/ [warn] event_base_free_: no base to free (cherry picked from commit 428f36e5dd8f2a45ea5795fb9f35dd27a776e3a8)
Azat Khuzhin 51853472 2019-04-03T23:20:06 http: drop unused internal macros (cherry picked from commit 35caeff5deacd5e081a4e6220b9226b61e24208d)
Azat Khuzhin 89932001 2019-04-03T07:26:21 Disable logging for tests that assume printing warnings To avoid possible confusion But there is still one test that has some messages on windows: main/methods Because this test needs >1 of avaiable methods, otherwise it will warn. (cherry picked from commit 47d348a63130c91f2a6aadef291ff5687275df72)
Azat Khuzhin 17eee0e4 2019-04-02T23:25:08 appveyor: check intermediate powershell commands exit codes and terminate early Otherwise build errors will be ignored, i.e. if build fails but regress binary exists (copied from artifacts) it will be runned instead of newly compiled. (cherry picked from commit 93a925474d22b94e5ad75a48656033e55efe9055)
Azat Khuzhin c010069b 2019-04-01T02:42:55 Merge branch 'fix-uchex-warnings' There is one more report that is false positive, see [1]: "In bufferevent_openssl.c, pointer wm is dereferenced on line 871 before it is null checked on line 873." [1]: https://github.com/libevent/libevent/issues/382#issuecomment-238081938 * fix-uchex-warnings: evdns: do not check server_req twice evrpc: do not check req twice Fixes: #382 (cherry picked from commit da33f768e451f1b5722b7426e03c87e260ee43d0)
Azat Khuzhin 58e81106 2019-04-01T01:47:00 evdns: add DNS_OPTION_NAMESERVERS_NO_DEFAULT/EVDNS_BASE_NAMESERVERS_NO_DEFAULT - 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) Fixes: #569 (cherry picked from commit e5b8f4c1925867d8e4cd7dc0390e5141d7ef1106)
Azat Khuzhin aa5a65d1 2019-04-01T01:40:18 evdns: add descriptions for DNS_OPTION_*/DNS_OPTIONS_ALL (cherry picked from commit 3e0dc1a6ab4b7024b93dc44c1bb79df0ef637fc0)
Azat Khuzhin 22380996 2019-03-25T01:40:46 Link test/regress with event_core/event_extra over event Due to regress linked with event and event_core (both of them includes evthread.c) there will be two different evthread_id_fn_ variables under mingw64: evthread_id_fn_: &0x5294f20a8 evthread_id_fn_: &0x4ba0030a8 And because of this evthread_use_pthreads() can/will set one copy of variables while evthread*() functions will access another, which will break a lot of things (for example main/del_notify test). Fixes: #792 (cherry picked from commit 2ae875ed1216a8896d8af0414cb4efbcb907bae5)
Azat Khuzhin d89045a6 2019-03-25T01:41:09 signal: guard __cdecl definition with #ifdef Under mingw64: ../signal.c:88:0: warning: "__cdecl" redefined #define __cdecl <built-in>: note: this is the location of the previous definition https://ci.appveyor.com/project/azat/libevent/builds/23321613#L427 (cherry picked from commit b8e2f01690c07f7b6eb29d097b30c1640fc9612e)
Azat Khuzhin 75d7e1ff 2019-03-24T20:36:16 tinytest: fix parsing --timeout argument Fixes: 15b2f41d ("tinytest: implement per-test timeout (via alarm() under !win32 only)") (cherry picked from commit 8a674243b444da9e0742ac837334aaf38e6a703a)
Azat Khuzhin b64dbfb6 2019-03-24T16:44:56 tinytest: implement per-test timeout (via alarm() under !win32 only) (cherry picked from commit 15b2f41d748643393b9f95b790d32e6bbbf38062)
Azat Khuzhin bb0f8fe7 2019-03-16T17:28:31 Fix leaks in error path of the bufferevent_init_common_() (cherry picked from commit 6995b9a864c16bcb84ea0f7a2cf856143020316b)
Azat Khuzhin b6724b60 2019-03-16T16:52:05 bench: suppress int conversion warnings (cherry picked from commit efcc18442b338d931f6dfe71d5ebaff3c6fa2b03)
Azat Khuzhin 7c669cc7 2019-03-16T16:37:38 Suppress int conversion warnings in getopt_long compatibility (cherry picked from commit 61e4a651d7054d41c8669c2a5340679b64f6ecf6)
Azat Khuzhin b062bf0a 2019-03-13T00:02:39 cmake: sync warnings with autotools v2 By some reason gcc reports next error: ../http.c:3330:11: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] value = ""; Only under -Wwrite-strings, well this is logical, but this information does not reflected in any documentation. Follow-up: 8348b413 ("cmake: add various warning flags like autotools has") f (cherry picked from commit 42d5a36bd8076c137545759d34500401627a649b)
John Ohl 3f893f0a 2014-12-09T21:43:18 Add support for EV_TIMEOUT to event_base_active_by_fd Closes: #194 (cherry-pick) (cherry picked from commit 62df1301ca943011fa9c398323049bcddca2694d)
Azat Khuzhin 61fa7b7d 2019-03-03T19:03:29 buffer: make evbuffer_prepend() of zero-length array no-op Refs: #774 (cherry picked from commit c4fbae3ae6166dddfa126734edd63213afa14dce)
Azat Khuzhin 6a3dd717 2019-03-03T18:58:57 Merge branch 'evbuffer-empty-chain-handling' * evbuffer-empty-chain-handling: buffer: do not rely on ->off in advance_last_with_data() buffer: fix evbuffer_remove_buffer() with empty chain in front test: verify content of the buffer in evbuffer/remove_buffer_with_empty* (cherry picked from commit b69524c004fb68bcd9475e7aa61f5a7cdb45d304)
Seong-Joong Kim 6602a97d 2019-02-21T16:19:10 Remove needless check for arc4_seeded_ok (cherry picked from commit 16a151df5c59c0539d06465172742cc50751ea77)
Enji Cooper 5e39750d 2019-02-28T17:47:51 Fix typos: warnigns -> warnings Signed-off-by: Enji Cooper <yaneurabeya@gmail.com> (cherry picked from commit 91dad75f7d04c2bef05bdd1dca7c29340ce33900)
Enji Cooper c5cf4a5c 2019-02-28T17:22:30 Fix typos in a comment describing the purpose of `VersionViaGit.cmake` Signed-off-by: Enji Cooper <yaneurabeya@gmail.com> (cherry picked from commit 0b468bb07e3476d06907ca6c8e5c24bbb05e31a4)
Enji Cooper 00ba9fa2 2019-02-25T11:59:15 Define `_GNU_SOURCE` properly/consistently per autoconf Although `_GNU_SOURCE` can be defined as an arbitrary #define per the glibc docs [1], it's best to define it in a manner consistent with the way that autoconf defines it, i.e., `1`. While this shouldn't matter in most cases, it does when the headers from other projects follow the poorly defined GNU convention implemented by autoconf and are included after the libevent's util.h header. An example failure with clang, similar to the failure I encountered, is as follows: ``` $ printf "#define _GNU_SOURCE\n#define _GNU_SOURCE 1" | clang -c -x c - <stdin>:2:9: warning: '_GNU_SOURCE' macro redefined [-Wmacro-redefined] ^ <stdin>:1:9: note: previous definition is here ^ 1 warning generated. ``` This happened when compiling python [2] with a stale homebrew util.h file from libevent (which admittedly would not happen in a correct libevent install, as the header should be installed under /usr/local/include/event2/util.h). However, if both headers had been combined (which is more likely), it would have failed as shown above. Removing the ad hoc definition unbreaks compiling python's pyconfig.h.in header when included after util.h from libevent. 1. http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html 2. https://github.com/python/cpython/blob/master/configure.ac#L126 Closes: #773 (cherry-picked) Signed-off-by: Enji Cooper <yaneurabeya@gmail.com> (cherry picked from commit 5f87be42f0ae0126938624a1419a572607078217)
Yury Korzhetsky 3d1a7a1d 2019-02-26T12:33:49 Don't loose top error in SSL Closes: #775 (cherry-picked) (cherry picked from commit a30d6d85219ea80c16df6da4f6a9430254e5a0da)
Azat Khuzhin ca76ebb0 2019-02-25T00:26:39 Ignore bitrise branches for travis-ci/appvyeor [ci skip] (cherry picked from commit b34192bae6f511b91a2fc01409676b2df2fd8a31)