comparison src/event/modules/ngx_devpoll_module.c @ 96:a23d010f356d

nginx-0.0.1-2003-05-27-16:18:54 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 27 May 2003 12:18:54 +0000
parents 738fe44c70d5
children a9bc21d63fe4
comparison
equal deleted inserted replaced
95:b48066122884 96:a23d010f356d
70 ngx_conf_set_num_slot, 70 ngx_conf_set_num_slot,
71 0, 71 0,
72 offsetof(ngx_devpoll_conf_t, events), 72 offsetof(ngx_devpoll_conf_t, events),
73 NULL}, 73 NULL},
74 74
75 {ngx_string(""), 0, NULL, 0, 0, NULL} 75 ngx_null_command
76 }; 76 };
77 77
78 78
79 ngx_event_module_t ngx_devpoll_module_ctx = { 79 ngx_event_module_t ngx_devpoll_module_ctx = {
80 NGX_EVENT_MODULE,
81 &devpoll_name, 80 &devpoll_name,
82 ngx_devpoll_create_conf, /* create configuration */ 81 ngx_devpoll_create_conf, /* create configuration */
83 ngx_devpoll_init_conf, /* init configuration */ 82 ngx_devpoll_init_conf, /* init configuration */
84 83
85 { 84 {
95 } 94 }
96 95
97 }; 96 };
98 97
99 ngx_module_t ngx_devpoll_module = { 98 ngx_module_t ngx_devpoll_module = {
99 NGX_MODULE,
100 &ngx_devpoll_module_ctx, /* module context */ 100 &ngx_devpoll_module_ctx, /* module context */
101 0, /* module index */
102 ngx_devpoll_commands, /* module directives */ 101 ngx_devpoll_commands, /* module directives */
103 NGX_EVENT_MODULE_TYPE, /* module type */ 102 NGX_EVENT_MODULE, /* module type */
104 NULL /* init module */ 103 NULL /* init module */
105 }; 104 };
106 105
107 106
108 static int ngx_devpoll_init(ngx_log_t *log) 107 static int ngx_devpoll_init(ngx_log_t *log)
109 { 108 {
110 ngx_devpoll_conf_t *dpcf; 109 ngx_devpoll_conf_t *dpcf;
111 110
112 dpcf = ngx_event_get_conf(ngx_devpoll_module_ctx); 111 dpcf = ngx_event_get_conf(ngx_devpoll_module);
113 112
114 ngx_log_debug(log, "CH: %d" _ dpcf->changes); 113 ngx_log_debug(log, "CH: %d" _ dpcf->changes);
115 ngx_log_debug(log, "EV: %d" _ dpcf->events); 114 ngx_log_debug(log, "EV: %d" _ dpcf->events);
116 115
117 max_changes = dpcf->changes; 116 max_changes = dpcf->changes;
192 static int ngx_devpoll_del_event(ngx_event_t *ev, int event, u_int flags) 191 static int ngx_devpoll_del_event(ngx_event_t *ev, int event, u_int flags)
193 { 192 {
194 ngx_event_t *e; 193 ngx_event_t *e;
195 194
196 #if (NGX_DEBUG_EVENT) 195 #if (NGX_DEBUG_EVENT)
197 ngx_connection_t *c = (ngx_connection_t *) ev->data; 196 ngx_connection_t *c = ev->data;
198 ngx_log_debug(c->log, "del event: %d, %d" _ c->fd _ event); 197 ngx_log_debug(c->log, "del event: %d, %d" _ c->fd _ event);
199 #endif 198 #endif
200 199
201 if (ngx_devpoll_set_event(ev, POLLREMOVE, flags) == NGX_ERROR) { 200 if (ngx_devpoll_set_event(ev, POLLREMOVE, flags) == NGX_ERROR) {
202 return NGX_ERROR; 201 return NGX_ERROR;
227 } 226 }
228 227
229 228
230 static int ngx_devpoll_set_event(ngx_event_t *ev, int event, u_int flags) 229 static int ngx_devpoll_set_event(ngx_event_t *ev, int event, u_int flags)
231 { 230 {
232 int n; 231 int n;
233 ngx_connection_t *c; 232 ngx_connection_t *c;
234 233
235 c = ev->data; 234 c = ev->data;
236 235
237 #if (NGX_DEBUG_EVENT) 236 #if (NGX_DEBUG_EVENT)