comparison src/event/ngx_event.c @ 8:708f8bb772ec

nginx-0.0.1-2002-09-02-18:48:24 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 02 Sep 2002 14:48:24 +0000
parents b5481d6fbbd4
children f323b4f74e4a
comparison
equal deleted inserted replaced
7:b5481d6fbbd4 8:708f8bb772ec
1 1
2 #include <ngx_config.h> 2 #include <ngx_config.h>
3 #include <ngx_types.h> 3 #include <ngx_types.h>
4 #include <ngx_string.h>
4 #include <ngx_log.h> 5 #include <ngx_log.h>
5 #include <ngx_alloc.h> 6 #include <ngx_alloc.h>
6 #include <ngx_listen.h> 7 #include <ngx_listen.h>
7 #include <ngx_connection.h> 8 #include <ngx_connection.h>
8 #include <ngx_event.h> 9 #include <ngx_event.h>
17 ngx_connection_t *ngx_connections; 18 ngx_connection_t *ngx_connections;
18 ngx_event_t *ngx_read_events, *ngx_write_events; 19 ngx_event_t *ngx_read_events, *ngx_write_events;
19 20
20 #if !(USE_KQUEUE) 21 #if !(USE_KQUEUE)
21 22
22 #if 0 23 #if 1
23 ngx_event_type_e ngx_event_type = NGX_SELECT_EVENT; 24 ngx_event_type_e ngx_event_type = NGX_SELECT_EVENT;
24 #else 25 #else
25 ngx_event_type_e ngx_event_type = NGX_KQUEUE_EVENT; 26 ngx_event_type_e ngx_event_type = NGX_KQUEUE_EVENT;
26 #endif 27 #endif
27 28
76 77
77 ngx_connections[fd].server = s[i].server; 78 ngx_connections[fd].server = s[i].server;
78 ngx_connections[fd].handler = s[i].handler; 79 ngx_connections[fd].handler = s[i].handler;
79 ngx_connections[fd].log = s[i].log; 80 ngx_connections[fd].log = s[i].log;
80 81
81 ngx_read_events[fd].log = ngx_connections[fd].log; 82 ngx_test_null(ngx_read_events[fd].log,
83 ngx_palloc(pool, sizeof(ngx_log_t)), /* void */ ; );
84 ngx_memcpy(ngx_read_events[fd].log, ngx_connections[fd].log,
85 sizeof(ngx_log_t));
82 ngx_read_events[fd].data = &ngx_connections[fd]; 86 ngx_read_events[fd].data = &ngx_connections[fd];
83 ngx_read_events[fd].event_handler = &ngx_event_accept; 87 ngx_read_events[fd].event_handler = &ngx_event_accept;
84 ngx_read_events[fd].listening = 1; 88 ngx_read_events[fd].listening = 1;
85 89
86 ngx_read_events[fd].available = 0; 90 ngx_read_events[fd].available = 0;