summaryrefslogtreecommitdiffhomepage
path: root/src/mail/ngx_mail_auth_http_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-08-14 15:21:20 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-08-14 15:21:20 +0000
commited2c623987e7b6ff734169107fdf73ffb781ddd7 (patch)
tree42902c430068620175be7f9b3d060529d71ea8ee /src/mail/ngx_mail_auth_http_module.c
parent03496567865ac63ca85411f002ce05026437cd00 (diff)
downloadnginx-ed2c623987e7b6ff734169107fdf73ffb781ddd7.tar.gz
nginx-ed2c623987e7b6ff734169107fdf73ffb781ddd7.tar.bz2
test http_auth absence
Diffstat (limited to 'src/mail/ngx_mail_auth_http_module.c')
-rw-r--r--src/mail/ngx_mail_auth_http_module.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mail/ngx_mail_auth_http_module.c b/src/mail/ngx_mail_auth_http_module.c
index c7484c469..52031b340 100644
--- a/src/mail/ngx_mail_auth_http_module.c
+++ b/src/mail/ngx_mail_auth_http_module.c
@@ -21,6 +21,9 @@ typedef struct {
ngx_str_t header;
ngx_array_t *headers;
+
+ u_char *file;
+ ngx_uint_t line;
} ngx_mail_auth_http_conf_t;
@@ -1311,6 +1314,9 @@ ngx_mail_auth_http_create_conf(ngx_conf_t *cf)
ahcf->timeout = NGX_CONF_UNSET_MSEC;
+ ahcf->file = cf->conf_file->file.name.data;
+ ahcf->line = cf->conf_file->line;
+
return ahcf;
}
@@ -1330,6 +1336,14 @@ ngx_mail_auth_http_merge_conf(ngx_conf_t *cf, void *parent, void *child)
conf->peer = prev->peer;
conf->host_header = prev->host_header;
conf->uri = prev->uri;
+
+ if (conf->peer == NULL) {
+ ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
+ "no \"http_auth\" is defined for server in %s:%ui",
+ conf->file, conf->line);
+
+ return NGX_CONF_ERROR;
+ }
}
ngx_conf_merge_msec_value(conf->timeout, prev->timeout, 60000);