summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-08-31 15:02:42 +0000
committerJonathan Kolb <jon@b0g.us>2009-08-31 15:02:42 +0000
commit2c14b77a0a349044ea4999dd4663314a886cf799 (patch)
tree6271a823181c392df27aadb662f6820aea3783a1
parent65393e7df3390a8694855748788ffabd4572939b (diff)
downloadnginx-2c14b77a0a349044ea4999dd4663314a886cf799.tar.gz
Changes with nginx 0.8.13 31 Aug 2009v0.8.13
*) Bugfix: in the "aio sendfile" directive. the bug had appeared in 0.8.12. *) Bugfix: nginx could not be built without the --with-file-aio option on FreeBSD; the bug had appeared in 0.8.12.
-rw-r--r--CHANGES9
-rw-r--r--CHANGES.ru8
-rw-r--r--src/core/nginx.h4
-rw-r--r--src/http/modules/perl/nginx.pm2
-rw-r--r--src/http/ngx_http_copy_filter_module.c75
5 files changed, 62 insertions, 36 deletions
diff --git a/CHANGES b/CHANGES
index d1c8a6234..6c2c7bb1f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,13 @@
+Changes with nginx 0.8.13 31 Aug 2009
+
+ *) Bugfix: in the "aio sendfile" directive. the bug had appeared in
+ 0.8.12.
+
+ *) Bugfix: nginx could not be built without the --with-file-aio option
+ on FreeBSD; the bug had appeared in 0.8.12.
+
+
Changes with nginx 0.8.12 31 Aug 2009
*) Feature: the "sendfile" parameter in the "aio" directive on FreeBSD.
diff --git a/CHANGES.ru b/CHANGES.ru
index a037b3ebb..0fff12db3 100644
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,12 @@
+Изменения в nginx 0.8.13 31.08.2009
+
+ *) Исправление: в директиве "aio sendfile"; ошибка появилась в 0.8.12.
+
+ *) Исправление: nginx не собирался без параметра --with-file-aio на
+ FreeBSD; ошибка появилась в 0.8.12.
+
+
Изменения в nginx 0.8.12 31.08.2009
*) Добавление: параметр sendfile в директиве aio во FreeBSD.
diff --git a/src/core/nginx.h b/src/core/nginx.h
index bfd252d21..c5ab14578 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,8 +8,8 @@
#define _NGINX_H_INCLUDED_
-#define nginx_version 8012
-#define NGINX_VERSION "0.8.12"
+#define nginx_version 8013
+#define NGINX_VERSION "0.8.13"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index 6089126bd..4b5325361 100644
--- a/src/http/modules/perl/nginx.pm
+++ b/src/http/modules/perl/nginx.pm
@@ -47,7 +47,7 @@ our @EXPORT = qw(
HTTP_INSUFFICIENT_STORAGE
);
-our $VERSION = '0.8.12';
+our $VERSION = '0.8.13';
require XSLoader;
XSLoader::load('nginx', $VERSION);
diff --git a/src/http/ngx_http_copy_filter_module.c b/src/http/ngx_http_copy_filter_module.c
index f3d0f1161..954717d8b 100644
--- a/src/http/ngx_http_copy_filter_module.c
+++ b/src/http/ngx_http_copy_filter_module.c
@@ -133,55 +133,64 @@ ngx_http_copy_filter(ngx_http_request_t *r, ngx_chain_t *in)
r->request_output = 1;
}
- rc = ngx_output_chain(ctx, in);
+ for ( ;; ) {
+ rc = ngx_output_chain(ctx, in);
- if (ctx->in == NULL) {
- r->buffered &= ~NGX_HTTP_COPY_BUFFERED;
+ if (ctx->in == NULL) {
+ r->buffered &= ~NGX_HTTP_COPY_BUFFERED;
- } else {
- r->buffered |= NGX_HTTP_COPY_BUFFERED;
- }
+ } else {
+ r->buffered |= NGX_HTTP_COPY_BUFFERED;
+ }
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http copy filter: %i \"%V?%V\"", rc, &r->uri, &r->args);
+ ngx_log_debug3(NGX_LOG_DEBUG_HTTP, c->log, 0,
+ "http copy filter: %i \"%V?%V\"", rc, &r->uri, &r->args);
-#if (NGX_HAVE_AIO_SENDFILE)
+#if (NGX_HAVE_FILE_AIO && NGX_HAVE_AIO_SENDFILE)
- if (c->busy_sendfile) {
- off_t offset;
- ngx_file_t *file;
- ngx_http_ephemeral_t *e;
+ if (c->busy_sendfile) {
+ ssize_t n;
+ off_t offset;
+ ngx_file_t *file;
+ ngx_http_ephemeral_t *e;
- file = c->busy_sendfile->file;
- offset = c->busy_sendfile->file_pos;
+ file = c->busy_sendfile->file;
+ offset = c->busy_sendfile->file_pos;
- if (file->aio) {
- c->aio_sendfile = (offset != file->aio->last_offset);
- file->aio->last_offset = offset;
+ if (file->aio) {
+ c->aio_sendfile = (offset != file->aio->last_offset);
+ file->aio->last_offset = offset;
- if (c->aio_sendfile == 0) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "sendfile(%V) returned busy again", &file->name);
+ if (c->aio_sendfile == 0) {
+ ngx_log_error(NGX_LOG_ALERT, c->log, 0,
+ "sendfile(%V) returned busy again",
+ &file->name);
+ }
}
- }
- c->busy_sendfile = NULL;
- e = (ngx_http_ephemeral_t *) &r->uri_start;
+ c->busy_sendfile = NULL;
+ e = (ngx_http_ephemeral_t *) &r->uri_start;
- (void) ngx_file_aio_read(file, e->preload, 4, offset, r->pool);
+ n = ngx_file_aio_read(file, e->preload, 4, offset, r->pool);
- if (file->aio) {
- file->aio->data = r;
- file->aio->handler = ngx_http_copy_aio_sendfile_event_handler;
+ if (n > 0) {
+ continue;
+ }
- r->main->blocked++;
- r->aio = 1;
- }
- }
+ rc = n;
+
+ if (file->aio) {
+ file->aio->data = r;
+ file->aio->handler = ngx_http_copy_aio_sendfile_event_handler;
+ r->main->blocked++;
+ r->aio = 1;
+ }
+ }
#endif
- return rc;
+ return rc;
+ }
}