Mercurial > hg > nginx
diff src/event/ngx_event.c @ 605:5dac8c7fb71b release-0.3.24
nginx-0.3.24-RELEASE import
*) Workaround: for bug in FreeBSD kqueue.
*) Bugfix: now a response generated by the "post_action" directive is
not transferred to a client.
*) Bugfix: the memory leaks were occurring if many log files were used.
*) Bugfix: the first "proxy_redirect" directive was working inside one
location.
*) Bugfix: on 64-bit platforms segmentation fault may occurred on start
if the many names were used in the "server_name" directives; the bug
had appeared in 0.3.18.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 01 Feb 2006 18:22:15 +0000 |
parents | 326634fb9d47 |
children | 3f8a2132b93d |
line wrap: on
line diff
--- a/src/event/ngx_event.c +++ b/src/event/ngx_event.c @@ -414,11 +414,12 @@ static ngx_int_t ngx_event_module_init(ngx_cycle_t *cycle) { void ***cf; + u_char *shared; + size_t size; ngx_event_conf_t *ecf; ngx_core_conf_t *ccf; + ngx_shm_t shm; #if !(NGX_WIN32) - char *shared; - size_t size; ngx_int_t limit; struct rlimit rlmt; #endif @@ -461,6 +462,8 @@ ngx_event_module_init(ngx_cycle_t *cycle } } +#endif /* !(NGX_WIN32) */ + if (ccf->master == 0 || ngx_accept_mutex_ptr) { return NGX_OK; @@ -483,11 +486,15 @@ ngx_event_module_init(ngx_cycle_t *cycle #endif - shared = ngx_create_shared_memory(size, cycle->log); - if (shared == NULL) { + shm.size = size; + shm.log = cycle->log; + + if (ngx_shm_alloc(&shm) != NGX_OK) { return NGX_ERROR; } + shared = shm.addr; + ngx_accept_mutex_ptr = (ngx_atomic_t *) shared; ngx_connection_counter = (ngx_atomic_t *) (shared + 1 * 128); @@ -508,8 +515,6 @@ ngx_event_module_init(ngx_cycle_t *cycle "counter: %p, %d", ngx_connection_counter, *ngx_connection_counter); -#endif /* !(NGX_WIN32) */ - return NGX_OK; }