comparison src/event/ngx_event_acceptex.c @ 114:ac69ab96328d

nginx-0.0.1-2003-07-07-10:11:50 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 07 Jul 2003 06:11:50 +0000
parents 6dfda4cf5200
children 389d7ee9fa60
comparison
equal deleted inserted replaced
113:d7f606e25b99 114:ac69ab96328d
85 * so to find a connection we divide a socket number by 4. 85 * so to find a connection we divide a socket number by 4.
86 */ 86 */
87 87
88 if (s % 4) { 88 if (s % 4) {
89 ngx_log_error(NGX_LOG_EMERG, ls->log, 0, 89 ngx_log_error(NGX_LOG_EMERG, ls->log, 0,
90 ngx_socket_n " created socket %d", s); 90 ngx_socket_n
91 " created socket %d, not divisible by 4", s);
92
91 exit(1); 93 exit(1);
92 } 94 }
93 95
94 rev = &ngx_read_events[s / 4]; 96 c = &ngx_cycle->connections[s / 4];
95 wev = &ngx_write_events[s / 4]; 97 rev = &ngx_cycle->read_events[s / 4];
96 c = &ngx_connections[s / 4]; 98 wev = &ngx_cycle->write_events[s / 4];
97 99
100 ngx_memzero(c, sizeof(ngx_connection_t));
98 ngx_memzero(rev, sizeof(ngx_event_t)); 101 ngx_memzero(rev, sizeof(ngx_event_t));
99 ngx_memzero(wev, sizeof(ngx_event_t)); 102 ngx_memzero(wev, sizeof(ngx_event_t));
100 ngx_memzero(c, sizeof(ngx_connection_t));
101 103
102 rev->index = wev->index = NGX_INVALID_INDEX; 104 rev->index = wev->index = NGX_INVALID_INDEX;
103 105
104 rev->ovlp.event = rev; 106 rev->ovlp.event = rev;
105 wev->ovlp.event = wev; 107 wev->ovlp.event = wev;