comparison src/event/ngx_event.h @ 218:05592fd7a436

nginx-0.0.1-2004-01-05-23:55:48 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 05 Jan 2004 20:55:48 +0000
parents e1c815be05ae
children 5d4f49dc8de5
comparison
equal deleted inserted replaced
217:c5d1cdcb04ec 218:05592fd7a436
18 } ngx_event_ovlp_t; 18 } ngx_event_ovlp_t;
19 19
20 #endif 20 #endif
21 21
22 22
23 typedef enum {
24 NGX_ERROR_CRIT = 0,
25 NGX_ERROR_ERR,
26 NGX_ERROR_INFO,
27 NGX_ERROR_IGNORE_ECONNRESET
28 } ngx_event_log_error_e;
29
30
23 struct ngx_event_s { 31 struct ngx_event_s {
24 void *data; 32 void *data;
25 /* TODO rename to handler */ 33 /* TODO rename to handler */
26 void (*event_handler)(ngx_event_t *ev); 34 void (*event_handler)(ngx_event_t *ev);
27 35
34 ngx_log_t *log; 42 ngx_log_t *log;
35 43
36 /* 44 /*
37 * The inline of "ngx_rbtree_t rbtree;". 45 * The inline of "ngx_rbtree_t rbtree;".
38 * 46 *
39 * It allows to pack the rbtree_color and the variuos event bit flags into 47 * It allows to pack the rbtree_color and the various event bit flags into
40 * the single "int". We also use "unsigned char" and then "usigned short" 48 * the single "int". We also use "unsigned char" and then "unsigned short"
41 * because otherwise MSVC 6.0 uses an additional "int" for the bit flags. 49 * because otherwise MSVC 6.0 uses an additional "int" for the bit flags.
42 * We use "char rbtree_color" instead of "unsigned int rbtree_color:1" 50 * We use "char rbtree_color" instead of "unsigned int rbtree_color:1"
43 * because it preserves the bits order on the big endian platforms. 51 * because it preserves the bits order on the big endian platforms.
44 */ 52 */
45 53
60 * the event was passed or would be passed to a kernel; 68 * the event was passed or would be passed to a kernel;
61 * in aio mode - operation was posted. 69 * in aio mode - operation was posted.
62 */ 70 */
63 unsigned char active:1; 71 unsigned char active:1;
64 72
73 unsigned char disabled:1;
74
65 /* the ready event; in aio mode 0 means that no operation can be posted */ 75 /* the ready event; in aio mode 0 means that no operation can be posted */
66 unsigned char ready:1; 76 unsigned char ready:1;
67 77
68 /* aio operation is complete */ 78 /* aio operation is complete */
69 unsigned char complete:1; 79 unsigned char complete:1;
70 80
71 unsigned char eof:1; 81 unsigned short eof:1;
72 unsigned char error:1; 82 unsigned short error:1;
73 83
74 unsigned short timedout:1; 84 unsigned short timedout:1;
75 unsigned short timer_set:1; 85 unsigned short timer_set:1;
76 86
77 unsigned short delayed:1; 87 unsigned short delayed:1;
78 88
79 unsigned short read_discarded:1; 89 unsigned short read_discarded:1;
80 90
81 unsigned short ignore_econnreset:1; 91 unsigned short log_error:2; /* ngx_event_log_error_e */
82 unsigned short unexpected_eof:1; 92 unsigned short unexpected_eof:1;
83 93
84 unsigned short deferred_accept:1; 94 unsigned short deferred_accept:1;
85 95
86 /* TODO: aio_eof and kq_eof can be the single pending_eof */ 96 /* TODO: aio_eof and kq_eof can be the single pending_eof */
369 void ngx_event_acceptex(ngx_event_t *ev); 379 void ngx_event_acceptex(ngx_event_t *ev);
370 int ngx_event_post_acceptex(ngx_listening_t *ls, int n); 380 int ngx_event_post_acceptex(ngx_listening_t *ls, int n);
371 #endif 381 #endif
372 382
373 383
384 /* used in ngx_log_debugX() */
385 #define ngx_event_ident(p) ((ngx_connection_t *) (p))->fd
386
374 387
375 #include <ngx_event_timer.h> 388 #include <ngx_event_timer.h>
376 389
377 #if (WIN32) 390 #if (WIN32)
378 #include <ngx_iocp_module.h> 391 #include <ngx_iocp_module.h>