Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/event
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-06-17 21:18:53 +0400
committerIgor Sysoev <igor@sysoev.ru>2004-06-17 21:18:53 +0400
commit415b1ce1b93a3b74efe8a3ee5a35ee55e0a11caa (patch)
tree077bf24b4f310a87ab8bff140c730cb679069988 /src/event
parentf924e6b694db7fd1d99473b3d7db7eb2b49c9e62 (diff)
nginx-0.0.7-2004-06-17-21:18:53 import
Diffstat (limited to 'src/event')
-rw-r--r--src/event/ngx_event.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/event/ngx_event.c b/src/event/ngx_event.c
index a74430a50..728dbde70 100644
--- a/src/event/ngx_event.c
+++ b/src/event/ngx_event.c
@@ -187,6 +187,7 @@ static ngx_int_t ngx_event_module_init(ngx_cycle_t *cycle)
size = 128 /* ngx_accept_mutex */
+ 128; /* ngx_connection_counter */
+#if 0
shared = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0);
if (shared == MAP_FAILED) {
@@ -194,6 +195,11 @@ static ngx_int_t ngx_event_module_init(ngx_cycle_t *cycle)
"mmap(MAP_ANON|MAP_SHARED) failed");
return NGX_ERROR;
}
+#endif
+
+ if (!(shared = ngx_create_shared_memory(size, cycle->log))) {
+ return NGX_ERROR;
+ }
ngx_accept_mutex_ptr = (ngx_atomic_t *) shared;
ngx_connection_counter = (ngx_atomic_t *) (shared + 128);
@@ -611,7 +617,7 @@ static void *ngx_event_create_conf(ngx_cycle_t *cycle)
NGX_CONF_ERROR);
ecf->connections = NGX_CONF_UNSET_UINT;
- ecf->use = NGX_CONF_UNSET;
+ ecf->use = NGX_CONF_UNSET_UINT;
ecf->multi_accept = NGX_CONF_UNSET;
ecf->accept_mutex = NGX_CONF_UNSET;
ecf->accept_mutex_delay = NGX_CONF_UNSET_MSEC;
@@ -694,9 +700,9 @@ static char *ngx_event_init_conf(ngx_cycle_t *cycle, void *conf)
return NGX_CONF_ERROR;
}
- ngx_conf_unsigned_init_value(ecf->connections, DEFAULT_CONNECTIONS);
+ ngx_conf_init_unsigned_value(ecf->connections, DEFAULT_CONNECTIONS);
- ngx_conf_unsigned_init_value(ecf->use, m);
+ ngx_conf_init_unsigned_value(ecf->use, m);
ngx_conf_init_ptr_value(ecf->name, module->name->data);
#endif