comparison src/event/ngx_event.c @ 126:df17fbafec8f NGINX_0_3_10

nginx 0.3.10 *) Change: the "valid_referers" directive and the "$invalid_referer" variable were moved to the new ngx_http_referer_module from the ngx_http_rewrite_module. *) Change: the "$apache_bytes_sent" variable name was changed to "$body_bytes_sent". *) Feature: the "$sent_http_..." variables. *) Feature: the "if" directive supports the "=" and "!=" operations. *) Feature: the "proxy_pass" directive supports the HTTPS protocol. *) Feature: the "proxy_set_body" directive. *) Feature: the "post_action" directive. *) Feature: the ngx_http_empty_gif_module. *) Feature: the "worker_cpu_affinity" directive for Linux. *) Bugfix: the "rewrite" directive did not unescape URI part in redirect, now it is unescaped except the %00-%25 and %7F-%FF characters. *) Bugfix: nginx could not be built by the icc 9.0 compiler. *) Bugfix: if the SSI was enabled for zero size static file, then the chunked response was encoded incorrectly.
author Igor Sysoev <http://sysoev.ru>
date Tue, 15 Nov 2005 00:00:00 +0300
parents d25a1d6034f1
children 82d695e3d662
comparison
equal deleted inserted replaced
125:97504de1f89e 126:df17fbafec8f
85 NULL }, 85 NULL },
86 86
87 ngx_null_command 87 ngx_null_command
88 }; 88 };
89 89
90 90
91 static ngx_core_module_t ngx_events_module_ctx = { 91 static ngx_core_module_t ngx_events_module_ctx = {
92 ngx_string("events"), 92 ngx_string("events"),
93 NULL, 93 NULL,
94 NULL 94 NULL
95 }; 95 };
96 96
97 97
98 ngx_module_t ngx_events_module = { 98 ngx_module_t ngx_events_module = {
99 NGX_MODULE_V1, 99 NGX_MODULE_V1,
100 &ngx_events_module_ctx, /* module context */ 100 &ngx_events_module_ctx, /* module context */
278 278
279 ngx_int_t 279 ngx_int_t
280 ngx_handle_read_event(ngx_event_t *rev, u_int flags) 280 ngx_handle_read_event(ngx_event_t *rev, u_int flags)
281 { 281 {
282 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { 282 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
283 283
284 /* kqueue, epoll */ 284 /* kqueue, epoll */
285 285
286 if (!rev->active && !rev->ready) { 286 if (!rev->active && !rev->ready) {
287 if (ngx_add_event(rev, NGX_READ_EVENT, NGX_CLEAR_EVENT) 287 if (ngx_add_event(rev, NGX_READ_EVENT, NGX_CLEAR_EVENT)
288 == NGX_ERROR) 288 == NGX_ERROR)
289 { 289 {
290 return NGX_ERROR; 290 return NGX_ERROR;
291 } 291 }
292 } 292 }
293 293
294 return NGX_OK; 294 return NGX_OK;
295 295
296 } else if (ngx_event_flags & NGX_USE_LEVEL_EVENT) { 296 } else if (ngx_event_flags & NGX_USE_LEVEL_EVENT) {
297 297
298 /* select, poll, /dev/poll */ 298 /* select, poll, /dev/poll */
326 == NGX_ERROR) 326 == NGX_ERROR)
327 { 327 {
328 return NGX_ERROR; 328 return NGX_ERROR;
329 } 329 }
330 } 330 }
331 331
332 return NGX_OK; 332 return NGX_OK;
333 } 333 }
334 334
335 /* aio, iocp, rtsig */ 335 /* aio, iocp, rtsig */
336 336
399 == NGX_ERROR) 399 == NGX_ERROR)
400 { 400 {
401 return NGX_ERROR; 401 return NGX_ERROR;
402 } 402 }
403 } 403 }
404 404
405 return NGX_OK; 405 return NGX_OK;
406 } 406 }
407 407
408 /* aio, iocp, rtsig */ 408 /* aio, iocp, rtsig */
409 409
611 itv.it_value.tv_usec = (ngx_timer_resolution % 1000 ) * 1000; 611 itv.it_value.tv_usec = (ngx_timer_resolution % 1000 ) * 1000;
612 612
613 if (setitimer(ITIMER_REAL, &itv, NULL) == -1) { 613 if (setitimer(ITIMER_REAL, &itv, NULL) == -1) {
614 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, 614 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
615 "setitimer() failed"); 615 "setitimer() failed");
616 } 616 }
617 } 617 }
618 618
619 if (ngx_event_flags & NGX_USE_FD_EVENT) { 619 if (ngx_event_flags & NGX_USE_FD_EVENT) {
620 620
621 if (getrlimit(RLIMIT_NOFILE, &rlmt) == -1) { 621 if (getrlimit(RLIMIT_NOFILE, &rlmt) == -1) {
807 c->write->available = lowat; 807 c->write->available = lowat;
808 return NGX_OK; 808 return NGX_OK;
809 } 809 }
810 810
811 #endif 811 #endif
812 812
813 if (lowat == 0 || c->sndlowat) { 813 if (lowat == 0 || c->sndlowat) {
814 return NGX_OK; 814 return NGX_OK;
815 } 815 }
816 816
817 sndlowat = (int) lowat; 817 sndlowat = (int) lowat;