More work on epoll.
This commit is contained in:
@@ -21,9 +21,7 @@
|
||||
|
||||
static int is_ipv6_supported = -1; /* -1 = CHECK, 0 = NO, 1 = YES */
|
||||
static int net_initialized = 0;
|
||||
#ifdef USE_LIBEVENT
|
||||
static struct event_base* net_evbase = 0;
|
||||
#endif
|
||||
|
||||
static struct net_statistics stats;
|
||||
static struct net_statistics stats_total;
|
||||
|
||||
@@ -49,16 +47,7 @@ int net_initialize()
|
||||
}
|
||||
#endif /* WINSOCK */
|
||||
|
||||
#ifdef USE_LIBEVENT
|
||||
net_evbase = event_init();
|
||||
if (!net_evbase)
|
||||
{
|
||||
LOG_ERROR("Unable to initialize libevent.");
|
||||
return 0;
|
||||
}
|
||||
LOG_DEBUG("Using libevent %s, backend: %s", event_get_version(), event_get_method());
|
||||
#endif
|
||||
|
||||
net_backend_initialize();
|
||||
net_stats_initialize();
|
||||
|
||||
#ifdef SSL_SUPPORT
|
||||
@@ -102,11 +91,8 @@ int net_destroy()
|
||||
{
|
||||
LOG_TRACE("Shutting down network monitor");
|
||||
|
||||
#ifdef USE_LIBEVENT
|
||||
event_base_free(net_evbase);
|
||||
net_evbase = 0;
|
||||
#endif
|
||||
|
||||
net_backend_shutdown();
|
||||
|
||||
#ifdef SSL_SUPPORT
|
||||
/* FIXME: Shutdown OpenSSL here. */
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user