From 483f8a2970a5bdb7e0393787b2d5d841fd2635ae Mon Sep 17 00:00:00 2001 From: yuangongji <82787816@qq.com> Date: Fri, 31 May 2019 02:12:55 +0800 Subject: [PATCH 01/22] typo error in header file (cherry picked from commit c03dabd76aced01a9c8d253381c2ed6f3ad46b4f) --- include/event2/bufferevent.h | 8 ++++---- include/event2/event.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/event2/bufferevent.h b/include/event2/bufferevent.h index dac34dc7..48cd1535 100644 --- a/include/event2/bufferevent.h +++ b/include/event2/bufferevent.h @@ -491,7 +491,7 @@ short bufferevent_get_enabled(struct bufferevent *bufev); (In other words, if reading or writing is disabled, or if the bufferevent's read or write operation has been suspended because - there's no data to write, or not enough banwidth, or so on, the + there's no data to write, or not enough bandwidth, or so on, the timeout isn't active. The timeout only becomes active when we we're willing to actually read or write.) @@ -569,7 +569,7 @@ void bufferevent_unlock(struct bufferevent *bufev); /** * Public interface to manually increase the reference count of a bufferevent * this is useful in situations where a user may reference the bufferevent - * somewhere eles (unknown to libevent) + * somewhere else (unknown to libevent) * * @param bufev the bufferevent to increase the refcount on * @@ -802,7 +802,7 @@ void ev_token_bucket_cfg_free(struct ev_token_bucket_cfg *cfg); They are: socket-based bufferevents (normal and IOCP-based), and SSL-based bufferevents. - Return 0 on sucess, -1 on failure. + Return 0 on success, -1 on failure. */ EVENT2_EXPORT_SYMBOL int bufferevent_set_rate_limit(struct bufferevent *bev, @@ -853,7 +853,7 @@ int bufferevent_rate_limit_group_set_cfg( The default min-share is currently 64 bytes. - Returns 0 on success, -1 on faulre. + Returns 0 on success, -1 on failure. */ EVENT2_EXPORT_SYMBOL int bufferevent_rate_limit_group_set_min_share( diff --git a/include/event2/event.h b/include/event2/event.h index ff208517..a6b6144a 100644 --- a/include/event2/event.h +++ b/include/event2/event.h @@ -285,7 +285,7 @@ struct event * There are many options that can be used to alter the behavior and * implementation of an event_base. To avoid having to pass them all in a * complex many-argument constructor, we provide an abstract data type - * where you set up configation information before passing it to + * where you set up configuration information before passing it to * event_base_new_with_config(). * * @see event_config_new(), event_config_free(), event_base_new_with_config(), @@ -632,7 +632,7 @@ int event_config_set_num_cpus_hint(struct event_config *cfg, int cpus); /** * Record an interval and/or a number of callbacks after which the event base * should check for new events. By default, the event base will run as many - * events are as activated at the higest activated priority before checking + * events are as activated at the highest activated priority before checking * for new events. If you configure it by setting max_interval, it will check * the time after each callback, and not allow more than max_interval to * elapse before checking for new events. If you configure it by setting @@ -1321,7 +1321,7 @@ struct event *event_base_get_running_event(struct event_base *base); The event_initialized() function can be used to check if an event has been initialized. - Warning: This function is only useful for distinguishing a a zeroed-out + Warning: This function is only useful for distinguishing a zeroed-out piece of memory from an initialized event, it can easily be confused by uninitialized memory. Thus, it should ONLY be used to distinguish an initialized event from zero. From a8a04565b15548678c79eb67f0bfd63a188ff1fb Mon Sep 17 00:00:00 2001 From: wenyg <42307321+wenyg@users.noreply.github.com> Date: Thu, 30 May 2019 17:38:49 +0800 Subject: [PATCH 02/22] 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) --- sample/https-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample/https-client.c b/sample/https-client.c index 5869974f..58e449b1 100644 --- a/sample/https-client.c +++ b/sample/https-client.c @@ -53,7 +53,7 @@ http_request_done(struct evhttp_request *req, void *ctx) char buffer[256]; int nread; - if (req == NULL) { + if (!req || !evhttp_request_get_response_code(req)) { /* If req is NULL, it means an error occurred, but * sadly we are mostly left guessing what the error * might have been. We'll do our best... */ From 7fd7c5eff3ba25abc55cad3491a952cdbf879df8 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 2 Jun 2019 20:20:02 +0300 Subject: [PATCH 03/22] 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) --- util-internal.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/util-internal.h b/util-internal.h index b727bf1f..39576c71 100644 --- a/util-internal.h +++ b/util-internal.h @@ -52,16 +52,22 @@ extern "C" { /* __has_attribute() wrapper */ #ifdef __has_attribute -#define EVUTIL_HAS_ATTRIBUTE __has_attribute +# define EVUTIL_HAS_ATTRIBUTE __has_attribute #endif /** clang 3 __has_attribute misbehaves in some versions */ -#if defined(__clang__) && \ - __clang__ == 1 && __clang_major__ == 3 && \ - (__clang_minor__ >= 2 && __clang_minor__ <= 5) -#undef EVUTIL_HAS_ATTRIBUTE -#endif +#if defined(__clang__) && __clang__ == 1 +# if defined(__apple_build_version__) +# if __clang_major__ <= 6 +# undef EVUTIL_HAS_ATTRIBUTE +# endif +# else /* !__apple_build_version__ */ +# if __clang_major__ == 3 && __clang_minor__ >= 2 && __clang_minor__ <= 5 +# undef EVUTIL_HAS_ATTRIBUTE +# endif +# endif /* __apple_build_version__ */ +#endif /*\ defined(__clang__) && __clang__ == 1 */ #ifndef EVUTIL_HAS_ATTRIBUTE -#define EVUTIL_HAS_ATTRIBUTE(x) 0 +# define EVUTIL_HAS_ATTRIBUTE(x) 0 #endif /* If we need magic to say "inline", get it for free internally. */ From d4056e5995d5bbbd9bbdcb976f13f748ef0fbfca Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sat, 8 Jun 2019 23:44:37 +0200 Subject: [PATCH 04/22] 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 :0:0: warning: "_FILE_OFFSET_BITS" redefined :0:0: note: this is the location of the previous definition :0:23: error: division by zero in #if Signed-off-by: Fabrice Fontaine (cherry picked from commit 0374b55942e533a3c3997439481a8d05d6c8f729) --- m4/libevent_openssl.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/libevent_openssl.m4 b/m4/libevent_openssl.m4 index 7b458134..19811981 100644 --- a/m4/libevent_openssl.m4 +++ b/m4/libevent_openssl.m4 @@ -40,7 +40,7 @@ case "$enable_openssl" in ;; esac CPPFLAGS_SAVE=$CPPFLAGS - CPPFLAGS+=$OPENSSL_INCS + CPPFLAGS="$CPPFLAGS $OPENSSL_INCS" AC_CHECK_HEADERS([openssl/ssl.h], [], [have_openssl=no]) CPPFLAGS=$CPPFLAGS_SAVE AC_SUBST(OPENSSL_INCS) From 2d65071c3afe63a92d480cc71a3222d8ae9764de Mon Sep 17 00:00:00 2001 From: yuangongji <82787816@qq.com> Date: Sun, 9 Jun 2019 20:15:37 +0800 Subject: [PATCH 05/22] cmake: add missing autotools targets (doxygen, uninstall, event_rpcgen.py) Close: #832 (cherry-picked) (cherry picked from commit 7201062f3ef505a77baa6ccaf1cf73812462308a) --- .gitignore | 2 ++ CMakeLists.txt | 27 +++++++++++++++++++++++++++ cmake/Uninstall.cmake.in | 23 +++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 cmake/Uninstall.cmake.in diff --git a/.gitignore b/.gitignore index 4af03587..955846cd 100644 --- a/.gitignore +++ b/.gitignore @@ -129,6 +129,7 @@ LibeventConfigVersion.cmake LibeventTargets.cmake bin/ cmake_install.cmake +Uninstall.cmake lib/ tmp/ verify_tests.sh @@ -139,6 +140,7 @@ event_extra.dir *.vcxproj *.sln *.filters +install_manifest.txt # ninja build.ninja diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e91c08d..9dfa4653 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1465,6 +1465,33 @@ install(EXPORT LibeventTargets DESTINATION "${DEF_INSTALL_CMAKE_DIR}" COMPONENT dev) +# Install the scripts. +install(PROGRAMS + ${CMAKE_CURRENT_SOURCE_DIR}/event_rpcgen.py + DESTINATION "bin" + COMPONENT runtime) + +# Create documents with doxygen. +find_program(DOXYGEN doxygen) +if (DOXYGEN) + add_custom_target(doxygen + COMMAND ${DOXYGEN} Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +else() + message(WARNING "The doxygen target will not support since doxygen command was not found!") +endif() + + +# Create the uninstall target. +# https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake +configure_file(${PROJECT_SOURCE_DIR}/cmake/Uninstall.cmake.in + ${PROJECT_BINARY_DIR}/Uninstall.cmake + @ONLY) + +add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/Uninstall.cmake) + + message(STATUS "") message(STATUS " ---( Libevent " ${EVENT_VERSION} " )---") message(STATUS "") diff --git a/cmake/Uninstall.cmake.in b/cmake/Uninstall.cmake.in new file mode 100644 index 00000000..c6dc09ef --- /dev/null +++ b/cmake/Uninstall.cmake.in @@ -0,0 +1,23 @@ +# https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake + +if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") +endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + +file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + endif(NOT "${rm_retval}" STREQUAL 0) + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") +endforeach(file) From ef498aa25d3c1131c12528fd203f2e2faaeaf1ce Mon Sep 17 00:00:00 2001 From: jeremyerb <33230155+jeremyerb@users.noreply.github.com> Date: Fri, 14 Jun 2019 10:19:51 -0400 Subject: [PATCH 06/22] evutil: set the have_checked_interfaces in evutil_check_interfaces() Closes: #836 (cherry-picked) Fixes: #834 (cherry picked from commit 0de2b1455b348466e8e29704ba8760127cd63528) --- evutil.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/evutil.c b/evutil.c index 402ab0d8..0ff7ba7c 100644 --- a/evutil.c +++ b/evutil.c @@ -761,6 +761,9 @@ evutil_check_interfaces(int force_recheck) if (have_checked_interfaces && !force_recheck) return 0; + /* From this point on we have done the ipv4/ipv6 interface check */ + have_checked_interfaces = 1; + if (evutil_check_ifaddrs() == 0) { /* Use a nice sane interface, if this system has one. */ return 0; @@ -1228,8 +1231,7 @@ evutil_adjust_hints_for_addrconfig_(struct evutil_addrinfo *hints) return; if (hints->ai_family != PF_UNSPEC) return; - if (!have_checked_interfaces) - evutil_check_interfaces(0); + evutil_check_interfaces(0); if (had_ipv4_address && !had_ipv6_address) { hints->ai_family = PF_INET; } else if (!had_ipv4_address && had_ipv6_address) { From a09265aca01990d4a4093e11ebd27d1f51ebd299 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sat, 15 Jun 2019 00:16:00 +0300 Subject: [PATCH 07/22] evutil: drop force_check from evutil_check_interfaces() (unused) (cherry picked from commit 4f6fc092b3ee0b996b50df3c0d22b356f0a9236c) --- evutil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evutil.c b/evutil.c index 0ff7ba7c..6088aba9 100644 --- a/evutil.c +++ b/evutil.c @@ -750,7 +750,7 @@ done: /* Test whether we have an ipv4 interface and an ipv6 interface. Return 0 if * the test seemed successful. */ static int -evutil_check_interfaces(int force_recheck) +evutil_check_interfaces(void) { evutil_socket_t fd = -1; struct sockaddr_in sin, sin_out; @@ -758,7 +758,7 @@ evutil_check_interfaces(int force_recheck) ev_socklen_t sin_out_len = sizeof(sin_out); ev_socklen_t sin6_out_len = sizeof(sin6_out); int r; - if (have_checked_interfaces && !force_recheck) + if (have_checked_interfaces) return 0; /* From this point on we have done the ipv4/ipv6 interface check */ @@ -1231,7 +1231,7 @@ evutil_adjust_hints_for_addrconfig_(struct evutil_addrinfo *hints) return; if (hints->ai_family != PF_UNSPEC) return; - evutil_check_interfaces(0); + evutil_check_interfaces(); if (had_ipv4_address && !had_ipv6_address) { hints->ai_family = PF_INET; } else if (!had_ipv4_address && had_ipv6_address) { From 546a366ca30bc7c75648ce357f625f534304b77e Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sat, 15 Jun 2019 23:18:05 +0300 Subject: [PATCH 08/22] 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) --- evdns.c | 30 ++++++++++++++++++++++++++++++ include/event2/dns.h | 3 ++- test/regress_dns.c | 23 +++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/evdns.c b/evdns.c index 1b815366..0a0e1ba6 100644 --- a/evdns.c +++ b/evdns.c @@ -346,6 +346,9 @@ struct evdns_base { struct timeval global_getaddrinfo_allow_skew; + int so_rcvbuf; + int so_sndbuf; + int getaddrinfo_ipv4_timeouts; int getaddrinfo_ipv6_timeouts; int getaddrinfo_ipv4_answered; @@ -2538,6 +2541,23 @@ evdns_nameserver_add_impl_(struct evdns_base *base, const struct sockaddr *addre } } + if (base->so_rcvbuf) { + if (setsockopt(ns->socket, SOL_SOCKET, SO_RCVBUF, + (void *)&base->so_rcvbuf, sizeof(base->so_rcvbuf))) { + log(EVDNS_LOG_WARN, "Couldn't set SO_RCVBUF to %i", base->so_rcvbuf); + err = -SO_RCVBUF; + goto out2; + } + } + if (base->so_sndbuf) { + if (setsockopt(ns->socket, SOL_SOCKET, SO_SNDBUF, + (void *)&base->so_sndbuf, sizeof(base->so_sndbuf))) { + log(EVDNS_LOG_WARN, "Couldn't set SO_SNDBUF to %i", base->so_sndbuf); + err = -SO_SNDBUF; + goto out2; + } + } + memcpy(&ns->address, address, addrlen); ns->addrlen = addrlen; ns->state = 1; @@ -3531,6 +3551,16 @@ evdns_base_set_option_impl(struct evdns_base *base, val); memcpy(&base->global_nameserver_probe_initial_timeout, &tv, sizeof(tv)); + } else if (str_matches_option(option, "so-rcvbuf:")) { + int buf = strtoint(val); + if (!(flags & DNS_OPTION_MISC)) return 0; + log(EVDNS_LOG_DEBUG, "Setting SO_RCVBUF to %s", val); + base->so_rcvbuf = buf; + } else if (str_matches_option(option, "so-sndbuf:")) { + int buf = strtoint(val); + if (!(flags & DNS_OPTION_MISC)) return 0; + log(EVDNS_LOG_DEBUG, "Setting SO_SNDBUF to %s", val); + base->so_sndbuf = buf; } return 0; } diff --git a/include/event2/dns.h b/include/event2/dns.h index 3c548a1e..13ce027e 100644 --- a/include/event2/dns.h +++ b/include/event2/dns.h @@ -455,7 +455,8 @@ void evdns_cancel_request(struct evdns_base *base, struct evdns_request *req); The currently available configuration options are: ndots, timeout, max-timeouts, max-inflight, attempts, randomize-case, - bind-to, initial-probe-timeout, getaddrinfo-allow-skew. + bind-to, initial-probe-timeout, getaddrinfo-allow-skew, + so-rcvbuf, so-sndbuf. In versions before Libevent 2.0.3-alpha, the option name needed to end with a colon. diff --git a/test/regress_dns.c b/test/regress_dns.c index 76b0b86a..d2084b70 100644 --- a/test/regress_dns.c +++ b/test/regress_dns.c @@ -2352,6 +2352,26 @@ end: } #endif +static void +test_set_so_rcvbuf_so_sndbuf(void *arg) +{ + struct basic_test_data *data = arg; + struct evdns_base *dns_base; + + dns_base = evdns_base_new(data->base, 0); + tt_assert(dns_base); + + tt_assert(!evdns_base_set_option(dns_base, "so-rcvbuf", "10240")); + tt_assert(!evdns_base_set_option(dns_base, "so-sndbuf", "10240")); + + /* actually check SO_RCVBUF/SO_SNDBUF not fails */ + tt_assert(!evdns_base_nameserver_ip_add(dns_base, "127.0.0.1")); + +end: + if (dns_base) + evdns_base_free(dns_base, 0); +} + #define DNS_LEGACY(name, flags) \ { #name, run_legacy_test_fn, flags|TT_LEGACY, &legacy_setup, \ dns_##name } @@ -2421,6 +2441,9 @@ struct testcase_t dns_testcases[] = { TT_FORK|TT_OFF_BY_DEFAULT, NULL, NULL }, #endif + { "set_SO_RCVBUF_SO_SNDBUF", test_set_so_rcvbuf_so_sndbuf, + TT_FORK|TT_NEED_BASE, &basic_setup, NULL }, + END_OF_TESTCASES }; From 3660a4cc231772356ba351aaf9d3b32161f75ce4 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 26 Jun 2019 01:20:53 +0300 Subject: [PATCH 09/22] Add README.md into dist archive Fixes: #841 (cherry picked from commit 97488b2c28473b6be339e4c2325372d2425fe0aa, only the README.md part) --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index 240d0146..ce21284b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -142,6 +142,7 @@ EXTRA_DIST = \ make-event-config.sed \ whatsnew-2.0.txt \ whatsnew-2.1.txt \ + README.md \ $(CMAKE_FILES) \ $(PLATFORM_DEPENDENT_SRC) From c9ce638c848a3e791fda91fa1f4a8b736bfa8fdd Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 26 Jun 2019 01:27:20 +0300 Subject: [PATCH 10/22] cmake: link against shell32.lib/advapi32.lib Fixes: #844 Refs: #760 (cmake-vs-autotools) (cherry picked from commit 69466cde0382ab3df12e3a011720f87af3998081) --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9dfa4653..1762c2f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,7 +322,7 @@ endif() # Winsock. if(WIN32) set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h ws2tcpip.h) - set(CMAKE_REQUIRED_LIBRARIES ws2_32.lib) + set(CMAKE_REQUIRED_LIBRARIES ws2_32.lib shell32.lib advapi32.lib) set(CMAKE_REQUIRED_DEFINITIONS -FIwinsock2.h -FIws2tcpip.h) endif() if (SOLARIS) @@ -873,7 +873,7 @@ if(WIN32) list(APPEND HDR_PRIVATE WIN32-Code/getopt.h) set(EVENT__DNS_USE_FTIME_FOR_ID 1) - set(LIB_PLATFORM ws2_32) + set(LIB_PLATFORM ws2_32 shell32 advapi32) add_definitions( -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) From 5349a07ea73b3f6e89107130f92db0920b606269 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 26 Jun 2019 09:36:49 +0300 Subject: [PATCH 11/22] 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) --- include/include.am | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/include.am b/include/include.am index 9aad2dba..aaa2042a 100644 --- a/include/include.am +++ b/include/include.am @@ -1,4 +1,4 @@ -# include/Makefile.am for libevent +# include/include.am for libevent # Copyright 2000-2007 Niels Provos # Copyright 2007-2012 Niels Provos and Nick Mathewson # @@ -11,7 +11,6 @@ EVENT2_EXPORT = \ include/event2/buffer_compat.h \ include/event2/bufferevent.h \ include/event2/bufferevent_compat.h \ - include/event2/bufferevent_ssl.h \ include/event2/bufferevent_struct.h \ include/event2/dns.h \ include/event2/dns_compat.h \ @@ -33,6 +32,10 @@ EVENT2_EXPORT = \ include/event2/util.h \ include/event2/visibility.h +if OPENSSL +EVENT2_EXPORT += include/event2/bufferevent_ssl.h +endif + ## Without the nobase_ prefixing, Automake would strip "include/event2/" from ## the source header filename to derive the installed header filename. ## With nobase_ the installed path is $(includedir)/include/event2/ev*.h. From b75922ae5b6d7bea6ef2f53618dca6c5760c71b4 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 1 Jul 2019 23:54:02 +0300 Subject: [PATCH 12/22] 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) --- event.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/event.c b/event.c index bfd94ebd..b2ad3410 100644 --- a/event.c +++ b/event.c @@ -987,6 +987,12 @@ event_reinit(struct event_base *base) EVBASE_ACQUIRE_LOCK(base, th_base_lock); + if (base->running_loop) { + event_warnx("%s: forked from the event_loop.", __func__); + res = -1; + goto done; + } + evsel = base->evsel; /* check if this event mechanism requires reinit on the backend */ From 3aa68a82dcbbea5110e1f4b4b8addfa8df18eace Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 2 Jul 2019 10:47:47 -0700 Subject: [PATCH 13/22] 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) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1762c2f7..70948f1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -626,7 +626,7 @@ CHECK_TYPE_SIZE("time_t" EVENT__SIZEOF_TIME_T) # Verify kqueue works with pipes. if (EVENT__HAVE_KQUEUE) - if (CMAKE_CROSSCOMPILING AND NOT EVENT__FORCE_KQUEUE_CHECK) + if ((CMAKE_CROSSCOMPILING OR APPLE) AND NOT EVENT__FORCE_KQUEUE_CHECK) message(WARNING "Cannot check if kqueue works with pipes when crosscompiling, use EVENT__FORCE_KQUEUE_CHECK to be sure (this requires manually running a test program on the cross compilation target)") set(EVENT__HAVE_WORKING_KQUEUE 1) else() From f013fc7dde1414bed936b9e1752686863d4f3025 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 8 Jul 2019 14:06:55 -0700 Subject: [PATCH 14/22] 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) --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70948f1b..d4a67391 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -337,6 +337,10 @@ if (NOT DEFINED _GNU_SOURCE) unset(_GNU_SOURCE CACHE) CHECK_SYMBOL_EXISTS(_GNU_SOURCE "features.h" _GNU_SOURCE) endif() + + if (ANDROID) + set(_GNU_SOURCE TRUE) + endif() endif() if (_GNU_SOURCE) From 305251b9cec99ec5f4c05a9739bad9c5349f4722 Mon Sep 17 00:00:00 2001 From: yuangongji <82787816@qq.com> Date: Wed, 10 Jul 2019 00:30:12 +0800 Subject: [PATCH 15/22] 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) --- CMakeLists.txt | 7 +++++ cmake/AddEventLibrary.cmake | 56 +++++++++++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4a67391..b1395443 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,13 @@ set(EVENT_PACKAGE_VERSION "${EVENT_VERSION_MAJOR}.${EVENT_VERSION_MINOR}.${EVENT_VERSION_PATCH}") set(EVENT_NUMERIC_VERSION 0x02010a00) +# equals to VERSION_INFO in Makefile.am +set(EVENT_ABI_LIBVERSION_CURRENT 6) +set(EVENT_ABI_LIBVERSION_REVISION 4) +set(EVENT_ABI_LIBVERSION_AGE 0) + +# equals to RELEASE in Makefile.am +set(EVENT_PACKAGE_RELEASE 2.1) # only a subset of names can be used, defaults to "beta" set(EVENT_STAGE_NAME ${EVENT_VERSION_STAGE}) diff --git a/cmake/AddEventLibrary.cmake b/cmake/AddEventLibrary.cmake index 9de4484c..12a36831 100644 --- a/cmake/AddEventLibrary.cmake +++ b/cmake/AddEventLibrary.cmake @@ -38,6 +38,10 @@ endmacro() # Global variables that it uses: # - EVENT_ABI_LIBVERSION +# - EVENT_ABI_LIBVERSION_CURRENT +# - EVENT_ABI_LIBVERSION_REVISION +# - EVENT_ABI_LIBVERSION_AGE +# - EVENT_PACKAGE_RELEASE # - CMAKE_THREAD_LIBS_INIT LIB_PLATFORM # - OPENSSL_LIBRARIES # - HDR_PUBLIC @@ -87,16 +91,44 @@ macro(add_event_library LIB_NAME) set_event_shared_lib_flags("${LIB_NAME}" "${EVENT_SHARED_FLAGS}") endif() - set_target_properties("${LIB_NAME}_shared" PROPERTIES - OUTPUT_NAME "${LIB_NAME}" + if (WIN32) + set_target_properties( + "${LIB_NAME}_shared" PROPERTIES + OUTPUT_NAME "${LIB_NAME}" + SOVERSION ${EVENT_ABI_LIBVERSION}) + elseif (APPLE) + math(EXPR COMPATIBILITY_VERSION "${EVENT_ABI_LIBVERSION_CURRENT}+1") + math(EXPR CURRENT_MINUS_AGE "${EVENT_ABI_LIBVERSION_CURRENT}-${EVENT_ABI_LIBVERSION_AGE}") + set_target_properties( + "${LIB_NAME}_shared" PROPERTIES + OUTPUT_NAME "${LIB_NAME}-${EVENT_PACKAGE_RELEASE}.${CURRENT_MINUS_AGE}" + INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" + LINK_FLAGS "-compatibility_version ${COMPATIBILITY_VERSION} -current_version ${COMPATIBILITY_VERSION}.${EVENT_ABI_LIBVERSION_REVISION}") + else() + math(EXPR CURRENT_MINUS_AGE "${EVENT_ABI_LIBVERSION_CURRENT}-${EVENT_ABI_LIBVERSION_AGE}") + set_target_properties( + "${LIB_NAME}_shared" PROPERTIES + OUTPUT_NAME "${LIB_NAME}-${EVENT_PACKAGE_RELEASE}" + VERSION "${CURRENT_MINUS_AGE}.${EVENT_ABI_LIBVERSION_AGE}.${EVENT_ABI_LIBVERSION_REVISION}" + SOVERSION "${CURRENT_MINUS_AGE}") + endif() + + set_target_properties( + "${LIB_NAME}_shared" PROPERTIES + PUBLIC_HEADER "${HDR_PUBLIC}" CLEAN_DIRECT_OUTPUT 1) - set_target_properties( - "${LIB_NAME}_shared" PROPERTIES - PUBLIC_HEADER "${HDR_PUBLIC}") - set_target_properties( - "${LIB_NAME}_shared" PROPERTIES - SOVERSION ${EVENT_ABI_LIBVERSION} - ) + + if (NOT WIN32) + set(LIB_LINK_NAME + "${CMAKE_SHARED_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}") + + add_custom_command(TARGET ${LIB_NAME}_shared + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E create_symlink + "$" + "${LIB_LINK_NAME}" + WORKING_DIRECTORY "lib") + endif() list(APPEND LIBEVENT_SHARED_LIBRARIES "${LIB_NAME}_shared") list(APPEND ADD_EVENT_LIBRARY_TARGETS "${LIB_NAME}_shared") @@ -117,6 +149,12 @@ macro(add_event_library LIB_NAME) PUBLIC_HEADER DESTINATION "include/event2" COMPONENT dev ) + if (NOT WIN32) + install(FILES + "$/${LIB_LINK_NAME}" + DESTINATION "lib" + COMPONENT lib) + endif() add_library(${LIB_NAME} INTERFACE) target_link_libraries(${LIB_NAME} INTERFACE ${ADD_EVENT_LIBRARY_INTERFACE}) From 9559349cbc0bcb39e31333bc7913feddd79d8eae Mon Sep 17 00:00:00 2001 From: yuangongji <82787816@qq.com> Date: Wed, 3 Jul 2019 00:27:22 +0800 Subject: [PATCH 16/22] Missing on win7/MinGW(MINGW32_NT-6.1)/MSYS (cherry picked from commit 7806f3ec78368d69bfcf53cdffcdb424a528a113) --- arc4random.c | 1 + buffer_iocp.c | 1 + bufferevent_async.c | 1 + evdns.c | 1 + evutil.c | 1 + listener.c | 1 + 6 files changed, 6 insertions(+) diff --git a/arc4random.c b/arc4random.c index 02fd7447..be64452b 100644 --- a/arc4random.c +++ b/arc4random.c @@ -54,6 +54,7 @@ #ifdef _WIN32 #include #include +#include #else #include #include diff --git a/buffer_iocp.c b/buffer_iocp.c index 2d76a90e..2af0c49c 100644 --- a/buffer_iocp.c +++ b/buffer_iocp.c @@ -44,6 +44,7 @@ #include "mm-internal.h" #include +#include #include #include diff --git a/bufferevent_async.c b/bufferevent_async.c index 141cf34f..40c7c5e8 100644 --- a/bufferevent_async.c +++ b/bufferevent_async.c @@ -46,6 +46,7 @@ #ifdef _WIN32 #include +#include #include #endif diff --git a/evdns.c b/evdns.c index 0a0e1ba6..de3848ad 100644 --- a/evdns.c +++ b/evdns.c @@ -77,6 +77,7 @@ #include #ifdef _WIN32 #include +#include #include #ifndef _WIN32_IE #define _WIN32_IE 0x400 diff --git a/evutil.c b/evutil.c index 6088aba9..3412c2ae 100644 --- a/evutil.c +++ b/evutil.c @@ -29,6 +29,7 @@ #ifdef _WIN32 #include +#include #include #define WIN32_LEAN_AND_MEAN #include diff --git a/listener.c b/listener.c index 387a89e9..f5c00c9c 100644 --- a/listener.c +++ b/listener.c @@ -35,6 +35,7 @@ #define _WIN32_WINNT 0x0403 #endif #include +#include #include #include #endif From 596855f7af6dc1b6e3432e0188897ac581269821 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Fri, 12 Jul 2019 00:00:12 +0300 Subject: [PATCH 17/22] cmake: install shared library only if it was requested $ cmake -DEVENT__LIBRARY_TYPE=static .. ... CMake Error: Error evaluating generator expression: $ 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) --- cmake/AddEventLibrary.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/AddEventLibrary.cmake b/cmake/AddEventLibrary.cmake index 12a36831..352c86ba 100644 --- a/cmake/AddEventLibrary.cmake +++ b/cmake/AddEventLibrary.cmake @@ -149,7 +149,7 @@ macro(add_event_library LIB_NAME) PUBLIC_HEADER DESTINATION "include/event2" COMPONENT dev ) - if (NOT WIN32) + if (NOT WIN32 AND ${EVENT_LIBRARY_SHARED}) install(FILES "$/${LIB_LINK_NAME}" DESTINATION "lib" From 2a3330081a09f7b4f6e9f4349ac8eac6bc385926 Mon Sep 17 00:00:00 2001 From: yuangongji <82787816@qq.com> Date: Sat, 27 Jul 2019 22:41:39 +0800 Subject: [PATCH 18/22] 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) --- Makefile.am | 4 ++-- configure.ac | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index ce21284b..53497bf0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,8 +5,8 @@ # See LICENSE for copying information. # 'foreign' means that we're not enforcing GNU package rules strictly. -# '1.9' means that we need automake 1.9 or later (and we do). -AUTOMAKE_OPTIONS = foreign 1.9 subdir-objects +# '1.11.2' means that we need automake 1.11.2 or later (and we do). +AUTOMAKE_OPTIONS = foreign 1.11.2 subdir-objects ACLOCAL_AMFLAGS = -I m4 diff --git a/configure.ac b/configure.ac index e6440341..3dc437fd 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ dnl dnl Original version Dug Song AC_INIT(libevent,2.1.10-stable) -AC_PREREQ(2.59) +AC_PREREQ(2.62) AC_CONFIG_SRCDIR(event.c) AC_CONFIG_MACRO_DIR([m4]) From 598f247d98fb4bf8376b413c7601b23c62196646 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 31 Jul 2019 10:34:38 +0300 Subject: [PATCH 19/22] 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) --- buffer.c | 7 ++++++- include/event2/buffer_compat.h | 3 ++- test/regress_buffer.c | 12 ++++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/buffer.c b/buffer.c index 5e3d91b5..a51b6c5f 100644 --- a/buffer.c +++ b/buffer.c @@ -3304,7 +3304,7 @@ evbuffer_add_file(struct evbuffer *buf, int fd, ev_off_t offset, ev_off_t length return r; } -void +int evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg) { EVBUFFER_LOCK(buffer); @@ -3315,10 +3315,15 @@ evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg) if (cb) { struct evbuffer_cb_entry *ent = evbuffer_add_cb(buffer, NULL, cbarg); + if (!ent) { + EVBUFFER_UNLOCK(buffer); + return -1; + } ent->cb.cb_obsolete = cb; ent->flags |= EVBUFFER_CB_OBSOLETE; } EVBUFFER_UNLOCK(buffer); + return 0; } struct evbuffer_cb_entry * diff --git a/include/event2/buffer_compat.h b/include/event2/buffer_compat.h index 24f828c2..0ce10254 100644 --- a/include/event2/buffer_compat.h +++ b/include/event2/buffer_compat.h @@ -90,9 +90,10 @@ typedef void (*evbuffer_cb)(struct evbuffer *buffer, size_t old_len, size_t new_ @param cb the callback function to invoke when the evbuffer is modified, or NULL to remove all callbacks. @param cbarg an argument to be provided to the callback function + @return 0 if successful, or -1 on error */ EVENT2_EXPORT_SYMBOL -void evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg); +int evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg); /** diff --git a/test/regress_buffer.c b/test/regress_buffer.c index 02d557b6..8ac4b6e0 100644 --- a/test/regress_buffer.c +++ b/test/regress_buffer.c @@ -1956,12 +1956,12 @@ test_evbuffer_callbacks(void *ptr) tt_assert(cb1 != NULL); cb2 = evbuffer_add_cb(buf, log_change_callback, buf_out2); tt_assert(cb2 != NULL); - evbuffer_setcb(buf, self_draining_callback, NULL); + tt_int_op(evbuffer_setcb(buf, self_draining_callback, NULL), ==, 0); evbuffer_add_printf(buf, "This should get drained right away."); tt_uint_op(evbuffer_get_length(buf), ==, 0); tt_uint_op(evbuffer_get_length(buf_out1), ==, 0); tt_uint_op(evbuffer_get_length(buf_out2), ==, 0); - evbuffer_setcb(buf, NULL, NULL); + tt_int_op(evbuffer_setcb(buf, NULL, NULL), ==, 0); evbuffer_add_printf(buf, "This will not."); tt_str_op((const char *) evbuffer_pullup(buf, -1), ==, "This will not."); evbuffer_validate(buf); @@ -1987,6 +1987,14 @@ test_evbuffer_callbacks(void *ptr) "0->15; 15->11; 11->0; "); #endif + /* the next call to readline should fail */ +#ifndef EVENT__DISABLE_MM_REPLACEMENT + event_set_mem_functions(failing_malloc, realloc, free); + tt_int_op(evbuffer_setcb(buf, self_draining_callback, NULL), ==, -1); + evbuffer_validate(buf); + event_set_mem_functions(malloc, realloc, free); +#endif + end: if (buf) evbuffer_free(buf); From b9c364e4ec09356af717d778bb1e69798ecf5c27 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Fri, 2 Aug 2019 00:12:11 +0300 Subject: [PATCH 20/22] Bump AUTHORS.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 2b6d7e4e..8be37f49 100644 --- a/README.md +++ b/README.md @@ -459,5 +459,11 @@ fixing bugs: * Yury Korzhetsky * zhuizhuhaomeng * Pierce Lopez + * yuangongji + * Keith Smiley + * jeremyerb + * Fabrice Fontaine + * wenyg + If we have forgotten your name, please contact us. From 70026169606f9883e7bcfa7523f962cf19145791 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Fri, 2 Aug 2019 00:20:30 +0300 Subject: [PATCH 21/22] Bump ChangeLog --- ChangeLog | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/ChangeLog b/ChangeLog index ef581f9a..e89d5a81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,49 @@ +Changes in version 2.1.11-stable (01 Aug 2019) + + This release contains one ABI breakage fix (that had been introduced in + 2.1.10, and strictly speaking this release breaks ABI again to make it + compatible with 2.1.9 and less, please take a look at 18104973 for more + details). Apart from that it contains some bug fixes, that grouped below. + + And even though the return value for evbuffer_setcb() had been changed it + should ABI compatible (anyway that function is in -compat.h header). + + There is also one patch that introduce new functionality, this is 546a366c, + to tune SO_RCVBUF/SO_SNDBUF in evdns, but one can count it as a bug-fix on + the application level, since before you cannot tune this settings and hence + you could stumble on problems. + + ABI breakage: + o Protect min_heap_push_ against integer overflow. (8c899768 Tobias Stoeckmann) + o Revert "Protect min_heap_push_ against integer overflow." (18104973 Azat Khuzhin) + + functionality: + o evdns: add new options -- so-rcvbuf/so-sndbuf (546a366c Azat Khuzhin) + + build: + o Change autoconf version to 2.62 and automake version to 1.11.2 (2a333008 yuangongji) + o cmake: install shared library only if it was requested (596855f7 Azat Khuzhin) + o Missing on win7/MinGW(MINGW32_NT-6.1)/MSYS (9559349c yuangongji) + o cmake: set library names to be the same as with autotools (305251b9 yuangongji) + o Enable _GNU_SOURCE for Android (f013fc7d Keith Smiley) + o Enable kqueue for APPLE targets (3aa68a82 Keith Smiley) + o autotools: do not install bufferevent_ssl.h under --disable-openssl (5349a07e Azat Khuzhin) + o cmake: link against shell32.lib/advapi32.lib (c9ce638c Azat Khuzhin) + o Add README.md into dist archive (3660a4cc Azat Khuzhin) + o cmake: add missing autotools targets (doxygen, uninstall, event_rpcgen.py) (2d65071c yuangongji) + o m4/libevent_openssl.m4: fix detection of openssl (d4056e59 Fabrice Fontaine) + o Fix detection of the __has_attribute() for apple clang [ci skip] (7fd7c5ef Azat Khuzhin) + + lib: + o buffer: fix possible NULL dereference in evbuffer_setcb() on ENOMEM (598f247d Azat Khuzhin) + o Warn if forked from the event loop during event_reinit() (b75922ae Azat Khuzhin) + o evutil: set the have_checked_interfaces in evutil_check_interfaces() + (ef498aa2, a09265ac jeremyerb) + + samples: + o https-client: correction error checking (a8a04565 wenyg) + + Changes in version 2.1.10-stable (26 May 2019) This release contains mostly fixes (some evbuffer oddity, AF_UNIX handling in From 5b723a66b42eb6ca90b3e0d5a6762b8994a3358d Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Fri, 2 Aug 2019 00:23:11 +0300 Subject: [PATCH 22/22] Bump version to 2.1.11-stable (with ABI breakage) --- CMakeLists.txt | 6 +++--- Makefile.am | 5 +++-- WIN32-Code/nmake/event2/event-config.h | 4 ++-- appveyor.yml | 2 +- cmake/VersionViaGit.cmake | 4 ++-- configure.ac | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1395443..70acb696 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,10 +84,10 @@ set(EVENT_ABI_LIBVERSION set(EVENT_PACKAGE_VERSION "${EVENT_VERSION_MAJOR}.${EVENT_VERSION_MINOR}.${EVENT_VERSION_PATCH}") -set(EVENT_NUMERIC_VERSION 0x02010a00) +set(EVENT_NUMERIC_VERSION 0x02010b00) # equals to VERSION_INFO in Makefile.am -set(EVENT_ABI_LIBVERSION_CURRENT 6) -set(EVENT_ABI_LIBVERSION_REVISION 4) +set(EVENT_ABI_LIBVERSION_CURRENT 7) +set(EVENT_ABI_LIBVERSION_REVISION 0) set(EVENT_ABI_LIBVERSION_AGE 0) # equals to RELEASE in Makefile.am diff --git a/Makefile.am b/Makefile.am index 53497bf0..dd905026 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,7 +38,7 @@ RELEASE = -release 2.1 # # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES # UNLESS YOU REALLY REALLY HAVE TO. -VERSION_INFO = 6:4:0 +VERSION_INFO = 7:0:0 # History: RELEASE VERSION_INFO # 2.0.1-alpha -- 2.0 1:0:0 @@ -73,7 +73,8 @@ VERSION_INFO = 6:4:0 # 2.1.7-beta -- 2.1 6:1:0 (ABI changed slightly) # 2.1.8-stable-- 2.1 6:2:0 (No ABI change) # 2.1.9-beta-- 2.1 6:3:0 (No ABI change) -# 2.1.10-stable-- 2.1 6:4:0 (No ABI change) +# 2.1.10-stable-- 2.1 6:4:0 (No ABI change, WRONG) +# 2.1.11-stable-- 2.1 7:0:0 (ABI changed) # ABI version history for this package effectively restarts every time # we change RELEASE. Version 1.4.x had RELEASE of 1.4. diff --git a/WIN32-Code/nmake/event2/event-config.h b/WIN32-Code/nmake/event2/event-config.h index 51597c34..35ec16fd 100644 --- a/WIN32-Code/nmake/event2/event-config.h +++ b/WIN32-Code/nmake/event2/event-config.h @@ -271,7 +271,7 @@ /* #undef EVENT__HAVE_WORKING_KQUEUE */ /* Numeric representation of the version */ -#define EVENT__NUMERIC_VERSION 0x02010a00 +#define EVENT__NUMERIC_VERSION 0x02010b00 /* Name of package */ #define EVENT__PACKAGE "libevent" @@ -332,7 +332,7 @@ #define EVENT__TIME_WITH_SYS_TIME 1 /* Version number of package */ -#define EVENT__VERSION "2.1.10-stable" +#define EVENT__VERSION "2.1.11-stable" /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ diff --git a/appveyor.yml b/appveyor.yml index 9add5805..edfe3372 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.1.10.{build} +version: 2.1.11.{build} os: Visual Studio 2017 platform: diff --git a/cmake/VersionViaGit.cmake b/cmake/VersionViaGit.cmake index 9ac7e30d..504980ad 100644 --- a/cmake/VersionViaGit.cmake +++ b/cmake/VersionViaGit.cmake @@ -23,8 +23,8 @@ macro(event_fuzzy_version_from_git) # set our defaults. set(EVENT_GIT___VERSION_MAJOR 2) set(EVENT_GIT___VERSION_MINOR 1) - set(EVENT_GIT___VERSION_PATCH 10) - set(EVENT_GIT___VERSION_STAGE "beta") + set(EVENT_GIT___VERSION_PATCH 11) + set(EVENT_GIT___VERSION_STAGE "stable") find_package(Git) diff --git a/configure.ac b/configure.ac index 3dc437fd..298d3ab9 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ dnl See LICENSE for copying information. dnl dnl Original version Dug Song -AC_INIT(libevent,2.1.10-stable) +AC_INIT(libevent,2.1.11-stable) AC_PREREQ(2.62) AC_CONFIG_SRCDIR(event.c) @@ -14,7 +14,7 @@ AM_INIT_AUTOMAKE dnl AM_SILENT_RULES req. automake 1.11. [no] defaults V=1 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_CONFIG_HEADERS(config.h evconfig-private.h:evconfig-private.h.in) -AC_DEFINE(NUMERIC_VERSION, 0x02010a00, [Numeric representation of the version]) +AC_DEFINE(NUMERIC_VERSION, 0x02010b00, [Numeric representation of the version]) dnl Initialize prefix. if test "$prefix" = "NONE"; then