|
25 | 25 | #include <ngx_http.h> |
26 | 26 |
|
27 | 27 | static ngx_int_t ngx_http_modsecurity_init(ngx_conf_t *cf); |
| 28 | +static char *ngx_http_modsecurity_init_main_conf(ngx_conf_t *cf, void *conf); |
28 | 29 | static void *ngx_http_modsecurity_create_conf(ngx_conf_t *cf); |
29 | 30 | static char *ngx_http_modsecurity_merge_conf(ngx_conf_t *cf, void *parent, void *child); |
30 | 31 | static void ngx_http_modsecurity_config_cleanup(void *data); |
@@ -437,7 +438,7 @@ static ngx_http_module_t ngx_http_modsecurity_ctx = { |
437 | 438 | ngx_http_modsecurity_init, /* postconfiguration */ |
438 | 439 |
|
439 | 440 | NULL, /* create main configuration */ |
440 | | - NULL, /* init main configuration */ |
| 441 | + ngx_http_modsecurity_init_main_conf, /* init main configuration */ |
441 | 442 |
|
442 | 443 | NULL, /* create server configuration */ |
443 | 444 | NULL, /* merge server configuration */ |
@@ -540,14 +541,21 @@ ngx_http_modsecurity_init(ngx_conf_t *cf) |
540 | 541 | } |
541 | 542 |
|
542 | 543 |
|
| 544 | +static char * |
| 545 | +ngx_http_modsecurity_init_main_conf(ngx_conf_t *cf, void *conf) |
| 546 | +{ |
| 547 | + ngx_log_error(NGX_LOG_NOTICE, cf->log, 0, MODSECURITY_NGINX_WHOAMI); |
| 548 | + |
| 549 | + return NGX_CONF_OK; |
| 550 | +} |
| 551 | + |
| 552 | + |
543 | 553 | static void * |
544 | 554 | ngx_http_modsecurity_create_conf(ngx_conf_t *cf) |
545 | 555 | { |
546 | 556 | ngx_pool_cleanup_t *cln; |
547 | 557 | ngx_http_modsecurity_conf_t *conf; |
548 | 558 |
|
549 | | - ngx_log_error(NGX_LOG_NOTICE, cf->log, 0, MODSECURITY_NGINX_WHOAMI); |
550 | | - |
551 | 559 | conf = (ngx_http_modsecurity_conf_t *) ngx_pcalloc(cf->pool, |
552 | 560 | sizeof(ngx_http_modsecurity_conf_t)); |
553 | 561 |
|
|
0 commit comments