]> git.kaiwu.me - nginx.git/commitdiff
Fixed segmentation fault with empty config on Windows.
authorMaxim Dounin <mdounin@mdounin.ru>
Tue, 27 Sep 2011 12:07:09 +0000 (12:07 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Tue, 27 Sep 2011 12:07:09 +0000 (12:07 +0000)
See here for report:
http://mailman.nginx.org/pipermail/nginx-ru/2011-September/043288.html

src/http/ngx_http.c

index 4f0b79def3785b6c93fd3672b0c9a2ec714c1077..1eb22f81e1c066b4a53e79f25d3ff13b27902735 100644 (file)
@@ -1747,10 +1747,12 @@ ngx_http_add_listening(ngx_conf_t *cf, ngx_http_conf_addr_t *addr)
 
 #if (NGX_WIN32)
     {
-    ngx_iocp_conf_t  *iocpcf;
+    ngx_iocp_conf_t  *iocpcf = NULL;
 
-    iocpcf = ngx_event_get_conf(cf->cycle->conf_ctx, ngx_iocp_module);
-    if (iocpcf->acceptex_read) {
+    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;
     }
     }