summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-10-11 15:13:40 +0000
committerJonathan Kolb <jon@b0g.us>2006-10-11 15:13:40 +0000
commit3fccdf4f7709199ad0df81f1dd262ce075287eab (patch)
treeef91e3c208062597bf1eefbb62429d994c0eea88
parent3c7373afd0117d9196e264d7a6a732c703d62c1c (diff)
downloadnginx-3fccdf4f7709199ad0df81f1dd262ce075287eab.tar.gz
Changes with nginx 0.4.8 11 Oct 2006v0.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.
-rw-r--r--CHANGES15
-rw-r--r--CHANGES.ru11
-rw-r--r--src/core/nginx.h2
-rw-r--r--src/core/ngx_list.c29
-rw-r--r--src/core/ngx_list.h7
-rw-r--r--src/http/modules/ngx_http_flv_module.c32
-rw-r--r--src/http/modules/ngx_http_ssi_filter_module.c18
-rw-r--r--src/http/ngx_http_variables.c6
8 files changed, 95 insertions, 25 deletions
diff --git a/CHANGES b/CHANGES
index 8e343ed7b..951675fd6 100644
--- 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 10 Oct 2006
*) 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
index 3e12599b9..a16ab5d92 100644
--- 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
index 486d5a8f9..ef20beecf 100644
--- 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
index c082afa37..84bc00263 100644
--- a/src/core/ngx_list.c
+++ b/src/core/ngx_list.c
@@ -8,7 +8,34 @@
#include <ngx_core.h>
-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
index c030cf293..75db86886 100644
--- 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
index 7fa736d80..dfe4299ec 100644
--- 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 *r)
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 *r)
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 *r)
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 *r)
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 *r)
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
index dc0cb74fb..21bd81946 100644
--- 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_request_t *r, ngx_chain_t *in)
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_request_t *r, ngx_chain_t *in)
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
index 9dee6ee9e..0f1587b64 100644
--- 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_http_request_t *r,
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;
}