comparison src/event/ngx_event_busy_lock.c @ 328:26ff8d6b618d NGINX_0_5_34

nginx 0.5.34 *) Change: now the full request line instead of URI only is written to error_log. *) Feature: Cygwin compatibility. Thanks to Vladimir Kutakov. *) Feature: the "merge_slashes" directive. *) Feature: the "gzip_vary" directive. *) Feature: the "server_tokens" directive. *) Feature: the "access_log" directive may be used inside the "limit_except" block. *) Bugfix: if the $server_protocol was used in FastCGI parameters and a request line length was near to the "client_header_buffer_size" directive value, then nginx issued an alert "fastcgi: the request record is too big". *) Bugfix: if a plain text HTTP/0.9 version request was made to HTTPS server, then nginx returned usual response. *) Bugfix: URL double escaping in a redirect of the "msie_refresh" directive; bug appeared in 0.5.28. *) Bugfix: a segmentation fault might occur in worker process if subrequests were used. *) Bugfix: the big responses may be transferred truncated if SSL and gzip were used. *) Bugfix: compatibility with mget. *) Bugfix: nginx did not unescape URI in the "include" SSI command. *) Bugfix: the segmentation fault was occurred on start or while reconfiguration if variable was used in the "charset" or "source_charset" directives. *) Bugfix: nginx returned the 400 response on requests like "GET http://www.domain.com HTTP/1.0". Thanks to James Oakley. *) Bugfix: a segmentation fault occurred in worker process if $date_local and $date_gmt were used outside the ngx_http_ssi_filter_module. *) Bugfix: a segmentation fault might occur in worker process if debug log was enabled. Thanks to Andrei Nigmatulin. *) Bugfix: ngx_http_memcached_module did not set $upstream_response_time. Thanks to Maxim Dounin. *) Bugfix: a worker process may got caught in an endless loop, if the memcached was used.
author Igor Sysoev <http://sysoev.ru>
date Thu, 13 Dec 2007 00:00:00 +0300
parents f70f2f565fe0
children
comparison
equal deleted inserted replaced
327:cb962a94cd7b 328:26ff8d6b618d
7 #include <ngx_config.h> 7 #include <ngx_config.h>
8 #include <ngx_core.h> 8 #include <ngx_core.h>
9 #include <ngx_event.h> 9 #include <ngx_event.h>
10 10
11 11
12 static ngx_int_t ngx_event_busy_lock_look_cachable(ngx_event_busy_lock_t *bl, 12 static ngx_int_t ngx_event_busy_lock_look_cacheable(ngx_event_busy_lock_t *bl,
13 ngx_event_busy_lock_ctx_t *ctx); 13 ngx_event_busy_lock_ctx_t *ctx);
14 static void ngx_event_busy_lock_handler(ngx_event_t *ev); 14 static void ngx_event_busy_lock_handler(ngx_event_t *ev);
15 static void ngx_event_busy_lock_posted_handler(ngx_event_t *ev); 15 static void ngx_event_busy_lock_posted_handler(ngx_event_t *ev);
16 16
17 17
63 return rc; 63 return rc;
64 } 64 }
65 65
66 66
67 ngx_int_t 67 ngx_int_t
68 ngx_event_busy_lock_cachable(ngx_event_busy_lock_t *bl, 68 ngx_event_busy_lock_cacheable(ngx_event_busy_lock_t *bl,
69 ngx_event_busy_lock_ctx_t *ctx) 69 ngx_event_busy_lock_ctx_t *ctx)
70 { 70 {
71 ngx_int_t rc; 71 ngx_int_t rc;
72 72
73 ngx_mutex_lock(bl->mutex); 73 ngx_mutex_lock(bl->mutex);
74 74
75 rc = ngx_event_busy_lock_look_cachable(bl, ctx); 75 rc = ngx_event_busy_lock_look_cacheable(bl, ctx);
76 76
77 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ctx->event->log, 0, 77 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ctx->event->log, 0,
78 "event busy lock: %d w:%d mw:%d", 78 "event busy lock: %d w:%d mw:%d",
79 rc, bl->waiting, bl->max_waiting); 79 rc, bl->waiting, bl->max_waiting);
80 80
199 ngx_mutex_unlock(bl->mutex); 199 ngx_mutex_unlock(bl->mutex);
200 } 200 }
201 201
202 202
203 static ngx_int_t 203 static ngx_int_t
204 ngx_event_busy_lock_look_cachable(ngx_event_busy_lock_t *bl, 204 ngx_event_busy_lock_look_cacheable(ngx_event_busy_lock_t *bl,
205 ngx_event_busy_lock_ctx_t *ctx) 205 ngx_event_busy_lock_ctx_t *ctx)
206 { 206 {
207 ngx_int_t free; 207 ngx_int_t free;
208 ngx_uint_t i, bit, cachable, mask; 208 ngx_uint_t i, bit, cacheable, mask;
209 209
210 bit = 0; 210 bit = 0;
211 cachable = 0; 211 cacheable = 0;
212 free = -1; 212 free = -1;
213 213
214 #if (NGX_SUPPRESS_WARN) 214 #if (NGX_SUPPRESS_WARN)
215 mask = 0; 215 mask = 0;
216 #endif 216 #endif
225 if (ngx_memcmp(&bl->md5[i * 16], ctx->md5, 16) == 0) { 225 if (ngx_memcmp(&bl->md5[i * 16], ctx->md5, 16) == 0) {
226 ctx->waiting = 1; 226 ctx->waiting = 1;
227 ctx->slot = i; 227 ctx->slot = i;
228 return NGX_AGAIN; 228 return NGX_AGAIN;
229 } 229 }
230 cachable++; 230 cacheable++;
231 231
232 } else if (free == -1) { 232 } else if (free == -1) {
233 free = i; 233 free = i;
234 } 234 }
235 235
236 if (cachable == bl->cachable) { 236 if (cacheable == bl->cacheable) {
237 if (free == -1 && cachable < bl->max_busy) { 237 if (free == -1 && cacheable < bl->max_busy) {
238 free = i + 1; 238 free = i + 1;
239 } 239 }
240 240
241 break; 241 break;
242 } 242 }
257 257
258 ngx_memcpy(&bl->md5[free * 16], ctx->md5, 16); 258 ngx_memcpy(&bl->md5[free * 16], ctx->md5, 16);
259 bl->md5_mask[free / 8] |= 1 << (free & 7); 259 bl->md5_mask[free / 8] |= 1 << (free & 7);
260 ctx->slot = free; 260 ctx->slot = free;
261 261
262 bl->cachable++; 262 bl->cacheable++;
263 bl->busy++; 263 bl->busy++;
264 264
265 return NGX_OK; 265 return NGX_OK;
266 } 266 }
267 267