Work on removing libevent completely as a mandatory dependency.
This commit is contained in:
@@ -71,6 +71,7 @@ void uman_print_stats(struct hub_info* hub)
|
||||
}
|
||||
|
||||
#ifdef USERMANAGER_TIMER
|
||||
#ifdef USE_LIBEVENT
|
||||
static void timer_statistics(int fd, short ev, void *arg)
|
||||
{
|
||||
struct hub_info* hub = (struct hub_info*) arg;
|
||||
@@ -80,13 +81,16 @@ static void timer_statistics(int fd, short ev, void *arg)
|
||||
evtimer_add(&hub->ev_timer, &timeout);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
int uman_init(struct hub_info* hub)
|
||||
{
|
||||
struct hub_user_manager* users = NULL;
|
||||
#ifdef USERMANAGER_TIMER
|
||||
#ifdef USE_LIBEVENT
|
||||
struct timeval timeout = { TIMEOUT_STATS, 0 };
|
||||
#endif
|
||||
#endif
|
||||
if (!hub)
|
||||
return -1;
|
||||
@@ -108,11 +112,13 @@ int uman_init(struct hub_info* hub)
|
||||
hub->users = users;
|
||||
|
||||
#ifdef USERMANAGER_TIMER
|
||||
#ifdef USE_LIBEVENT
|
||||
if (net_get_evbase())
|
||||
{
|
||||
evtimer_set(&hub->ev_timer, timer_statistics, hub);
|
||||
evtimer_add(&hub->ev_timer, &timeout);
|
||||
}
|
||||
#endif
|
||||
#endif // 0
|
||||
return 0;
|
||||
}
|
||||
@@ -124,8 +130,10 @@ int uman_shutdown(struct hub_info* hub)
|
||||
return -1;
|
||||
|
||||
#ifdef USERMANAGER_TIMER
|
||||
#ifdef USE_LIBEVENT
|
||||
if (evtimer_pending(&hub->ev_timer, 0))
|
||||
evtimer_del(&hub->ev_timer);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (hub->users->list)
|
||||
|
||||
Reference in New Issue
Block a user