comparison src/mail/ngx_mail_auth_http_module.c @ 1392:86acec04b8b0

test http_auth absence
author Igor Sysoev <igor@sysoev.ru>
date Tue, 14 Aug 2007 15:21:20 +0000
parents 4eed21047e4d
children fdd064faf26a
comparison
equal deleted inserted replaced
1391:4eed21047e4d 1392:86acec04b8b0
19 ngx_str_t host_header; 19 ngx_str_t host_header;
20 ngx_str_t uri; 20 ngx_str_t uri;
21 ngx_str_t header; 21 ngx_str_t header;
22 22
23 ngx_array_t *headers; 23 ngx_array_t *headers;
24
25 u_char *file;
26 ngx_uint_t line;
24 } ngx_mail_auth_http_conf_t; 27 } ngx_mail_auth_http_conf_t;
25 28
26 29
27 typedef struct ngx_mail_auth_http_ctx_s ngx_mail_auth_http_ctx_t; 30 typedef struct ngx_mail_auth_http_ctx_s ngx_mail_auth_http_ctx_t;
28 31
1309 return NGX_CONF_ERROR; 1312 return NGX_CONF_ERROR;
1310 } 1313 }
1311 1314
1312 ahcf->timeout = NGX_CONF_UNSET_MSEC; 1315 ahcf->timeout = NGX_CONF_UNSET_MSEC;
1313 1316
1317 ahcf->file = cf->conf_file->file.name.data;
1318 ahcf->line = cf->conf_file->line;
1319
1314 return ahcf; 1320 return ahcf;
1315 } 1321 }
1316 1322
1317 1323
1318 static char * 1324 static char *
1328 1334
1329 if (conf->peer == NULL) { 1335 if (conf->peer == NULL) {
1330 conf->peer = prev->peer; 1336 conf->peer = prev->peer;
1331 conf->host_header = prev->host_header; 1337 conf->host_header = prev->host_header;
1332 conf->uri = prev->uri; 1338 conf->uri = prev->uri;
1339
1340 if (conf->peer == NULL) {
1341 ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
1342 "no \"http_auth\" is defined for server in %s:%ui",
1343 conf->file, conf->line);
1344
1345 return NGX_CONF_ERROR;
1346 }
1333 } 1347 }
1334 1348
1335 ngx_conf_merge_msec_value(conf->timeout, prev->timeout, 60000); 1349 ngx_conf_merge_msec_value(conf->timeout, prev->timeout, 60000);
1336 1350
1337 if (conf->headers == NULL) { 1351 if (conf->headers == NULL) {