]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
revert: libevent 2.0 support
authorOndřej Kuzník <ondra@mistotebe.net>
Mon, 8 Feb 2021 10:29:27 +0000 (10:29 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 24 Feb 2021 18:11:09 +0000 (18:11 +0000)
configure.ac
servers/lloadd/daemon.c
servers/lloadd/libevent_support.c
servers/lloadd/operation.c

index 131461811c4d18f8ec81dd9aed3761264299c037..a2b129755b43dda40864533be0b655622ab1450a 100644 (file)
@@ -2146,11 +2146,12 @@ if test $ol_enable_balancer != no ; then
                        [have_libevent=yes
                        LEVENT_LIBS="$LEVENT_LIBS -levent"],
                        [have_libevent=no])])
+       AC_CHECK_LIB(event, libevent_global_shutdown, [], [have_libevent=no])
 
        if test $have_libevent = yes ; then
                AC_DEFINE(HAVE_LIBEVENT, 1, [define if you have -levent])
        else
-               AC_MSG_ERROR([You need libevent 2.0 or later with DNS support to build the load balancer])
+               AC_MSG_ERROR([You need libevent 2.1 or later with DNS support to build the load balancer])
        fi
 fi
 
index ab549fdf71f78f399c7447f051f6b0d24459b8fa..3cbb59b6daf2637043416c40367e37b380ef5945 100644 (file)
@@ -1266,10 +1266,6 @@ lloadd_daemon( struct event_base *daemon_base )
 
     assert( daemon_base != NULL );
 
-#ifndef EVDNS_BASE_INITIALIZE_NAMESERVERS /* libevent 2.0 support */
-#define EVDNS_BASE_INITIALIZE_NAMESERVERS 1
-#endif /* !EVDNS_BASE_INITIALIZE_NAMESERVERS */
-
     dnsbase = evdns_base_new( daemon_base, EVDNS_BASE_INITIALIZE_NAMESERVERS );
     if ( !dnsbase ) {
         Debug( LDAP_DEBUG_ANY, "lloadd startup: "
@@ -1326,7 +1322,7 @@ lloadd_daemon( struct event_base *daemon_base )
         }
     }
 
-    event = evtimer_new( daemon_base, operations_timeout, NULL );
+    event = evtimer_new( daemon_base, operations_timeout, event_self_cbarg() );
     if ( !event ) {
         Debug( LDAP_DEBUG_ANY, "lloadd: "
                 "failed to allocate timeout event\n" );
index af0cdbb8707717e356058c8b7cdac9057f50a019..ebed3341ce8a87070c9a432891699960e5615726 100644 (file)
@@ -167,7 +167,5 @@ lload_libevent_init( void )
 void
 lload_libevent_destroy( void )
 {
-#if ( EVENT__NUMERIC_VERSION >= 0x02010000 )
     libevent_global_shutdown();
-#endif
 }
index c594e040c91ed35976bf32199a7b4b75837cb2eb..11aaa94f2c76f91b995dea03bd54ee69f7932d7b 100644 (file)
@@ -614,6 +614,7 @@ connection_timeout( LloadConnection *upstream, void *arg )
 void
 operations_timeout( evutil_socket_t s, short what, void *arg )
 {
+    struct event *self = arg;
     LloadBackend *b;
     time_t threshold;
 
@@ -652,7 +653,7 @@ operations_timeout( evutil_socket_t s, short what, void *arg )
 done:
     Debug( LDAP_DEBUG_TRACE, "operations_timeout: "
             "timeout task finished\n" );
-    evtimer_add( lload_timeout_event, lload_timeout_api );
+    evtimer_add( self, lload_timeout_api );
 }
 
 void