Commit 5fa0a651 authored by Ondřej Kuzník's avatar Ondřej Kuzník Committed by Quanah Gibson-Mount
Browse files

revert: libevent 2.0 support

parent a3c49b87
......@@ -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
......
......@@ -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" );
......
......@@ -167,7 +167,5 @@ lload_libevent_init( void )
void
lload_libevent_destroy( void )
{
#if ( EVENT__NUMERIC_VERSION >= 0x02010000 )
libevent_global_shutdown();
#endif
}
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment