Mercurial > hg > nginx-vendor-0-7
annotate src/event/ngx_event_posted.c @ 58:b55cbf18157e NGINX_0_1_29
nginx 0.1.29
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; bug appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Thu, 12 May 2005 00:00:00 +0400 |
parents | 72eb30262aac |
children | 408f195b3482 |
rev | line source |
---|---|
0 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #include <ngx_config.h> | |
8 #include <ngx_core.h> | |
9 #include <ngx_event.h> | |
10 | |
11 | |
12 ngx_thread_volatile ngx_event_t *ngx_posted_events; | |
13 | |
14 #if (NGX_THREADS) | |
15 ngx_mutex_t *ngx_posted_events_mutex; | |
16 #endif | |
17 | |
18 | |
19 void ngx_event_process_posted(ngx_cycle_t *cycle) | |
20 { | |
21 ngx_event_t *ev; | |
22 | |
23 for ( ;; ) { | |
24 | |
25 ev = (ngx_event_t *) ngx_posted_events; | |
26 | |
27 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | |
10 | 28 "posted event %p", ev); |
0 | 29 |
30 if (ev == NULL) { | |
31 return; | |
32 } | |
33 | |
34 ngx_delete_posted_event(ev); | |
35 | |
58 | 36 ev->handler(ev); |
0 | 37 } |
38 } | |
39 | |
40 | |
10 | 41 #if (NGX_THREADS) && !(NGX_WIN32) |
0 | 42 |
43 void ngx_wakeup_worker_thread(ngx_cycle_t *cycle) | |
44 { | |
45 ngx_int_t i; | |
50 | 46 #if 0 |
0 | 47 ngx_uint_t busy; |
48 ngx_event_t *ev; | |
49 | |
50 busy = 1; | |
51 | |
52 if (ngx_mutex_lock(ngx_posted_events_mutex) == NGX_ERROR) { | |
53 return; | |
54 } | |
55 | |
56 for (ev = (ngx_event_t *) ngx_posted_events; ev; ev = ev->next) { | |
57 if (*(ev->lock) == 0) { | |
58 busy = 0; | |
59 break; | |
60 } | |
61 } | |
62 | |
63 ngx_mutex_unlock(ngx_posted_events_mutex); | |
64 | |
65 if (busy) { | |
66 return; | |
67 } | |
68 #endif | |
69 | |
70 for (i = 0; i < ngx_threads_n; i++) { | |
71 if (ngx_threads[i].state == NGX_THREAD_FREE) { | |
72 ngx_cond_signal(ngx_threads[i].cv); | |
73 return; | |
74 } | |
75 } | |
76 } | |
77 | |
78 | |
79 ngx_int_t ngx_event_thread_process_posted(ngx_cycle_t *cycle) | |
80 { | |
81 ngx_event_t *ev; | |
82 | |
83 for ( ;; ) { | |
84 | |
85 ev = (ngx_event_t *) ngx_posted_events; | |
86 | |
87 for ( ;; ) { | |
88 | |
89 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | |
10 | 90 "posted event %p", ev); |
0 | 91 |
92 if (ev == NULL) { | |
93 return NGX_OK; | |
94 } | |
95 | |
96 if (ngx_trylock(ev->lock) == 0) { | |
97 | |
98 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | |
10 | 99 "posted event %p is busy", ev); |
0 | 100 |
101 ev = ev->next; | |
102 continue; | |
103 } | |
104 | |
105 if (ev->lock != ev->own_lock) { | |
106 if (*(ev->own_lock)) { | |
107 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, | |
10 | 108 "the own lock of the posted event %p is busy", ev); |
0 | 109 ngx_unlock(ev->lock); |
110 ev = ev->next; | |
111 continue; | |
112 } | |
113 *(ev->own_lock) = 1; | |
114 } | |
115 | |
116 ngx_delete_posted_event(ev); | |
117 | |
118 ev->locked = 1; | |
119 | |
120 ev->ready |= ev->posted_ready; | |
121 ev->timedout |= ev->posted_timedout; | |
122 ev->pending_eof |= ev->posted_eof; | |
18 | 123 #if (NGX_HAVE_KQUEUE) |
0 | 124 ev->kq_errno |= ev->posted_errno; |
125 #endif | |
126 if (ev->posted_available) { | |
127 ev->available = ev->posted_available; | |
128 } | |
129 | |
130 ev->posted_ready = 0; | |
131 ev->posted_timedout = 0; | |
132 ev->posted_eof = 0; | |
18 | 133 #if (NGX_HAVE_KQUEUE) |
0 | 134 ev->posted_errno = 0; |
135 #endif | |
136 ev->posted_available = 0; | |
137 | |
138 ngx_mutex_unlock(ngx_posted_events_mutex); | |
139 | |
58 | 140 ev->handler(ev); |
0 | 141 |
142 if (ngx_mutex_lock(ngx_posted_events_mutex) == NGX_ERROR) { | |
143 return NGX_ERROR; | |
144 } | |
145 | |
146 if (ev->locked) { | |
147 ngx_unlock(ev->lock); | |
148 | |
149 if (ev->lock != ev->own_lock) { | |
150 ngx_unlock(ev->own_lock); | |
151 } | |
152 } | |
153 | |
154 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | |
10 | 155 "posted event %p is done", ev); |
0 | 156 |
157 break; | |
158 } | |
159 } | |
160 } | |
161 | |
162 #else | |
163 | |
164 void ngx_wakeup_worker_thread(ngx_cycle_t *cycle) | |
165 { | |
166 } | |
167 | |
168 #endif |