Beispiel #1
0
/**
 * Cleanup function to log nginx process exit and destroy ironbee engine
 *
 * @param[in]  cycle     nginx cycle rec
 */
static void ironbee_exit(ngx_cycle_t *cycle)
{
    ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "ironbee_exit %d", getpid());
    /* FIXME: this fails under gdb */
    if (module_data.manager != NULL) {
        ib_manager_destroy(module_data.manager);
        module_data.manager = NULL;
    }
}
Beispiel #2
0
/**
 * Handle ATS shutdown for IronBee plugin.
 *
 * Registered via atexit() during initialization, destroys the IB engine,
 * etc.
 *
 */
static void ibexit(void)
{
    module_data_t *mod_data = &module_data;

    TSDebug("ironbee", "ibexit()");
    if (mod_data->manager != NULL) {
        ib_manager_destroy(mod_data->manager);
    }
    if (mod_data->logger != NULL) {
        TSTextLogObjectFlush(mod_data->logger);
        TSTextLogObjectDestroy(mod_data->logger);
        mod_data->logger = NULL;
    }
    if (mod_data->txlogger != NULL) {
        TSTextLogObjectFlush(mod_data->txlogger);
        TSTextLogObjectDestroy(mod_data->txlogger);
    }
    if (mod_data->log_file != NULL) {
        free((void *)mod_data->log_file);
        mod_data->log_file = NULL;
    }
    ib_shutdown();
    TSDebug("ironbee", "ibexit() done");
}