Mercurial > hg > nginx
annotate src/event/ngx_event_timer.c @ 66:4876cd4a36bb
nginx-0.0.1-2003-03-05-20:30:51 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 05 Mar 2003 17:30:51 +0000 |
parents | d1e42f1b8fd4 |
children | 57c2e18d3572 |
rev | line source |
---|---|
50
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
1 |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
2 #include <ngx_config.h> |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
3 |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
4 #include <ngx_core.h> |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
5 #include <ngx_log.h> |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
6 #include <ngx_alloc.h> |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
7 #include <ngx_connection.h> |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
8 #include <ngx_event.h> |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
9 |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
10 #include <ngx_event_timer.h> |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
11 |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
12 /* STUB */ |
53
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
13 #define NGX_TIMER_QUEUE_NUM 5 |
50
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
14 |
53
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
15 /* should be per-thread */ |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
16 static ngx_event_t *ngx_timer_queue; |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
17 static int ngx_timer_cur_queue; |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
18 /* */ |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
19 static int ngx_timer_queue_num; |
49
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
20 |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
21 |
53
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
22 ngx_event_t *ngx_event_init_timer(ngx_log_t *log) |
49
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
23 { |
50
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
24 int i; |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
25 |
53
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
26 ngx_timer_queue_num = NGX_TIMER_QUEUE_NUM; |
52
9f2728644651
nginx-0.0.1-2003-01-24-19:09:40 import
Igor Sysoev <igor@sysoev.ru>
parents:
51
diff
changeset
|
27 ngx_timer_cur_queue = 0; |
50
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
28 |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
29 ngx_test_null(ngx_timer_queue, |
53
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
30 ngx_alloc(ngx_timer_queue_num * sizeof(ngx_event_t), log), |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
31 NULL); |
50
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
32 |
53
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
33 for (i = 0; i < ngx_timer_queue_num; i++) { |
50
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
34 ngx_timer_queue[i].timer_prev = &ngx_timer_queue[i]; |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
35 ngx_timer_queue[i].timer_next = &ngx_timer_queue[i]; |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
36 } |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
37 |
53
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
38 return ngx_timer_queue; |
50
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
39 } |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
40 |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
41 |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
42 void ngx_event_add_timer(ngx_event_t *ev, ngx_msec_t timer) |
b288069a8696
nginx-0.0.1-2003-01-23-21:47:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
49
diff
changeset
|
43 { |
49
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
44 ngx_event_t *e; |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
45 |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
46 #if (NGX_DEBUG_EVENT) |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
47 ngx_connection_t *c = (ngx_connection_t *) ev->data; |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
48 ngx_log_debug(ev->log, "set timer: %d:%d" _ c->fd _ timer); |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
49 #endif |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
50 |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
51 if (ev->timer_next || ev->timer_prev) { |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
52 ngx_log_error(NGX_LOG_ALERT, ev->log, 0, "timer already set"); |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
53 return; |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
54 } |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
55 |
51
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
56 #if (NGX_DEBUG_EVENT) |
52
9f2728644651
nginx-0.0.1-2003-01-24-19:09:40 import
Igor Sysoev <igor@sysoev.ru>
parents:
51
diff
changeset
|
57 ngx_log_debug(ev->log, "timer slot: %d" _ ngx_timer_cur_queue); |
51
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
58 #endif |
49
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
59 |
52
9f2728644651
nginx-0.0.1-2003-01-24-19:09:40 import
Igor Sysoev <igor@sysoev.ru>
parents:
51
diff
changeset
|
60 for (e = ngx_timer_queue[ngx_timer_cur_queue].timer_next; |
9f2728644651
nginx-0.0.1-2003-01-24-19:09:40 import
Igor Sysoev <igor@sysoev.ru>
parents:
51
diff
changeset
|
61 e != &ngx_timer_queue[ngx_timer_cur_queue] && timer > e->timer_delta; |
49
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
62 e = e->timer_next) |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
63 { |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
64 timer -= e->timer_delta; |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
65 } |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
66 |
52
9f2728644651
nginx-0.0.1-2003-01-24-19:09:40 import
Igor Sysoev <igor@sysoev.ru>
parents:
51
diff
changeset
|
67 ngx_timer_cur_queue++; |
53
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
68 if (ngx_timer_cur_queue >= ngx_timer_queue_num) { |
52
9f2728644651
nginx-0.0.1-2003-01-24-19:09:40 import
Igor Sysoev <igor@sysoev.ru>
parents:
51
diff
changeset
|
69 ngx_timer_cur_queue = 0; |
9f2728644651
nginx-0.0.1-2003-01-24-19:09:40 import
Igor Sysoev <igor@sysoev.ru>
parents:
51
diff
changeset
|
70 } |
9f2728644651
nginx-0.0.1-2003-01-24-19:09:40 import
Igor Sysoev <igor@sysoev.ru>
parents:
51
diff
changeset
|
71 |
49
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
72 ev->timer_delta = timer; |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
73 |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
74 ev->timer_next = e; |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
75 ev->timer_prev = e->timer_prev; |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
76 |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
77 e->timer_prev->timer_next = ev; |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
78 e->timer_prev = ev; |
c091d5b853c8
nginx-0.0.1-2003-01-21-20:36:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
79 } |
51
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
80 |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
81 |
53
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
82 int ngx_event_find_timer(void) |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
83 { |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
84 int i; |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
85 ngx_msec_t timer; |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
86 |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
87 timer = NGX_MAX_MSEC; |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
88 |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
89 for (i = 0; i < ngx_timer_queue_num; i++) { |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
90 if (ngx_timer_queue[i].timer_next == &ngx_timer_queue[i]) { |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
91 continue; |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
92 } |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
93 |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
94 if (timer > ngx_timer_queue[i].timer_next->timer_delta) { |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
95 timer = ngx_timer_queue[i].timer_next->timer_delta; |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
96 } |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
97 } |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
98 |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
99 if (timer == NGX_MAX_MSEC) { |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
100 return 0; |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
101 } else { |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
102 return timer; |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
103 } |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
104 } |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
105 |
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
106 |
51
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
107 void ngx_event_expire_timers(ngx_msec_t timer) |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
108 { |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
109 int i; |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
110 ngx_msec_t delta; |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
111 ngx_event_t *ev; |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
112 |
53
d1e42f1b8fd4
nginx-0.0.1-2003-01-27-00:08:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
52
diff
changeset
|
113 for (i = 0; i < ngx_timer_queue_num; i++) { |
51
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
114 |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
115 delta = timer; |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
116 |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
117 for ( ;; ) { |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
118 ev = ngx_timer_queue[i].timer_next; |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
119 |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
120 if (ev == &ngx_timer_queue[i]) { |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
121 break; |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
122 } |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
123 |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
124 if (ev->timer_delta > delta) { |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
125 ev->timer_delta -= delta; |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
126 break; |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
127 } |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
128 |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
129 delta -= ev->timer_delta; |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
130 |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
131 ngx_del_timer(ev); |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
132 ev->timedout = 1; |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
133 |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
134 if (ev->event_handler(ev) == NGX_ERROR) { |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
135 ev->close_handler(ev); |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
136 } |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
137 } |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
138 } |
a6afbb8a2ada
nginx-0.0.1-2003-01-24-09:20:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
50
diff
changeset
|
139 } |