summaryrefslogtreecommitdiffhomepage
path: root/src/event
diff options
context:
space:
mode:
Diffstat (limited to 'src/event')
-rw-r--r--src/event/modules/ngx_epoll_module.c8
-rw-r--r--src/event/ngx_event.c4
2 files changed, 7 insertions, 5 deletions
diff --git a/src/event/modules/ngx_epoll_module.c b/src/event/modules/ngx_epoll_module.c
index a2eeab08d..907d6aeb5 100644
--- a/src/event/modules/ngx_epoll_module.c
+++ b/src/event/modules/ngx_epoll_module.c
@@ -229,7 +229,7 @@ static int ngx_epoll_add_event(ngx_event_t *ev, int event, u_int flags)
}
ee.events = event | flags;
- ee.data.ptr = (void *) ((uintptr_t) c | ev->instance);
+ ee.data.u64 = (uintptr_t) c | ev->instance;
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,
"epoll add event: fd:%d op:%d ev:%08XD",
@@ -282,7 +282,7 @@ static int ngx_epoll_del_event(ngx_event_t *ev, int event, u_int flags)
if (e->active) {
op = EPOLL_CTL_MOD;
ee.events = prev | flags;
- ee.data.ptr = (void *) ((uintptr_t) c | ev->instance);
+ ee.data.u64 = (uintptr_t) c | ev->instance;
} else {
op = EPOLL_CTL_DEL;
@@ -311,7 +311,7 @@ static int ngx_epoll_add_connection(ngx_connection_t *c)
struct epoll_event ee;
ee.events = EPOLLIN|EPOLLOUT|EPOLLET;
- ee.data.ptr = (void *) ((uintptr_t) c | c->read->instance);
+ ee.data.u64 = (uintptr_t) c | c->read->instance;
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"epoll add connection: fd:%d ev:%08XD", c->fd, ee.events);
@@ -351,7 +351,7 @@ static int ngx_epoll_del_connection(ngx_connection_t *c, u_int flags)
op = EPOLL_CTL_DEL;
ee.events = 0;
- ee.data.ptr = NULL;
+ ee.data.u64 = 0;
if (epoll_ctl(ep, op, c->fd, &ee) == -1) {
ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
diff --git a/src/event/ngx_event.c b/src/event/ngx_event.c
index ef25ffc51..9960225fc 100644
--- a/src/event/ngx_event.c
+++ b/src/event/ngx_event.c
@@ -318,6 +318,7 @@ static ngx_int_t ngx_event_process_init(ngx_cycle_t *cycle)
rev = cycle->read_events;
for (i = 0; i < cycle->connection_n; i++) {
rev[i].closed = 1;
+ rev[i].instance = 1;
#if (NGX_THREADS)
rev[i].lock = &c[i].lock;
rev[i].own_lock = &c[i].lock;
@@ -325,7 +326,7 @@ static ngx_int_t ngx_event_process_init(ngx_cycle_t *cycle)
}
cycle->write_events = ngx_alloc(sizeof(ngx_event_t) * ecf->connections,
- cycle->log);
+ cycle->log);
if (cycle->write_events == NULL) {
return NGX_ERROR;
}
@@ -361,6 +362,7 @@ static ngx_int_t ngx_event_process_init(ngx_cycle_t *cycle)
ngx_memzero(c, sizeof(ngx_connection_t));
ngx_memzero(rev, sizeof(ngx_event_t));
+ ngx_memzero(wev, sizeof(ngx_event_t));
c->fd = s[i].fd;
c->listening = &s[i];