Mercurial > hg > nginx
annotate src/event/modules/ngx_iocp_module.c @ 9320:cf73b65983c2 default tip
release-1.27.3 tag
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 13 Aug 2024 17:26:33 +0300 |
parents | d286426eab1a |
children |
rev | line source |
---|---|
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
1 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
4412 | 4 * Copyright (C) Nginx, Inc. |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
5 */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
6 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
7 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 #include <ngx_config.h> |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
9 #include <ngx_core.h> |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
10 #include <ngx_event.h> |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
11 #include <ngx_iocp_module.h> |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
12 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
13 |
563 | 14 static ngx_int_t ngx_iocp_init(ngx_cycle_t *cycle, ngx_msec_t timer); |
15 static ngx_thread_value_t __stdcall ngx_iocp_timer(void *data); | |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
16 static void ngx_iocp_done(ngx_cycle_t *cycle); |
1354
f69d1aab6a0f
make 64-bit ngx_int_t on 64-bit platforms
Igor Sysoev <igor@sysoev.ru>
parents:
667
diff
changeset
|
17 static ngx_int_t ngx_iocp_add_event(ngx_event_t *ev, ngx_int_t event, |
f69d1aab6a0f
make 64-bit ngx_int_t on 64-bit platforms
Igor Sysoev <igor@sysoev.ru>
parents:
667
diff
changeset
|
18 ngx_uint_t key); |
f69d1aab6a0f
make 64-bit ngx_int_t on 64-bit platforms
Igor Sysoev <igor@sysoev.ru>
parents:
667
diff
changeset
|
19 static ngx_int_t ngx_iocp_del_connection(ngx_connection_t *c, ngx_uint_t flags); |
563 | 20 static ngx_int_t ngx_iocp_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, |
21 ngx_uint_t flags); | |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
22 static void *ngx_iocp_create_conf(ngx_cycle_t *cycle); |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
23 static char *ngx_iocp_init_conf(ngx_cycle_t *cycle, void *conf); |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
24 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
25 |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
26 static ngx_str_t iocp_name = ngx_string("iocp"); |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
27 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
28 static ngx_command_t ngx_iocp_commands[] = { |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
29 |
6474 | 30 { ngx_string("iocp_threads"), |
31 NGX_EVENT_CONF|NGX_CONF_TAKE1, | |
32 ngx_conf_set_num_slot, | |
33 0, | |
34 offsetof(ngx_iocp_conf_t, threads), | |
35 NULL }, | |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
36 |
6474 | 37 { ngx_string("post_acceptex"), |
38 NGX_EVENT_CONF|NGX_CONF_TAKE1, | |
39 ngx_conf_set_num_slot, | |
40 0, | |
41 offsetof(ngx_iocp_conf_t, post_acceptex), | |
42 NULL }, | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
43 |
6474 | 44 { ngx_string("acceptex_read"), |
45 NGX_EVENT_CONF|NGX_CONF_FLAG, | |
46 ngx_conf_set_flag_slot, | |
47 0, | |
48 offsetof(ngx_iocp_conf_t, acceptex_read), | |
49 NULL }, | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
50 |
6474 | 51 ngx_null_command |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
52 }; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
53 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
54 |
6922
a72886067bbb
Added missing static specifiers.
Eran Kornblau <erankor@gmail.com>
parents:
6692
diff
changeset
|
55 static ngx_event_module_t ngx_iocp_module_ctx = { |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
56 &iocp_name, |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
57 ngx_iocp_create_conf, /* create configuration */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
58 ngx_iocp_init_conf, /* init configuration */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
59 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
60 { |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
61 ngx_iocp_add_event, /* add an event */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
62 NULL, /* delete an event */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
63 NULL, /* enable an event */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
64 NULL, /* disable an event */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
65 NULL, /* add an connection */ |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
66 ngx_iocp_del_connection, /* delete an connection */ |
6018
466bd63b63d1
Thread pools implementation.
Valentin Bartenev <vbart@nginx.com>
parents:
5872
diff
changeset
|
67 NULL, /* trigger a notify */ |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
68 ngx_iocp_process_events, /* process the events */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
69 ngx_iocp_init, /* init the events */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
70 ngx_iocp_done /* done the events */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
71 } |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
72 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
73 }; |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
74 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
75 ngx_module_t ngx_iocp_module = { |
509 | 76 NGX_MODULE_V1, |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
77 &ngx_iocp_module_ctx, /* module context */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
78 ngx_iocp_commands, /* module directives */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
79 NGX_EVENT_MODULE, /* module type */ |
541 | 80 NULL, /* init master */ |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
81 NULL, /* init module */ |
541 | 82 NULL, /* init process */ |
83 NULL, /* init thread */ | |
84 NULL, /* exit thread */ | |
85 NULL, /* exit process */ | |
86 NULL, /* exit master */ | |
87 NGX_MODULE_V1_PADDING | |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
88 }; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
89 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
90 |
184
1bf718ce0dde
nginx-0.0.1-2003-11-14-10:20:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
91 ngx_os_io_t ngx_iocp_io = { |
1bf718ce0dde
nginx-0.0.1-2003-11-14-10:20:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
92 ngx_overlapped_wsarecv, |
1bf718ce0dde
nginx-0.0.1-2003-11-14-10:20:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
93 NULL, |
1689 | 94 ngx_udp_overlapped_wsarecv, |
184
1bf718ce0dde
nginx-0.0.1-2003-11-14-10:20:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
95 NULL, |
6692 | 96 NULL, |
97 NULL, | |
461 | 98 ngx_overlapped_wsasend_chain, |
184
1bf718ce0dde
nginx-0.0.1-2003-11-14-10:20:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
99 0 |
1bf718ce0dde
nginx-0.0.1-2003-11-14-10:20:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
100 }; |
1bf718ce0dde
nginx-0.0.1-2003-11-14-10:20:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
101 |
1bf718ce0dde
nginx-0.0.1-2003-11-14-10:20:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
102 |
563 | 103 static HANDLE iocp; |
104 static ngx_tid_t timer_thread; | |
105 static ngx_msec_t msec; | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
106 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
107 |
501 | 108 static ngx_int_t |
563 | 109 ngx_iocp_init(ngx_cycle_t *cycle, ngx_msec_t timer) |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
110 { |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
111 ngx_iocp_conf_t *cf; |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
112 |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
113 cf = ngx_event_get_conf(cycle->conf_ctx, ngx_iocp_module); |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
114 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
115 if (iocp == NULL) { |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
116 iocp = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
117 cf->threads); |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
118 } |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
119 |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
120 if (iocp == NULL) { |
563 | 121 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
122 "CreateIoCompletionPort() failed"); |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
123 return NGX_ERROR; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
124 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
125 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
126 ngx_io = ngx_iocp_io; |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
127 |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
128 ngx_event_actions = ngx_iocp_module_ctx.actions; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
129 |
6125
4dc8e7b62216
Removed the obsolete aio module.
Ruslan Ermilov <ru@nginx.com>
parents:
6030
diff
changeset
|
130 ngx_event_flags = NGX_USE_IOCP_EVENT; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
131 |
563 | 132 if (timer == 0) { |
133 return NGX_OK; | |
134 } | |
135 | |
136 /* | |
137 * The waitable timer could not be used, because | |
138 * GetQueuedCompletionStatus() does not set a thread to alertable state | |
139 */ | |
140 | |
141 if (timer_thread == NULL) { | |
142 | |
143 msec = timer; | |
144 | |
145 if (ngx_create_thread(&timer_thread, ngx_iocp_timer, &msec, cycle->log) | |
146 != 0) | |
147 { | |
148 return NGX_ERROR; | |
149 } | |
150 } | |
151 | |
152 ngx_event_flags |= NGX_USE_TIMER_EVENT; | |
153 | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
154 return NGX_OK; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
155 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
156 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
157 |
563 | 158 static ngx_thread_value_t __stdcall |
159 ngx_iocp_timer(void *data) | |
160 { | |
161 ngx_msec_t timer = *(ngx_msec_t *) data; | |
162 | |
163 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ngx_cycle->log, 0, | |
164 "THREAD %p %p", &msec, data); | |
165 | |
166 for ( ;; ) { | |
167 Sleep(timer); | |
168 | |
3475
ab353d7dc182
*) introduce ngx_time_sigsafe_update() to update the error log time only
Igor Sysoev <igor@sysoev.ru>
parents:
3474
diff
changeset
|
169 ngx_time_update(); |
563 | 170 #if 1 |
171 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ngx_cycle->log, 0, "timer"); | |
172 #endif | |
173 } | |
174 | |
9315
d286426eab1a
Support for Clang with "-fgnuc-version=0".
Maxim Dounin <mdounin@mdounin.ru>
parents:
8064
diff
changeset
|
175 #if defined(__WATCOMC__) || defined(__GNUC__) || defined(__clang__) |
563 | 176 return 0; |
177 #endif | |
178 } | |
179 | |
180 | |
501 | 181 static void |
182 ngx_iocp_done(ngx_cycle_t *cycle) | |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
183 { |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
184 if (CloseHandle(iocp) == -1) { |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
185 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
186 "iocp CloseHandle() failed"); |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
187 } |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
188 |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
189 iocp = NULL; |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
190 } |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
191 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
192 |
501 | 193 static ngx_int_t |
1354
f69d1aab6a0f
make 64-bit ngx_int_t on 64-bit platforms
Igor Sysoev <igor@sysoev.ru>
parents:
667
diff
changeset
|
194 ngx_iocp_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t key) |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
195 { |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
196 ngx_connection_t *c; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
197 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
198 c = (ngx_connection_t *) ev->data; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
199 |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
200 c->read->active = 1; |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
201 c->write->active = 1; |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
202 |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
261
diff
changeset
|
203 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0, |
1354
f69d1aab6a0f
make 64-bit ngx_int_t on 64-bit platforms
Igor Sysoev <igor@sysoev.ru>
parents:
667
diff
changeset
|
204 "iocp add: fd:%d k:%ui ov:%p", c->fd, key, &ev->ovlp); |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
205 |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
206 if (CreateIoCompletionPort((HANDLE) c->fd, iocp, key, 0) == NULL) { |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
207 ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno, |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
208 "CreateIoCompletionPort() failed"); |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
209 return NGX_ERROR; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
210 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
211 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
212 return NGX_OK; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
213 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
214 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
215 |
501 | 216 static ngx_int_t |
1354
f69d1aab6a0f
make 64-bit ngx_int_t on 64-bit platforms
Igor Sysoev <igor@sysoev.ru>
parents:
667
diff
changeset
|
217 ngx_iocp_del_connection(ngx_connection_t *c, ngx_uint_t flags) |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
218 { |
461 | 219 #if 0 |
220 if (flags & NGX_CLOSE_EVENT) { | |
221 return NGX_OK; | |
222 } | |
223 | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
224 if (CancelIo((HANDLE) c->fd) == 0) { |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
225 ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno, "CancelIo() failed"); |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
226 return NGX_ERROR; |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
227 } |
461 | 228 #endif |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
229 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
230 return NGX_OK; |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
231 } |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
232 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
233 |
8064
5f5a34e83ca2
Events: fixed style and wrong error handling in the iocp module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6922
diff
changeset
|
234 static ngx_int_t |
5f5a34e83ca2
Events: fixed style and wrong error handling in the iocp module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6922
diff
changeset
|
235 ngx_iocp_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags) |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
236 { |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
237 int rc; |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
238 u_int key; |
280
7c7183b3ea8b
nginx-0.0.2-2004-03-05-11:34:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
239 u_long bytes; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
240 ngx_err_t err; |
563 | 241 ngx_msec_t delta; |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
242 ngx_event_t *ev; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
243 ngx_event_ovlp_t *ovlp; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
244 |
557 | 245 if (timer == NGX_TIMER_INFINITE) { |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
246 timer = INFINITE; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
247 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
248 |
557 | 249 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "iocp timer: %M", timer); |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
250 |
5872
de7ec5eef6d2
Win32: fixed wrong type cast.
Kouhei Sutou <kou@cozmixng.org>
parents:
5360
diff
changeset
|
251 rc = GetQueuedCompletionStatus(iocp, &bytes, (PULONG_PTR) &key, |
557 | 252 (LPOVERLAPPED *) &ovlp, (u_long) timer); |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
253 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
254 if (rc == 0) { |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
255 err = ngx_errno; |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
256 } else { |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
257 err = 0; |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
258 } |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
259 |
563 | 260 delta = ngx_current_msec; |
577 | 261 |
563 | 262 if (flags & NGX_UPDATE_TIME) { |
3475
ab353d7dc182
*) introduce ngx_time_sigsafe_update() to update the error log time only
Igor Sysoev <igor@sysoev.ru>
parents:
3474
diff
changeset
|
263 ngx_time_update(); |
563 | 264 } |
179
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
178
diff
changeset
|
265 |
302
1526e7686b20
nginx-0.0.3-2004-04-01-10:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
288
diff
changeset
|
266 ngx_log_debug4(NGX_LOG_DEBUG_EVENT, cycle->log, 0, |
461 | 267 "iocp: %d b:%d k:%d ov:%p", rc, bytes, key, ovlp); |
178
a8ff48d26cca
nginx-0.0.1-2003-11-11-00:09:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
144
diff
changeset
|
268 |
461 | 269 if (timer != INFINITE) { |
563 | 270 delta = ngx_current_msec - delta; |
461 | 271 |
272 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | |
557 | 273 "iocp timer: %M, delta: %M", timer, delta); |
461 | 274 } |
275 | |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
276 if (err) { |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
277 if (ovlp == NULL) { |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
278 if (err != WAIT_TIMEOUT) { |
302
1526e7686b20
nginx-0.0.3-2004-04-01-10:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
288
diff
changeset
|
279 ngx_log_error(NGX_LOG_ALERT, cycle->log, err, |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
280 "GetQueuedCompletionStatus() failed"); |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
281 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
282 return NGX_ERROR; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
283 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
284 |
461 | 285 return NGX_OK; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
286 } |
461 | 287 |
288 ovlp->error = err; | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
289 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
290 |
461 | 291 if (ovlp == NULL) { |
292 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, | |
293 "GetQueuedCompletionStatus() returned no operation"); | |
294 return NGX_ERROR; | |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
261
diff
changeset
|
295 } |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
261
diff
changeset
|
296 |
461 | 297 |
298 ev = ovlp->event; | |
299 | |
300 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, err, "iocp event:%p", ev); | |
301 | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
302 |
461 | 303 if (err == ERROR_NETNAME_DELETED /* the socket was closed */ |
304 || err == ERROR_OPERATION_ABORTED /* the operation was canceled */) | |
305 { | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
306 |
461 | 307 /* |
308 * the WSA_OPERATION_ABORTED completion notification | |
309 * for a file descriptor that was closed | |
310 */ | |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
261
diff
changeset
|
311 |
461 | 312 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, err, |
577 | 313 "iocp: aborted event %p", ev); |
461 | 314 |
315 return NGX_OK; | |
316 } | |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
317 |
461 | 318 if (err) { |
319 ngx_log_error(NGX_LOG_ALERT, cycle->log, err, | |
320 "GetQueuedCompletionStatus() returned operation error"); | |
321 } | |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
322 |
461 | 323 switch (key) { |
324 | |
325 case NGX_IOCP_ACCEPT: | |
326 if (bytes) { | |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
327 ev->ready = 1; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
328 } |
461 | 329 break; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
330 |
461 | 331 case NGX_IOCP_IO: |
332 ev->complete = 1; | |
333 ev->ready = 1; | |
334 break; | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
335 |
461 | 336 case NGX_IOCP_CONNECT: |
337 ev->ready = 1; | |
338 } | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
339 |
461 | 340 ev->available = bytes; |
341 | |
342 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | |
509 | 343 "iocp event handler: %p", ev->handler); |
461 | 344 |
509 | 345 ev->handler(ev); |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
346 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
347 return NGX_OK; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
348 } |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
349 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
350 |
501 | 351 static void * |
352 ngx_iocp_create_conf(ngx_cycle_t *cycle) | |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
353 { |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
354 ngx_iocp_conf_t *cf; |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
355 |
501 | 356 cf = ngx_palloc(cycle->pool, sizeof(ngx_iocp_conf_t)); |
357 if (cf == NULL) { | |
8064
5f5a34e83ca2
Events: fixed style and wrong error handling in the iocp module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6922
diff
changeset
|
358 return NULL; |
501 | 359 } |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
360 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
361 cf->threads = NGX_CONF_UNSET; |
288
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
362 cf->post_acceptex = NGX_CONF_UNSET; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
363 cf->acceptex_read = NGX_CONF_UNSET; |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
364 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
365 return cf; |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
366 } |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
367 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
368 |
501 | 369 static char * |
370 ngx_iocp_init_conf(ngx_cycle_t *cycle, void *conf) | |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
371 { |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
372 ngx_iocp_conf_t *cf = conf; |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
373 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
374 ngx_conf_init_value(cf->threads, 0); |
288
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
375 ngx_conf_init_value(cf->post_acceptex, 10); |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
376 ngx_conf_init_value(cf->acceptex_read, 1); |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
377 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
378 return NGX_CONF_OK; |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
379 } |