comparison src/mail/ngx_mail_core_module.c @ 6657:3d5202c71f94

Ensure "listen" exists in a mail or stream server (ticket #1049).
author Roman Arutyunyan <arut@nginx.com>
date Wed, 17 Aug 2016 11:26:51 +0300
parents c90cf79d0e1d
children cebf5fed00bf
comparison
equal deleted inserted replaced
6656:a2f57dfa65a9 6657:3d5202c71f94
277 277
278 rv = ngx_conf_parse(cf, NULL); 278 rv = ngx_conf_parse(cf, NULL);
279 279
280 *cf = pcf; 280 *cf = pcf;
281 281
282 if (rv == NGX_CONF_OK && !cscf->listen) {
283 ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
284 "no \"listen\" is defined for server in %s:%ui",
285 cscf->file_name, cscf->line);
286 return NGX_CONF_ERROR;
287 }
288
282 return rv; 289 return rv;
283 } 290 }
284 291
285 292
286 static char * 293 static char *
293 ngx_uint_t i, m; 300 ngx_uint_t i, m;
294 ngx_mail_listen_t *ls; 301 ngx_mail_listen_t *ls;
295 ngx_mail_module_t *module; 302 ngx_mail_module_t *module;
296 ngx_mail_core_main_conf_t *cmcf; 303 ngx_mail_core_main_conf_t *cmcf;
297 304
305 cscf->listen = 1;
306
298 value = cf->args->elts; 307 value = cf->args->elts;
299 308
300 ngx_memzero(&u, sizeof(ngx_url_t)); 309 ngx_memzero(&u, sizeof(ngx_url_t));
301 310
302 u.url = value[1]; 311 u.url = value[1];