Klaus Demo nginx / dabbf30
Ensure "listen" exists in a mail or stream server (ticket #1049). Roman Arutyunyan 5 years ago
4 changed file(s) with 24 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
123123
124124 /* server ctx */
125125 ngx_mail_conf_ctx_t *ctx;
126
127 ngx_uint_t listen; /* unsigned listen:1; */
126128 } ngx_mail_core_srv_conf_t;
127129
128130
278278
279279 *cf = pcf;
280280
281 if (rv == NGX_CONF_OK && !cscf->listen) {
282 ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
283 "no \"listen\" is defined for server in %s:%ui",
284 cscf->file_name, cscf->line);
285 return NGX_CONF_ERROR;
286 }
287
281288 return rv;
282289 }
283290
294301 ngx_mail_module_t *module;
295302 ngx_mail_core_main_conf_t *cmcf;
296303
304 cscf->listen = 1;
305
297306 value = cf->args->elts;
298307
299308 ngx_memzero(&u, sizeof(ngx_url_t));
143143
144144 ngx_msec_t resolver_timeout;
145145 ngx_resolver_t *resolver;
146
147 ngx_uint_t listen; /* unsigned listen:1; */
146148 } ngx_stream_core_srv_conf_t;
147149
148150
324324
325325 *cf = pcf;
326326
327 if (rv == NGX_CONF_OK && !cscf->listen) {
328 ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
329 "no \"listen\" is defined for server in %s:%ui",
330 cscf->file_name, cscf->line);
331 return NGX_CONF_ERROR;
332 }
333
327334 return rv;
328335 }
329336
331338 static char *
332339 ngx_stream_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
333340 {
341 ngx_stream_core_srv_conf_t *cscf = conf;
342
334343 ngx_str_t *value;
335344 ngx_url_t u;
336345 ngx_uint_t i, backlog;
337346 ngx_stream_listen_t *ls, *als;
338347 ngx_stream_core_main_conf_t *cmcf;
348
349 cscf->listen = 1;
339350
340351 value = cf->args->elts;
341352