comparison src/event/modules/ngx_iocp_module.c @ 501:d4ea69372b94 release-0.1.25

nginx-0.1.25-RELEASE import *) Bugfix: nginx did run on Linux parisc. *) Feature: nginx now does not start under FreeBSD if the sysctl kern.ipc.somaxconn value is too big. *) Bugfix: if a request was internally redirected by the ngx_http_index_module module to the ngx_http_proxy_module or ngx_http_fastcgi_module modules, then the index file was not closed after request completion. *) Feature: the "proxy_pass" can be used in location with regular expression. *) Feature: the ngx_http_rewrite_filter_module module supports the condition like "if ($HTTP_USER_AGENT ~ MSIE)". *) Bugfix: nginx started too slow if the large number of addresses and text values were used in the "geo" directive. *) Change: a variable name must be declared as "$name" in the "geo" directive. The previous variant without "$" is still supported, but will be removed soon. *) Feature: the "%{VARIABLE}v" logging parameter. *) Feature: the "set $name value" directive. *) Bugfix: gcc 4.0 compatibility. *) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
author Igor Sysoev <igor@sysoev.ru>
date Sat, 19 Mar 2005 12:38:37 +0000
parents a88a3e4e158f
children 9b8c906f6e63
comparison
equal deleted inserted replaced
500:9a0f304470f5 501:d4ea69372b94
88 88
89 89
90 static HANDLE iocp; 90 static HANDLE iocp;
91 91
92 92
93 static ngx_int_t ngx_iocp_init(ngx_cycle_t *cycle) 93 static ngx_int_t
94 ngx_iocp_init(ngx_cycle_t *cycle)
94 { 95 {
95 ngx_iocp_conf_t *cf; 96 ngx_iocp_conf_t *cf;
96 97
97 cf = ngx_event_get_conf(cycle->conf_ctx, ngx_iocp_module); 98 cf = ngx_event_get_conf(cycle->conf_ctx, ngx_iocp_module);
98 99
115 116
116 return NGX_OK; 117 return NGX_OK;
117 } 118 }
118 119
119 120
120 static void ngx_iocp_done(ngx_cycle_t *cycle) 121 static void
122 ngx_iocp_done(ngx_cycle_t *cycle)
121 { 123 {
122 if (CloseHandle(iocp) == -1) { 124 if (CloseHandle(iocp) == -1) {
123 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, 125 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
124 "iocp CloseHandle() failed"); 126 "iocp CloseHandle() failed");
125 } 127 }
126 128
127 iocp = NULL; 129 iocp = NULL;
128 } 130 }
129 131
130 132
131 static ngx_int_t ngx_iocp_add_event(ngx_event_t *ev, int event, u_int key) 133 static ngx_int_t
134 ngx_iocp_add_event(ngx_event_t *ev, int event, u_int key)
132 { 135 {
133 ngx_connection_t *c; 136 ngx_connection_t *c;
134 137
135 c = (ngx_connection_t *) ev->data; 138 c = (ngx_connection_t *) ev->data;
136 139
148 151
149 return NGX_OK; 152 return NGX_OK;
150 } 153 }
151 154
152 155
153 static ngx_int_t ngx_iocp_del_connection(ngx_connection_t *c, u_int flags) 156 static ngx_int_t
157 ngx_iocp_del_connection(ngx_connection_t *c, u_int flags)
154 { 158 {
155 #if 0 159 #if 0
156 if (flags & NGX_CLOSE_EVENT) { 160 if (flags & NGX_CLOSE_EVENT) {
157 return NGX_OK; 161 return NGX_OK;
158 } 162 }
165 169
166 return NGX_OK; 170 return NGX_OK;
167 } 171 }
168 172
169 173
170 static ngx_int_t ngx_iocp_process_events(ngx_cycle_t *cycle) 174 static
175 ngx_int_t ngx_iocp_process_events(ngx_cycle_t *cycle)
171 { 176 {
172 int rc; 177 int rc;
173 u_int key; 178 u_int key;
174 u_long bytes; 179 u_long bytes;
175 ngx_err_t err; 180 ngx_err_t err;
299 304
300 return NGX_OK; 305 return NGX_OK;
301 } 306 }
302 307
303 308
304 static void *ngx_iocp_create_conf(ngx_cycle_t *cycle) 309 static void *
310 ngx_iocp_create_conf(ngx_cycle_t *cycle)
305 { 311 {
306 ngx_iocp_conf_t *cf; 312 ngx_iocp_conf_t *cf;
307 313
308 ngx_test_null(cf, ngx_palloc(cycle->pool, sizeof(ngx_iocp_conf_t)), 314 cf = ngx_palloc(cycle->pool, sizeof(ngx_iocp_conf_t));
309 NGX_CONF_ERROR); 315 if (cf == NULL) {
316 return NGX_CONF_ERROR;
317 }
310 318
311 cf->threads = NGX_CONF_UNSET; 319 cf->threads = NGX_CONF_UNSET;
312 cf->post_acceptex = NGX_CONF_UNSET; 320 cf->post_acceptex = NGX_CONF_UNSET;
313 cf->acceptex_read = NGX_CONF_UNSET; 321 cf->acceptex_read = NGX_CONF_UNSET;
314 322
315 return cf; 323 return cf;
316 } 324 }
317 325
318 326
319 static char *ngx_iocp_init_conf(ngx_cycle_t *cycle, void *conf) 327 static char *
328 ngx_iocp_init_conf(ngx_cycle_t *cycle, void *conf)
320 { 329 {
321 ngx_iocp_conf_t *cf = conf; 330 ngx_iocp_conf_t *cf = conf;
322 331
323 ngx_conf_init_value(cf->threads, 0); 332 ngx_conf_init_value(cf->threads, 0);
324 ngx_conf_init_value(cf->post_acceptex, 10); 333 ngx_conf_init_value(cf->post_acceptex, 10);