Mercurial > hg > nginx-vendor-current
comparison src/core/ngx_file.c @ 276:c5c2b2883984 NGINX_0_5_8
nginx 0.5.8
*) Bugfix: a segmentation fault might occur if
"client_body_in_file_only on" was used and a request body was small.
*) Bugfix: a segmentation fault occurred if
"client_body_in_file_only on" and "proxy_pass_request_body off" or
"fastcgi_pass_request_body off" directives were used, and nginx
switched to a next upstream.
*) Bugfix: if the "proxy_buffering off" directive was used and a client
connection was non-active, then the connection was closed after send
timeout; bug appeared in 0.4.7.
*) Bugfix: if the "epoll" method was used and a client closed a
connection prematurely, then nginx closed the connection after a
send timeout only.
*) Bugfix: the "[alert] zero size buf" error when FastCGI server was
used.
*) Bugfixes in the "limit_zone" directive.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Fri, 19 Jan 2007 00:00:00 +0300 |
parents | 29a6403156b0 |
children | 704622b2528a |
comparison
equal
deleted
inserted
replaced
275:1779577cb845 | 276:c5c2b2883984 |
---|---|
17 { | 17 { |
18 ngx_int_t rc; | 18 ngx_int_t rc; |
19 | 19 |
20 if (tf->file.fd == NGX_INVALID_FILE) { | 20 if (tf->file.fd == NGX_INVALID_FILE) { |
21 rc = ngx_create_temp_file(&tf->file, tf->path, tf->pool, | 21 rc = ngx_create_temp_file(&tf->file, tf->path, tf->pool, |
22 tf->persistent, tf->mode); | 22 tf->persistent, tf->access); |
23 | 23 |
24 if (rc == NGX_ERROR || rc == NGX_AGAIN) { | 24 if (rc == NGX_ERROR || rc == NGX_AGAIN) { |
25 return rc; | 25 return rc; |
26 } | 26 } |
27 | 27 |
35 } | 35 } |
36 | 36 |
37 | 37 |
38 ngx_int_t | 38 ngx_int_t |
39 ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool, | 39 ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool, |
40 ngx_uint_t persistent, ngx_uint_t mode) | 40 ngx_uint_t persistent, ngx_uint_t access) |
41 { | 41 { |
42 ngx_err_t err; | 42 ngx_err_t err; |
43 ngx_atomic_uint_t n; | 43 ngx_atomic_uint_t n; |
44 ngx_pool_cleanup_t *cln; | 44 ngx_pool_cleanup_t *cln; |
45 ngx_pool_cleanup_file_t *clnf; | 45 ngx_pool_cleanup_file_t *clnf; |
70 cln = ngx_pool_cleanup_add(pool, sizeof(ngx_pool_cleanup_file_t)); | 70 cln = ngx_pool_cleanup_add(pool, sizeof(ngx_pool_cleanup_file_t)); |
71 if (cln == NULL) { | 71 if (cln == NULL) { |
72 return NGX_ERROR; | 72 return NGX_ERROR; |
73 } | 73 } |
74 | 74 |
75 file->fd = ngx_open_tempfile(file->name.data, persistent, mode); | 75 file->fd = ngx_open_tempfile(file->name.data, persistent, access); |
76 | 76 |
77 ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0, | 77 ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0, |
78 "temp fd:%d", file->fd); | 78 "temp fd:%d", file->fd); |
79 | 79 |
80 if (file->fd != NGX_INVALID_FILE) { | 80 if (file->fd != NGX_INVALID_FILE) { |
443 return NGX_ERROR; | 443 return NGX_ERROR; |
444 } | 444 } |
445 | 445 |
446 prev = ctx->data; | 446 prev = ctx->data; |
447 | 447 |
448 if (ctx->size) { | 448 if (ctx->alloc) { |
449 data = ngx_alloc(ctx->size, ctx->log); | 449 data = ngx_alloc(ctx->alloc, ctx->log); |
450 if (data == NULL) { | 450 if (data == NULL) { |
451 goto failed; | 451 goto failed; |
452 } | 452 } |
453 | 453 |
454 if (ctx->init_handler(data, prev) == NGX_ABORT) { | 454 if (ctx->init_handler(data, prev) == NGX_ABORT) { |
527 if (ngx_de_is_file(&dir)) { | 527 if (ngx_de_is_file(&dir)) { |
528 | 528 |
529 ngx_log_debug1(NGX_LOG_DEBUG_CORE, ctx->log, 0, | 529 ngx_log_debug1(NGX_LOG_DEBUG_CORE, ctx->log, 0, |
530 "tree file \"%s\"", file.data); | 530 "tree file \"%s\"", file.data); |
531 | 531 |
532 ctx->size = ngx_de_size(&dir); | |
533 ctx->access = ngx_de_access(&dir); | |
534 ctx->mtime = ngx_de_mtime(&dir); | |
535 | |
532 if (ctx->file_handler(ctx, &file) == NGX_ABORT) { | 536 if (ctx->file_handler(ctx, &file) == NGX_ABORT) { |
533 goto failed; | 537 goto failed; |
534 } | 538 } |
535 | 539 |
536 } else if (ngx_de_is_dir(&dir)) { | 540 } else if (ngx_de_is_dir(&dir)) { |
537 | 541 |
538 ngx_log_debug1(NGX_LOG_DEBUG_CORE, ctx->log, 0, | 542 ngx_log_debug1(NGX_LOG_DEBUG_CORE, ctx->log, 0, |
539 "tree enter dir \"%s\"", file.data); | 543 "tree enter dir \"%s\"", file.data); |
540 | 544 |
545 ctx->access = ngx_de_access(&dir); | |
546 ctx->mtime = ngx_de_mtime(&dir); | |
547 | |
541 if (ctx->pre_tree_handler(ctx, &file) == NGX_ABORT) { | 548 if (ctx->pre_tree_handler(ctx, &file) == NGX_ABORT) { |
542 goto failed; | 549 goto failed; |
543 } | 550 } |
544 | 551 |
545 if (ngx_walk_tree(ctx, &file) == NGX_ABORT) { | 552 if (ngx_walk_tree(ctx, &file) == NGX_ABORT) { |
546 goto failed; | 553 goto failed; |
547 } | 554 } |
548 | 555 |
556 ctx->access = ngx_de_access(&dir); | |
557 ctx->mtime = ngx_de_mtime(&dir); | |
558 | |
549 if (ctx->post_tree_handler(ctx, &file) == NGX_ABORT) { | 559 if (ctx->post_tree_handler(ctx, &file) == NGX_ABORT) { |
550 goto failed; | 560 goto failed; |
551 } | 561 } |
552 | 562 |
553 } else { | 563 } else { |
569 | 579 |
570 if (buf.len) { | 580 if (buf.len) { |
571 ngx_free(buf.data); | 581 ngx_free(buf.data); |
572 } | 582 } |
573 | 583 |
574 if (ctx->data) { | 584 if (ctx->alloc) { |
575 ngx_free(ctx->data); | 585 ngx_free(ctx->data); |
576 ctx->data = prev; | 586 ctx->data = prev; |
577 } | 587 } |
578 | 588 |
579 if (ngx_close_dir(&dir) == NGX_ERROR) { | 589 if (ngx_close_dir(&dir) == NGX_ERROR) { |