Mercurial > hg > nginx-vendor-current
annotate src/event/ngx_event_timer.h @ 122:d25a1d6034f1 NGINX_0_3_8
nginx 0.3.8
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; bug appeared
in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 09 Nov 2005 00:00:00 +0300 |
parents | 408f195b3482 |
children | 54fad6c4b555 |
rev | line source |
---|---|
0 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #ifndef _NGX_EVENT_TIMER_H_INCLUDED_ | |
8 #define _NGX_EVENT_TIMER_H_INCLUDED_ | |
9 | |
10 | |
11 #include <ngx_config.h> | |
12 #include <ngx_core.h> | |
13 #include <ngx_event.h> | |
14 | |
15 | |
50 | 16 #define NGX_TIMER_INFINITE (ngx_msec_t) -1 |
0 | 17 |
42 | 18 #define NGX_TIMER_LAZY_DELAY 300 |
19 | |
0 | 20 |
21 ngx_int_t ngx_event_timer_init(ngx_log_t *log); | |
22 ngx_msec_t ngx_event_find_timer(void); | |
106 | 23 void ngx_event_expire_timers(void); |
0 | 24 |
25 | |
26 #if (NGX_THREADS) | |
27 extern ngx_mutex_t *ngx_event_timer_mutex; | |
28 #endif | |
29 | |
30 | |
108 | 31 extern ngx_thread_volatile ngx_rbtree_t ngx_event_timer_rbtree; |
0 | 32 |
33 | |
42 | 34 static ngx_inline void |
35 ngx_event_del_timer(ngx_event_t *ev) | |
0 | 36 { |
37 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0, | |
106 | 38 "event timer del: %d: %M", |
108 | 39 ngx_event_ident(ev->data), ev->timer.key); |
0 | 40 |
112 | 41 ngx_mutex_lock(ngx_event_timer_mutex); |
0 | 42 |
108 | 43 ngx_rbtree_delete(&ngx_event_timer_rbtree, &ev->timer); |
0 | 44 |
45 ngx_mutex_unlock(ngx_event_timer_mutex); | |
46 | |
47 #if (NGX_DEBUG) | |
108 | 48 ev->timer.left = NULL; |
49 ev->timer.right = NULL; | |
50 ev->timer.parent = NULL; | |
0 | 51 #endif |
52 | |
53 ev->timer_set = 0; | |
54 } | |
55 | |
56 | |
42 | 57 static ngx_inline void |
58 ngx_event_add_timer(ngx_event_t *ev, ngx_msec_t timer) | |
0 | 59 { |
110 | 60 ngx_msec_t key; |
61 ngx_msec_int_t diff; | |
0 | 62 |
112 | 63 key = ngx_current_msec + timer; |
0 | 64 |
65 if (ev->timer_set) { | |
66 | |
67 /* | |
68 * Use the previous timer value if a difference between them is less | |
42 | 69 * then NGX_TIMER_LAZY_DELAY milliseconds. It allows to minimize |
70 * the rbtree operations for the fast connections. | |
0 | 71 */ |
72 | |
110 | 73 diff = (ngx_msec_int_t) (key - ev->timer.key); |
106 | 74 |
75 if (ngx_abs(diff) < NGX_TIMER_LAZY_DELAY) { | |
0 | 76 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0, |
106 | 77 "event timer: %d, old: %M, new: %M", |
108 | 78 ngx_event_ident(ev->data), ev->timer.key, key); |
0 | 79 return; |
80 } | |
81 | |
82 ngx_del_timer(ev); | |
83 } | |
84 | |
108 | 85 ev->timer.key = key; |
0 | 86 |
106 | 87 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0, |
88 "event timer add: %d: %M:%M", | |
108 | 89 ngx_event_ident(ev->data), timer, ev->timer.key); |
0 | 90 |
112 | 91 ngx_mutex_lock(ngx_event_timer_mutex); |
0 | 92 |
108 | 93 ngx_rbtree_insert(&ngx_event_timer_rbtree, &ev->timer); |
0 | 94 |
95 ngx_mutex_unlock(ngx_event_timer_mutex); | |
96 | |
97 ev->timer_set = 1; | |
98 } | |
99 | |
100 | |
101 #endif /* _NGX_EVENT_TIMER_H_INCLUDED_ */ |