Mercurial > hg > nginx-vendor-current
comparison src/http/modules/ngx_http_static_handler.c @ 10:46833bd150cb NGINX_0_1_5
nginx 0.1.5
*) Bugfix: on Solaris and Linux there may be too many "recvmsg()
returned not enough data" alerts.
*) Bugfix: there were the "writev() failed (22: Invalid argument)"
errors on Solaris in proxy mode without sendfile. On other platforms
that do not support sendfile at all the process got caught in an
endless loop.
*) Bugfix: segmentation fault on Solaris in proxy mode and using
sendfile.
*) Bugfix: segmentation fault on Solaris.
*) Bugfix: on-line upgrade did not work on Linux.
*) Bugfix: the ngx_http_autoindex_module module did not escape the
spaces, the quotes, and the percent signs in the directory listing.
*) Change: the decrease of the copy operations.
*) Feature: the userid_p3p directive.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Thu, 11 Nov 2004 00:00:00 +0300 |
parents | f0b350454894 |
children | 8a529698ed55 |
comparison
equal
deleted
inserted
replaced
9:77eee314ddbd | 10:46833bd150cb |
---|---|
195 if (clcf->open_files) { | 195 if (clcf->open_files) { |
196 file = ngx_http_cache_get(clcf->open_files, file_cleanup, | 196 file = ngx_http_cache_get(clcf->open_files, file_cleanup, |
197 &name, &file_crc); | 197 &name, &file_crc); |
198 | 198 |
199 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, | 199 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, |
200 "http open file cache get: " PTR_FMT, file); | 200 "http open file cache get: %p", file); |
201 | 201 |
202 if (file && !file->expired) { | 202 if (file && !file->expired) { |
203 r->cache = file; | 203 r->cache = file; |
204 return ngx_http_send_cached(r); | 204 return ngx_http_send_cached(r); |
205 } | 205 } |
214 if (slcf->redirect_cache) { | 214 if (slcf->redirect_cache) { |
215 redirect = ngx_http_cache_get(slcf->redirect_cache, redirect_cleanup, | 215 redirect = ngx_http_cache_get(slcf->redirect_cache, redirect_cleanup, |
216 &name, &redirect_crc); | 216 &name, &redirect_crc); |
217 | 217 |
218 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, | 218 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, |
219 "http redirect cache get: " PTR_FMT, redirect); | 219 "http redirect cache get: %p", redirect); |
220 | 220 |
221 if (redirect && !redirect->expired) { | 221 if (redirect && !redirect->expired) { |
222 | 222 |
223 /* | 223 /* |
224 * We do not copy a cached value so the cache entry is locked | 224 * We do not copy a cached value so the cache entry is locked |
245 | 245 |
246 #endif | 246 #endif |
247 | 247 |
248 /* open file */ | 248 /* open file */ |
249 | 249 |
250 #if (WIN9X) | 250 #if (NGX_WIN9X) |
251 | 251 |
252 /* TODO: redirect cache */ | 252 /* TODO: redirect cache */ |
253 | 253 |
254 if (ngx_win32_version < NGX_WIN_NT) { | 254 if (ngx_win32_version < NGX_WIN_NT) { |
255 | 255 |
274 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 274 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
275 } | 275 } |
276 } | 276 } |
277 | 277 |
278 if (ngx_is_dir(&fi)) { | 278 if (ngx_is_dir(&fi)) { |
279 ngx_log_debug(log, "HTTP DIR: '%s'" _ name.data); | 279 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, |
280 "HTTP DIR: \"%s\"", name.data); | |
280 | 281 |
281 if (!(r->headers_out.location = | 282 if (!(r->headers_out.location = |
282 ngx_http_add_header(&r->headers_out, ngx_http_headers_out))) | 283 ngx_http_add_header(&r->headers_out, ngx_http_headers_out))) |
283 { | 284 { |
284 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 285 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
382 &name, redirect_crc, | 383 &name, redirect_crc, |
383 &location, log); | 384 &location, log); |
384 location.len--; | 385 location.len--; |
385 | 386 |
386 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, | 387 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, |
387 "http redirect cache alloc: " PTR_FMT, redirect); | 388 "http redirect cache alloc: %p", redirect); |
388 | 389 |
389 if (redirect) { | 390 if (redirect) { |
390 redirect->fd = NGX_INVALID_FILE; | 391 redirect->fd = NGX_INVALID_FILE; |
391 redirect->accessed = ngx_cached_time; | 392 redirect->accessed = ngx_cached_time; |
392 redirect->last_modified = 0; | 393 redirect->last_modified = 0; |
401 #endif | 402 #endif |
402 | 403 |
403 return NGX_HTTP_MOVED_PERMANENTLY; | 404 return NGX_HTTP_MOVED_PERMANENTLY; |
404 } | 405 } |
405 | 406 |
406 #if !(WIN32) /* the not regular files are probably Unix specific */ | 407 #if !(NGX_WIN32) /* the not regular files are probably Unix specific */ |
407 | 408 |
408 if (!ngx_is_file(&fi)) { | 409 if (!ngx_is_file(&fi)) { |
409 ngx_log_error(NGX_LOG_CRIT, log, ngx_errno, | 410 ngx_log_error(NGX_LOG_CRIT, log, ngx_errno, |
410 "%s is not a regular file", name.data); | 411 "\"%s\" is not a regular file", name.data); |
411 | 412 |
412 if (ngx_close_file(fd) == NGX_FILE_ERROR) { | 413 if (ngx_close_file(fd) == NGX_FILE_ERROR) { |
413 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | 414 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, |
414 ngx_close_file_n " \"%s\" failed", name.data); | 415 ngx_close_file_n " \"%s\" failed", name.data); |
415 } | 416 } |
457 file_cleanup, | 458 file_cleanup, |
458 &name, file_crc, NULL, log); | 459 &name, file_crc, NULL, log); |
459 #endif | 460 #endif |
460 | 461 |
461 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, | 462 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, |
462 "http open file cache alloc: " PTR_FMT, file); | 463 "http open file cache alloc: %p", file); |
463 | 464 |
464 if (file) { | 465 if (file) { |
465 file->fd = fd; | 466 file->fd = fd; |
466 file->data.size = ngx_file_size(&fi); | 467 file->data.size = ngx_file_size(&fi); |
467 file->accessed = ngx_cached_time; | 468 file->accessed = ngx_cached_time; |