Commit 00806dd3 authored by Ondřej Kuzník's avatar Ondřej Kuzník
Browse files

libevent 2.0 support

parent 513659c6
......@@ -1302,9 +1302,11 @@ lloadd_daemon( struct event_base *daemon_base )
assert( daemon_base != NULL );
dnsbase = evdns_base_new( daemon_base,
EVDNS_BASE_INITIALIZE_NAMESERVERS |
EVDNS_BASE_DISABLE_WHEN_INACTIVE );
#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: "
"failed to set up for async name resolution\n" );
......@@ -1358,7 +1360,7 @@ lloadd_daemon( struct event_base *daemon_base )
}
}
event = evtimer_new( daemon_base, operations_timeout, event_self_cbarg() );
event = evtimer_new( daemon_base, operations_timeout, NULL );
if ( !event ) {
Debug( LDAP_DEBUG_ANY, "lloadd: "
"failed to allocate timeout event\n" );
......
......@@ -167,5 +167,7 @@ lload_libevent_init( void )
void
lload_libevent_destroy( void )
{
#if ( EVENT__NUMERIC_VERSION >= 0x02010000 )
libevent_global_shutdown();
#endif
}
......@@ -983,7 +983,6 @@ backend_timeout(
void
operations_timeout( evutil_socket_t s, short what, void *arg )
{
struct event *self = arg;
LloadBackend *b;
time_t threshold;
......@@ -1009,7 +1008,7 @@ operations_timeout( evutil_socket_t s, short what, void *arg )
done:
Debug( LDAP_DEBUG_TRACE, "operations_timeout: "
"timeout task finished\n" );
evtimer_add( self, lload_timeout_api );
evtimer_add( lload_timeout_event, 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