Skip to content

Commit ae765f2

Browse files
committed
Emit connector version just once (broken in e00e2cc)
1 parent e00e2cc commit ae765f2

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/ngx_http_modsecurity_module.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <ngx_http.h>
2626

2727
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);
2829
static void *ngx_http_modsecurity_create_conf(ngx_conf_t *cf);
2930
static char *ngx_http_modsecurity_merge_conf(ngx_conf_t *cf, void *parent, void *child);
3031
static void ngx_http_modsecurity_config_cleanup(void *data);
@@ -437,7 +438,7 @@ static ngx_http_module_t ngx_http_modsecurity_ctx = {
437438
ngx_http_modsecurity_init, /* postconfiguration */
438439

439440
NULL, /* create main configuration */
440-
NULL, /* init main configuration */
441+
ngx_http_modsecurity_init_main_conf, /* init main configuration */
441442

442443
NULL, /* create server configuration */
443444
NULL, /* merge server configuration */
@@ -540,14 +541,21 @@ ngx_http_modsecurity_init(ngx_conf_t *cf)
540541
}
541542

542543

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+
543553
static void *
544554
ngx_http_modsecurity_create_conf(ngx_conf_t *cf)
545555
{
546556
ngx_pool_cleanup_t *cln;
547557
ngx_http_modsecurity_conf_t *conf;
548558

549-
ngx_log_error(NGX_LOG_NOTICE, cf->log, 0, MODSECURITY_NGINX_WHOAMI);
550-
551559
conf = (ngx_http_modsecurity_conf_t *) ngx_pcalloc(cf->pool,
552560
sizeof(ngx_http_modsecurity_conf_t));
553561

0 commit comments

Comments
 (0)