diff options
-rw-r--r-- | configure.ac | 31 | ||||
-rw-r--r-- | doc/config/lighttpd.conf | 1 | ||||
-rw-r--r-- | meson.build | 2 | ||||
-rwxr-xr-x | scripts/ci-build.sh | 5 | ||||
-rw-r--r-- | scripts/cmake/FindLibEV.cmake | 70 | ||||
-rw-r--r-- | src/CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/config.h.cmake | 3 | ||||
-rw-r--r-- | src/fdevent.h | 3 | ||||
-rw-r--r-- | src/fdevent_fdnode.c | 3 | ||||
-rw-r--r-- | src/fdevent_impl.c | 149 | ||||
-rw-r--r-- | src/fdevent_impl.h | 11 | ||||
-rw-r--r-- | src/meson.build | 5 | ||||
-rw-r--r-- | src/server.c | 7 |
13 files changed, 5 insertions, 297 deletions
diff --git a/configure.ac b/configure.ac index ef914560..88a4b804 100644 --- a/configure.ac +++ b/configure.ac @@ -184,36 +184,7 @@ AC_ARG_WITH([libev], [WITH_LIBEV=no] ) AC_MSG_RESULT([$WITH_LIBEV]) - -LIBEV_CFLAGS= -LIBEV_LIBS= - -if test "$WITH_LIBEV" != no; then - PKG_CHECK_MODULES([LIBEV], [libev], [], [ - dnl no pkg-config for libev, searching manually: - - if test "$WITH_LIBEV" != yes; then - LIBEV_CFLAGS="-I$WITH_LIBEV/include" - LIBEV_LIBS="-L$WITH_LIBEV/lib -lev" - else - AC_CHECK_HEADERS([ev.h], - [AC_CHECK_LIB([ev], [ev_time], - [ - LIBEV_CFLAGS= - LIBEV_LIBS="-lev" - ], - [AC_MSG_ERROR([libev not found])] - )], - [AC_MSG_ERROR([libev header not found])] - ) - fi - ]) - - AC_DEFINE([HAVE_LIBEV], [1], [libev support]) -fi - -AC_SUBST([LIBEV_CFLAGS]) -AC_SUBST([LIBEV_LIBS]) +dnl ignore WITH_LIBEV dnl Checks for mysql AC_MSG_NOTICE([----------------------------------------]) diff --git a/doc/config/lighttpd.conf b/doc/config/lighttpd.conf index 0abee3f1..c02f09f3 100644 --- a/doc/config/lighttpd.conf +++ b/doc/config/lighttpd.conf @@ -183,7 +183,6 @@ include conf_dir + "/conf.d/debug.conf" ## solaris-eventports (recommended on Solaris) ## poll (recommended if none of above are available) ## select (*not* recommended) -## libev (*not* recommended) ## #server.event-handler = "linux-sysepoll" diff --git a/meson.build b/meson.build index 15e6d945..ac504920 100644 --- a/meson.build +++ b/meson.build @@ -17,7 +17,7 @@ subdir('tests') # $ ninja # full build: -# $ meson configure -D build_extra_warnings=true -D buildtype=debugoptimized -D with_bzip=enabled -D with_dbi=enabled -D with_fam=enabled -D with_krb5=enabled -D with_ldap=enabled -D with_libev=enabled -D with_libunwind=enabled -D with_lua=true -D with_mysql=enabled -D with_openssl=true -D with_pcre2=true -D with_pgsql=enabled -D with_sasl=enabled -D with_webdav_locks=enabled -D with_webdav_props=enabled -D with_xattr=true -D with_zlib=enabled +# $ meson configure -D build_extra_warnings=true -D buildtype=debugoptimized -D with_bzip=enabled -D with_dbi=enabled -D with_fam=enabled -D with_krb5=enabled -D with_ldap=enabled -D with_libunwind=enabled -D with_lua=true -D with_mysql=enabled -D with_openssl=true -D with_pcre2=true -D with_pgsql=enabled -D with_sasl=enabled -D with_webdav_locks=enabled -D with_webdav_props=enabled -D with_xattr=true -D with_zlib=enabled # optimized build: # $ meson configure -D b_lto=true -D buildtype=debugoptimized diff --git a/scripts/ci-build.sh b/scripts/ci-build.sh index 88b1fac7..e0e4b239 100755 --- a/scripts/ci-build.sh +++ b/scripts/ci-build.sh @@ -20,7 +20,7 @@ case "${build}" in --with-ldap --with-pcre2 \ --with-zlib --with-zstd --with-brotli --with-bzip2 \ --with-webdav-props --with-webdav-locks \ - --with-lua --with-libev --with-libunwind \ + --with-lua --with-libunwind \ --with-krb5 \ --with-nettle \ --with-gnutls \ @@ -41,7 +41,7 @@ case "${build}" in --with-ldap --with-pcre2 \ --with-zlib --with-zstd --with-brotli --with-bzip2 \ --with-webdav-props --with-webdav-locks \ - --with-lua --with-libev --with-libunwind \ + --with-lua --with-libunwind \ --with-krb5 --with-sasl \ --with-nettle \ --with-gnutls \ @@ -66,7 +66,6 @@ case "${build}" in -DWITH_BROTLI=ON \ -DWITH_BZIP=ON \ -DWITH_LDAP=ON \ - -DWITH_LIBEV=ON \ -DWITH_LIBUNWIND=ON \ -DWITH_LUA=ON \ -DWITH_DBI=ON \ diff --git a/scripts/cmake/FindLibEV.cmake b/scripts/cmake/FindLibEV.cmake deleted file mode 100644 index 739b4bad..00000000 --- a/scripts/cmake/FindLibEV.cmake +++ /dev/null @@ -1,70 +0,0 @@ - -set(LIBEV_PATH "" CACHE PATH "Base path for include/ev.h and lib/libev*") -set(LIBEV_INCLUDE_PATH "" CACHE PATH "Include path for ev.h") -set(LIBEV_LIBDIR "" CACHE PATH "Path containing libev") - -if(LIBEV_PATH) - set(LIBEV_INCLUDE_PATH "${LIBEV_PATH}/include" CACHE PATH "Include path for ev.h" FORCE) - set(LIBEV_LIBDIR "${LIBEV_PATH}/lib" CACHE PATH "Path containing libev" FORCE) -endif() - -if(LIBEV_INCLUDE_PATH) - include_directories(${LIBEV_INCLUDE_PATH}) -endif() - -# Use cached result -if(NOT LIBEV_FOUND) - unset(HAVE_EV_H) - unset(HAVE_LIBEV) - unset(HAVE_EV_H CACHE) - unset(HAVE_LIBEV CACHE) - unset(LIBEV_CFLAGS) - unset(LIBEV_LDFLAGS) - - if(LIBEV_INCLUDE_PATH OR LIBEV_LIBDIR) - set(CMAKE_REQUIRED_INCLUDES ${LIBEV_INCLUDE_PATH}) -# message(STATUS "Looking for ev.h in ${CMAKE_REQUIRED_INCLUDES}") - check_include_files(ev.h HAVE_EV_H) - if(HAVE_EV_H) -# message(STATUS "Looking for lib ev in ${LIBEV_LIBDIR}") - check_library_exists(ev ev_time "${LIBEV_LIBDIR}" HAVE_LIBEV) - if(HAVE_LIBEV) - set(LIBEV_CFLAGS "" CACHE INTERNAL "") - set(LIBEV_LDFLAGS "-L${LIBEV_LIBDIR} -lev" CACHE INTERNAL "") - set(LIBEV_FOUND TRUE CACHE INTERNAL "Found libev") - else() - message(STATUS "Couldn't find lib ev in ${LIBEV_LIBDIR}") - endif() - else() - message(STATUS "Couldn't find <ev.h> in ${LIBEV_INCLUDE_PATH}") - endif() - else() - pkg_check_modules(LIBEV libev) - if(NOT LIBEV_FOUND) -# message(STATUS "Looking for ev.h in ${CMAKE_REQUIRED_INCLUDES}") - check_include_files(ev.h HAVE_EV_H) - if(HAVE_EV_H) -# message(STATUS "Looking for lib ev") - check_library_exists(ev ev_time "" HAVE_LIBEV) - if(HAVE_LIBEV) - set(LIBEV_CFLAGS "" CACHE INTERNAL "") - set(LIBEV_LDFLAGS "-lev" CACHE INTERNAL "") - set(LIBEV_FOUND TRUE CACHE INTERNAL "Found libev") - else() - message(STATUS "Couldn't find lib ev") - endif() - else() - message(STATUS "Couldn't find <ev.h>") - endif() - endif() - endif() - -endif() - -if(NOT LIBEV_FOUND) - if(LibEV_FIND_REQUIRED) - message(FATAL_ERROR "Could not find libev") - endif() -endif() - -mark_as_advanced(LIBEV_PATH LIBEV_INCLUDE_PATH LIBEV_LIBDIR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1cdda123..1d249ae1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -88,11 +88,6 @@ else() set(CMAKE_SHARED_LIBRARY_PREFIX "") endif() -if(WITH_LIBEV) - find_package(LibEV REQUIRED) - set(HAVE_LIBEV 1) -endif() - if(WITH_LIBUNWIND) pkg_check_modules(LIBUNWIND REQUIRED libunwind) set(HAVE_LIBUNWIND 1) @@ -1175,13 +1170,6 @@ if(HAVE_LIBSSL3 AND HAVE_LIBSMIME3 AND HAVE_LIBNSS3 AND HAVE_LIBNSSUTIL3) target_link_libraries(mod_nss ${L_MOD_NSS}) endif() -if(WITH_LIBEV) - target_link_libraries(lighttpd ${LIBEV_LDFLAGS}) - add_target_properties(lighttpd COMPILE_FLAGS ${LIBEV_CFLAGS}) - target_link_libraries(test_mod ${LIBEV_LDFLAGS}) - add_target_properties(test_mod COMPILE_FLAGS ${LIBEV_CFLAGS}) -endif() - if(WITH_LIBUNWIND) target_link_libraries(lighttpd ${LIBUNWIND_LDFLAGS}) add_target_properties(lighttpd COMPILE_FLAGS ${LIBUNWIND_CFLAGS}) diff --git a/src/config.h.cmake b/src/config.h.cmake index a7c81ef7..838792b4 100644 --- a/src/config.h.cmake +++ b/src/config.h.cmake @@ -208,9 +208,6 @@ #cmakedefine HAVE_CRYPT #cmakedefine HAVE_CRYPT_R -/* libev */ -#cmakedefine HAVE_LIBEV - /* libunwind */ #cmakedefine HAVE_LIBUNWIND diff --git a/src/fdevent.h b/src/fdevent.h index f63a1131..1fc1ac00 100644 --- a/src/fdevent.h +++ b/src/fdevent.h @@ -15,9 +15,6 @@ struct fdnode_st { int fd; int events; int fde_ndx; - #ifdef HAVE_LIBEV - void *handler_ctx; - #endif }; /* These must match POLL* values from operating system headers */ diff --git a/src/fdevent_fdnode.c b/src/fdevent_fdnode.c index b79aad1a..022febf9 100644 --- a/src/fdevent_fdnode.c +++ b/src/fdevent_fdnode.c @@ -33,9 +33,6 @@ fdevent_register (fdevents *ev, int fd, fdevent_handler handler, void *ctx) fdn->ctx = ctx; fdn->events = 0; fdn->fde_ndx = -1; - #ifdef FDEVENT_USE_LIBEV - fdn->handler_ctx = NULL; - #endif return fdn; } diff --git a/src/fdevent_impl.c b/src/fdevent_impl.c index e16f57ca..04422ae2 100644 --- a/src/fdevent_impl.c +++ b/src/fdevent_impl.c @@ -31,10 +31,6 @@ static int fdevent_solaris_port_init(struct fdevents *ev); __attribute_cold__ static int fdevent_solaris_devpoll_init(struct fdevents *ev); #endif -#ifdef FDEVENT_USE_LIBEV -__attribute_cold__ -static int fdevent_libev_init(struct fdevents *ev); -#endif #ifdef FDEVENT_USE_POLL __attribute_cold__ static int fdevent_poll_init(struct fdevents *ev); @@ -74,19 +70,14 @@ fdevent_config (const char **event_handler_name, log_error_st *errh) #ifdef FDEVENT_USE_SELECT { FDEVENT_HANDLER_SELECT, "select" }, #endif - #ifdef FDEVENT_USE_LIBEV - { FDEVENT_HANDLER_LIBEV, "libev" }, - #endif { FDEVENT_HANDLER_UNSET, NULL } }; const char *event_handler = *event_handler_name; fdevent_handler_t et = FDEVENT_HANDLER_UNSET; - #ifndef FDEVENT_USE_LIBEV if (NULL != event_handler && 0 == strcmp(event_handler, "libev")) event_handler = NULL; - #endif #ifdef FDEVENT_USE_POLL if (NULL != event_handler && 0 == strcmp(event_handler, "select")) event_handler = "poll"; @@ -167,11 +158,6 @@ fdevent_show_event_handlers (void) #else "\t- kqueue (FreeBSD)\n" #endif - #ifdef FDEVENT_USE_LIBEV - "\t+ libev (generic)\n" - #else - "\t- libev (generic)\n" - #endif ; } @@ -245,11 +231,6 @@ fdevent_init (const char *event_handler, int *max_fds, int *cur_fds, log_error_s if (0 == fdevent_freebsd_kqueue_init(ev)) return ev; break; #endif - #ifdef FDEVENT_USE_LIBEV - case FDEVENT_HANDLER_LIBEV: - if (0 == fdevent_libev_init(ev)) return ev; - break; - #endif /*case FDEVENT_HANDLER_UNSET:*/ default: break; @@ -761,136 +742,6 @@ fdevent_solaris_devpoll_init (fdevents *ev) #endif /* FDEVENT_USE_SOLARIS_DEVPOLL */ -#ifdef FDEVENT_USE_LIBEV - -#if (defined(__APPLE__) && defined(__MACH__)) \ - || defined(__FreeBSD__) || defined(__NetBSD__) \ - || defined(__OpenBSD__) || defined(__DragonFly__) -/* libev EV_ERROR conflicts with kqueue sys/event.h EV_ERROR */ -#undef EV_ERROR -#endif - -#include <ev.h> - -static void -fdevent_libev_io_watcher_cb (struct ev_loop *loop, ev_io *w, int revents) -{ - fdevents *ev = w->data; - fdnode *fdn = ev->fdarray[w->fd]; - int rv = 0; - UNUSED(loop); - - if (revents & EV_READ) rv |= FDEVENT_IN; - if (revents & EV_WRITE) rv |= FDEVENT_OUT; - if (revents & EV_ERROR) rv |= FDEVENT_ERR; - - if (0 == ((uintptr_t)fdn & 0x3)) - (*fdn->handler)(fdn->ctx, rv); -} - -static int -fdevent_libev_event_del (fdevents *ev, fdnode *fdn) -{ - ev_io *watcher = fdn->handler_ctx; - if (!watcher) return 0; - fdn->handler_ctx = NULL; - - ev_io_stop(ev->libev_loop, watcher); - free(watcher); - - return 0; -} - -static int -fdevent_libev_event_set (fdevents *ev, fdnode *fdn, int events) -{ - ev_io *watcher = fdn->handler_ctx; - int ev_events = 0; - - if (events & FDEVENT_IN) ev_events |= EV_READ; - if (events & FDEVENT_OUT) ev_events |= EV_WRITE; - - if (!watcher) { - fdn->handler_ctx = watcher = calloc(1, sizeof(ev_io)); - force_assert(watcher); - fdn->fde_ndx = fdn->fd; - - ev_io_init(watcher, fdevent_libev_io_watcher_cb, fdn->fd, ev_events); - watcher->data = ev; - ev_io_start(ev->libev_loop, watcher); - } - else { - if ((watcher->events & (EV_READ | EV_WRITE)) != ev_events) { - ev_io_stop(ev->libev_loop, watcher); - ev_io_set(watcher, watcher->fd, ev_events); - ev_io_start(ev->libev_loop, watcher); - } - } - - return 0; -} - -static void -fdevent_libev_timeout_watcher_cb (struct ev_loop *loop, ev_timer *w, int revents) -{ - UNUSED(loop); - UNUSED(w); - UNUSED(revents); -} - -static ev_timer timeout_watcher; - -static int -fdevent_libev_poll (fdevents *ev, int timeout_ms) -{ - timeout_watcher.repeat = (timeout_ms > 0) ? timeout_ms/1000.0 : 0.001; - - ev_timer_again(ev->libev_loop, &timeout_watcher); - ev_run(ev->libev_loop, EVRUN_ONCE); - - return 0; -} - -__attribute_cold__ -static int -fdevent_libev_reset (fdevents *ev) -{ - UNUSED(ev); - ev_default_fork(); - return 0; -} - -__attribute_cold__ -static void -fdevent_libev_free (fdevents *ev) -{ - UNUSED(ev); -} - -__attribute_cold__ -static int -fdevent_libev_init (fdevents *ev) -{ - struct ev_timer * const timer = &timeout_watcher; - memset(timer, 0, sizeof(*timer)); - - ev->type = FDEVENT_HANDLER_LIBEV; - ev->event_set = fdevent_libev_event_set; - ev->event_del = fdevent_libev_event_del; - ev->poll = fdevent_libev_poll; - ev->reset = fdevent_libev_reset; - ev->free = fdevent_libev_free; - - if (NULL == (ev->libev_loop = ev_default_loop(0))) return -1; - - ev_timer_init(timer, fdevent_libev_timeout_watcher_cb, 0.0, 1.0); - - return 0; -} - -#endif /* FDEVENT_USE_LIBEV */ - - #ifdef FDEVENT_USE_POLL #ifdef HAVE_POLL_H diff --git a/src/fdevent_impl.h b/src/fdevent_impl.h index ac50f413..e2ebbc14 100644 --- a/src/fdevent_impl.h +++ b/src/fdevent_impl.h @@ -45,11 +45,6 @@ struct pollfd; /* declaration */ struct kevent; /* declaration */ #endif -#if defined HAVE_LIBEV -# define FDEVENT_USE_LIBEV -struct ev_loop; /* declaration */ -#endif - #include "base_decls.h" #include "fdevent.h" /* (*fdevent_handler) */ @@ -60,8 +55,7 @@ typedef enum { FDEVENT_HANDLER_LINUX_SYSEPOLL, FDEVENT_HANDLER_SOLARIS_DEVPOLL, FDEVENT_HANDLER_SOLARIS_PORT, - FDEVENT_HANDLER_FREEBSD_KQUEUE, - FDEVENT_HANDLER_LIBEV + FDEVENT_HANDLER_FREEBSD_KQUEUE } fdevent_handler_t; /** @@ -105,9 +99,6 @@ struct fdevents { int kq_fd; struct kevent *kq_results; #endif - #ifdef FDEVENT_USE_LIBEV - struct ev_loop *libev_loop; - #endif #ifdef FDEVENT_USE_POLL struct pollfd *pollfds; diff --git a/src/meson.build b/src/meson.build index 57f8a76a..df45ab47 100644 --- a/src/meson.build +++ b/src/meson.build @@ -284,9 +284,6 @@ conf_data.set('HAVE_LIBLBER', liblber.found()) libpam = compiler.find_library('pam', required: get_option('with_pam')) conf_data.set('HAVE_PAM', libpam.found()) -libev = compiler.find_library('ev', required: get_option('with_libev')) -conf_data.set('HAVE_LIBEV', libev.found()) - libunwind = dependency('libunwind', required: get_option('with_libunwind')) liblua = [] @@ -642,7 +639,6 @@ executable('lighttpd', configparser, , libattr , libcrypto , libdl - , libev , libfam , libpcre , libunwind @@ -720,7 +716,6 @@ test('test_mod', executable('test_mod', , libattr , libcrypto , libdl - , libev , libfam , libpcre , libunwind diff --git a/src/server.c b/src/server.c index ddfdda47..a645af7a 100644 --- a/src/server.c +++ b/src/server.c @@ -1771,13 +1771,6 @@ static int server_main_setup (server * const srv, int argc, char **argv) { srv->lim_conns = srv->srvconf.max_conns = srv->max_fds/3; } - /* libev backend overwrites our SIGCHLD handler and calls waitpid on SIGCHLD; we want our own SIGCHLD handling. */ -#ifdef HAVE_SIGACTION - sigaction(SIGCHLD, &act, NULL); -#elif defined(HAVE_SIGNAL) - signal(SIGCHLD, signal_handler); -#endif - /* * kqueue() is called here, select resets its internals, * all server sockets get their handlers |