changeset 4154:57d45d345651

Fixed segmentation fault with empty config on Windows. See here for report: http://mailman.nginx.org/pipermail/nginx-ru/2011-September/043288.html
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 27 Sep 2011 12:07:09 +0000
parents 7de74ed694c8
children d9636bf3f159
files src/http/ngx_http.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -1747,10 +1747,12 @@ ngx_http_add_listening(ngx_conf_t *cf, n
 
 #if (NGX_WIN32)
     {
-    ngx_iocp_conf_t  *iocpcf;
-
-    iocpcf = ngx_event_get_conf(cf->cycle->conf_ctx, ngx_iocp_module);
-    if (iocpcf->acceptex_read) {
+    ngx_iocp_conf_t  *iocpcf = NULL;
+
+    if (ngx_get_conf(cf->cycle->conf_ctx, ngx_events_module)) {
+        iocpcf = ngx_event_get_conf(cf->cycle->conf_ctx, ngx_iocp_module);
+    }
+    if (iocpcf && iocpcf->acceptex_read) {
         ls->post_accept_buffer_size = cscf->client_header_buffer_size;
     }
     }