# HG changeset patch # User Igor Sysoev # Date 1160510400 -14400 # Node ID b52bd034c5770dd7a462a663c4fcffe8e1d9fd61 # Parent d75dbd68f5b272d0db6d993b53b9911d66c920d2 nginx 0.4.8 *) Bugfix: if an "include" SSI command were before another "include" SSI command with an "wait" parameter, then the "wait" parameter might not work. *) Bugfix: the ngx_http_flv_module added the FLV header to the full responses. Thanks to Alexey Kovyrin. diff --git a/CHANGES b/CHANGES --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,15 @@ +Changes with nginx 0.4.8 11 Oct 2006 + + *) Bugfix: if an "include" SSI command were before another "include" + SSI command with an "wait" parameter, then the "wait" parameter + might not work. + + *) Bugfix: the ngx_http_flv_module added the FLV header to the full + responses. + Thanks to Alexey Kovyrin. + + Changes with nginx 0.4.7 10 Oct 2006 *) Feature: the ngx_http_flv_module. @@ -8,8 +19,8 @@ Changes with nginx 0.4.7 *) Feature: the "charset" and "source_charset" directives support the variables. - *) Bugfix: if before an "include" SSI command with an "wait" parameter - were yet another "include" SSI command, then the "wait" parameter + *) Bugfix: if an "include" SSI command were before another "include" + SSI command with an "wait" parameter, then the "wait" parameter might not work. *) Bugfix: if the "proxy_buffering off" directive was used or while diff --git a/CHANGES.ru b/CHANGES.ru --- a/CHANGES.ru +++ b/CHANGES.ru @@ -1,4 +1,15 @@ +Изменения в nginx 0.4.8 11.10.2006 + + *) Исправление: если до команды SSI include с параметром wait + выполнялась ещё одна команда SSI include, то параметр wait мог не + работать. + + *) Исправление: модуль ngx_http_flv_module добавлял FLV-заголовок для + полных ответов. + Спасибо Алексею Ковырину. + + Изменения в nginx 0.4.7 10.10.2006 *) Добавление: модуль ngx_http_flv_module. diff --git a/src/core/nginx.h b/src/core/nginx.h --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -8,7 +8,7 @@ #define _NGINX_H_INCLUDED_ -#define NGINX_VER "nginx/0.4.7" +#define NGINX_VER "nginx/0.4.8" #define NGINX_VAR "NGINX" #define NGX_OLDPID_EXT ".oldbin" diff --git a/src/core/ngx_list.c b/src/core/ngx_list.c --- a/src/core/ngx_list.c +++ b/src/core/ngx_list.c @@ -8,7 +8,34 @@ #include -void *ngx_list_push(ngx_list_t *l) +ngx_list_t * +ngx_list_create(ngx_pool_t *pool, ngx_uint_t n, size_t size) +{ + ngx_list_t *list; + + list = ngx_palloc(pool, sizeof(ngx_list_t)); + if (list == NULL) { + return NULL; + } + + list->part.elts = ngx_palloc(pool, n * size); + if (list->part.elts == NULL) { + return NULL; + } + + list->part.nelts = 0; + list->part.next = NULL; + list->last = &list->part; + list->size = size; + list->nalloc = n; + list->pool = pool; + + return list; +} + + +void * +ngx_list_push(ngx_list_t *l) { void *elt; ngx_list_part_t *last; diff --git a/src/core/ngx_list.h b/src/core/ngx_list.h --- a/src/core/ngx_list.h +++ b/src/core/ngx_list.h @@ -30,9 +30,10 @@ typedef struct { } ngx_list_t; -static ngx_inline -ngx_int_t ngx_list_init(ngx_list_t *list, ngx_pool_t *pool, ngx_uint_t n, - size_t size) +ngx_list_t *ngx_list_create(ngx_pool_t *pool, ngx_uint_t n, size_t size); + +static ngx_inline ngx_int_t +ngx_list_init(ngx_list_t *list, ngx_pool_t *pool, ngx_uint_t n, size_t size) { list->part.elts = ngx_palloc(pool, n * size); if (list->part.elts == NULL) { diff --git a/src/http/modules/ngx_http_flv_module.c b/src/http/modules/ngx_http_flv_module.c --- a/src/http/modules/ngx_http_flv_module.c +++ b/src/http/modules/ngx_http_flv_module.c @@ -64,7 +64,7 @@ ngx_http_flv_handler(ngx_http_request_t off_t start, len; ngx_fd_t fd; ngx_int_t rc; - ngx_uint_t level; + ngx_uint_t level, i; ngx_str_t path; ngx_err_t err; ngx_log_t *log; @@ -163,6 +163,7 @@ ngx_http_flv_handler(ngx_http_request_t start = 0; len = ngx_file_size(&fi); + i = 1; if (r->args.len) { p = (u_char *) ngx_strstr(r->args.data, "start="); @@ -176,7 +177,10 @@ ngx_http_flv_handler(ngx_http_request_t start = 0; } - len -= start; + if (start) { + len = sizeof(ngx_flv_header) - 1 + len - start; + i = 0; + } } } @@ -190,24 +194,26 @@ ngx_http_flv_handler(ngx_http_request_t clnf->log = r->pool->log; r->headers_out.status = NGX_HTTP_OK; - r->headers_out.content_length_n = sizeof(ngx_flv_header) - 1 + len; + r->headers_out.content_length_n = len; r->headers_out.last_modified_time = ngx_file_mtime(&fi); if (ngx_http_set_content_type(r) != NGX_OK) { return NGX_HTTP_INTERNAL_SERVER_ERROR; } - b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)); - if (b == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } + if (i == 0) { + b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)); + if (b == NULL) { + return NGX_HTTP_INTERNAL_SERVER_ERROR; + } - b->pos = ngx_flv_header; - b->last = ngx_flv_header + sizeof(ngx_flv_header) - 1; - b->memory = 1; + b->pos = ngx_flv_header; + b->last = ngx_flv_header + sizeof(ngx_flv_header) - 1; + b->memory = 1; - out[0].buf = b; - out[0].next = &out[1]; + out[0].buf = b; + out[0].next = &out[1]; + } b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)); if (b == NULL) { @@ -239,7 +245,7 @@ ngx_http_flv_handler(ngx_http_request_t out[1].buf = b; out[1].next = NULL; - return ngx_http_output_filter(r, out); + return ngx_http_output_filter(r, &out[i]); } diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c --- a/src/http/modules/ngx_http_ssi_filter_module.c +++ b/src/http/modules/ngx_http_ssi_filter_module.c @@ -383,6 +383,7 @@ ngx_http_ssi_body_filter(ngx_http_reques ngx_chain_t *cl, **ll; ngx_table_elt_t *param; ngx_connection_t *c; + ngx_http_request_t *pr; ngx_http_ssi_ctx_t *ctx, *mctx; ngx_http_ssi_block_t *bl; ngx_http_ssi_param_t *prm; @@ -417,6 +418,23 @@ ngx_http_ssi_body_filter(ngx_http_reques return NGX_AGAIN; } + for (pr = ctx->wait->parent; pr; pr = pr->parent) { + if (pr == r) { + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "http ssi filter \"%V\" flush", &r->uri); + + rc = ngx_http_next_body_filter(r, NULL); + + if (ctx->wait->done) { + ctx->wait = NULL; + } + + if (rc == NGX_ERROR || rc == NGX_AGAIN) { + return rc; + } + } + } + if (ctx->wait == r) { ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http ssi filter \"%V\" continue", &r->uri); diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c --- a/src/http/ngx_http_variables.c +++ b/src/http/ngx_http_variables.c @@ -1145,11 +1145,7 @@ ngx_http_variable_request_body_file(ngx_ ngx_http_variable_value_t *v, uintptr_t data) { if (r->request_body == NULL || r->request_body->temp_file == NULL) { - v->len = 0; - v->valid = 1; - v->no_cachable = 0; - v->not_found = 0; - v->data = (u_char *) ""; + v->not_found = 1; return NGX_OK; }