Mercurial > hg > nginx-quic
comparison src/event/modules/ngx_kqueue_module.c @ 93:738fe44c70d5
nginx-0.0.1-2003-05-21-17:28:21 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 21 May 2003 13:28:21 +0000 |
parents | 19cc647ecd91 |
children | b48066122884 |
comparison
equal
deleted
inserted
replaced
92:19cc647ecd91 | 93:738fe44c70d5 |
---|---|
64 ngx_kqueue_del_event, /* disable an event */ | 64 ngx_kqueue_del_event, /* disable an event */ |
65 NULL, /* add an connection */ | 65 NULL, /* add an connection */ |
66 NULL, /* delete an connection */ | 66 NULL, /* delete an connection */ |
67 ngx_kqueue_process_events, /* process the events */ | 67 ngx_kqueue_process_events, /* process the events */ |
68 ngx_kqueue_init, /* init the events */ | 68 ngx_kqueue_init, /* init the events */ |
69 ngx_kqueue_done, /* done the events */ | 69 ngx_kqueue_done /* done the events */ |
70 } | 70 } |
71 | 71 |
72 }; | 72 }; |
73 | 73 |
74 ngx_module_t ngx_kqueue_module = { | 74 ngx_module_t ngx_kqueue_module = { |
341 "kevent error on %d", event_list[i].ident); | 341 "kevent error on %d", event_list[i].ident); |
342 continue; | 342 continue; |
343 } | 343 } |
344 | 344 |
345 ev = (ngx_event_t *) event_list[i].udata; | 345 ev = (ngx_event_t *) event_list[i].udata; |
346 instance = (uintptr_t) ev & 1; | |
347 ev = (void *) ((uintptr_t) ev & ~1); | |
348 | |
349 /* It's a stale event from a file descriptor | |
350 that was just closed in this iteration */ | |
351 | |
352 if (ev->active == 0 || ev->instance != instance) { | |
353 ngx_log_debug(log, "stale kevent"); | |
354 continue; | |
355 } | |
356 | 346 |
357 switch (event_list[i].filter) { | 347 switch (event_list[i].filter) { |
358 | 348 |
359 case EVFILT_READ: | 349 case EVFILT_READ: |
360 case EVFILT_WRITE: | 350 case EVFILT_WRITE: |
351 | |
352 instance = (uintptr_t) ev & 1; | |
353 ev = (void *) ((uintptr_t) ev & ~1); | |
354 | |
355 /* It's a stale event from a file descriptor | |
356 that was just closed in this iteration */ | |
357 | |
358 if (ev->active == 0 || ev->instance != instance) { | |
359 ngx_log_debug(log, "stale kevent"); | |
360 continue; | |
361 } | |
361 | 362 |
362 ev->available = event_list[i].data; | 363 ev->available = event_list[i].data; |
363 | 364 |
364 if (event_list[i].flags & EV_EOF) { | 365 if (event_list[i].flags & EV_EOF) { |
365 ev->eof = 1; | 366 ev->eof = 1; |