Revert "Merge pull request #139 from chaizhenhua/remotes/trunk"

This reverts commit 10fd40fb0d06f6c577d870b6f15d2f6e2a3a5b1b, reversing
changes made to 414033aafa94cd50c9b310afd3f164740caccc94.
This commit is contained in:
Felipe Zimmerle 2013-10-18 11:02:10 -03:00
parent b0c3977845
commit 7f7d00fa2c

View File

@ -61,7 +61,7 @@ static char *ngx_http_modsecurity_enable(ngx_conf_t *cf, ngx_command_t *cmd, voi
static ngx_http_modsecurity_ctx_t * ngx_http_modsecurity_create_ctx(ngx_http_request_t *r); static ngx_http_modsecurity_ctx_t * ngx_http_modsecurity_create_ctx(ngx_http_request_t *r);
static int ngx_http_modsecurity_drop_action(request_rec *r); static int ngx_http_modsecurity_drop_action(request_rec *r);
static void ngx_http_modsecurity_terminate(void *data); static void ngx_http_modsecurity_terminate(ngx_cycle_t *cycle);
static void ngx_http_modsecurity_cleanup(void *data); static void ngx_http_modsecurity_cleanup(void *data);
static int ngx_http_modsecurity_save_headers_in_visitor(void *data, const char *key, const char *value); static int ngx_http_modsecurity_save_headers_in_visitor(void *data, const char *key, const char *value);
@ -115,8 +115,8 @@ ngx_module_t ngx_http_modsecurity = {
ngx_http_modsecurity_init_process, /* init process */ ngx_http_modsecurity_init_process, /* init process */
NULL, /* init thread */ NULL, /* init thread */
NULL, /* exit thread */ NULL, /* exit thread */
NULL, /* exit process */ ngx_http_modsecurity_terminate, /* exit process */
NULL, /* exit master */ ngx_http_modsecurity_terminate, /* exit master */
NGX_MODULE_V1_PADDING NGX_MODULE_V1_PADDING
}; };
@ -886,15 +886,6 @@ static server_rec *modsec_server = NULL;
static ngx_int_t static ngx_int_t
ngx_http_modsecurity_preconfiguration(ngx_conf_t *cf) ngx_http_modsecurity_preconfiguration(ngx_conf_t *cf)
{ {
ngx_pool_cleanup_t *cln;
cln = ngx_pool_cleanup_add(cf->pool, 0);
if (cln == NULL) {
return NGX_ERROR;
}
cln->handler = ngx_http_modsecurity_terminate;
/* XXX: temporary hack, nginx uses pcre as well and hijacks these two */ /* XXX: temporary hack, nginx uses pcre as well and hijacks these two */
pcre_malloc = modsec_pcre_malloc; pcre_malloc = modsec_pcre_malloc;
pcre_free = modsec_pcre_free; pcre_free = modsec_pcre_free;
@ -922,7 +913,7 @@ ngx_http_modsecurity_preconfiguration(ngx_conf_t *cf)
static void static void
ngx_http_modsecurity_terminate(void *data) ngx_http_modsecurity_terminate(ngx_cycle_t *cycle)
{ {
if (modsec_server) { if (modsec_server) {
modsecTerminate(); modsecTerminate();