summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-07-13 11:48:05 +0000
committerJonathan Kolb <jon@b0g.us>2009-07-13 11:48:05 +0000
commitccb71228cbec260e8921e698a34c57da5b0693cd (patch)
tree6b30300e4456fc749fb0f5d39087c592c33356cd /src
parent83116b3fea0173c4fdc4993c757869f92fb9d799 (diff)
downloadnginx-0.8.5.tar.gz
Changes with nginx 0.8.5 13 Jul 2009v0.8.5
*) Bugfix: now nginx allows underscores in a request method. *) Bugfix: a 500 error code was returned for invalid login/password while HTTP Basic authentication on Windows. *) Bugfix: ngx_http_perl_module responses did not work in subrequests. *) Bugfix: in ngx_http_limit_req_module. Thanks to Maxim Dounin.
Diffstat (limited to 'src')
-rw-r--r--src/core/nginx.h4
-rw-r--r--src/http/modules/ngx_http_limit_req_module.c19
-rw-r--r--src/http/modules/perl/nginx.pm2
-rw-r--r--src/http/ngx_http_parse.c4
-rw-r--r--src/http/ngx_http_request.c8
-rw-r--r--src/http/ngx_http_upstream.c2
6 files changed, 30 insertions, 9 deletions
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 922fa0a53..e7131c8a1 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,8 +8,8 @@
#define _NGINX_H_INCLUDED_
-#define nginx_version 8004
-#define NGINX_VERSION "0.8.4"
+#define nginx_version 8005
+#define NGINX_VERSION "0.8.5"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
diff --git a/src/http/modules/ngx_http_limit_req_module.c b/src/http/modules/ngx_http_limit_req_module.c
index 2a07c74e5..84e70b4f4 100644
--- a/src/http/modules/ngx_http_limit_req_module.c
+++ b/src/http/modules/ngx_http_limit_req_module.c
@@ -181,7 +181,7 @@ ngx_http_limit_req_handler(ngx_http_request_t *r)
}
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "limit_req: %i %ui.%03ui", rc, excess / 1000, excess % 1000);
+ "limit_req: %i %ui.%03ui", rc, excess / 1000, excess % 1000);
if (rc == NGX_BUSY) {
ngx_shmtx_unlock(&ctx->shpool->mutex);
@@ -263,8 +263,23 @@ done:
static void
ngx_http_limit_req_delay(ngx_http_request_t *r)
{
+ ngx_event_t *wev;
+
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "limit_req delay");
+ "limit_req delay");
+
+ wev = r->connection->write;
+
+ if (!wev->timedout) {
+
+ if (ngx_handle_write_event(wev, 0) != NGX_OK) {
+ ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
+ }
+
+ return;
+ }
+
+ wev->timedout = 0;
if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index 3bb73cce1..317cf2459 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.4';
+our $VERSION = '0.8.5';
require XSLoader;
XSLoader::load('nginx', $VERSION);
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index 4aa1be8ed..5bb6bb7cf 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -143,7 +143,7 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
break;
}
- if (ch < 'A' || ch > 'Z') {
+ if ((ch < 'A' || ch > 'Z') && ch != '_') {
return NGX_HTTP_PARSE_INVALID_METHOD;
}
@@ -257,7 +257,7 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
break;
}
- if (ch < 'A' || ch > 'Z') {
+ if ((ch < 'A' || ch > 'Z') && ch != '_') {
return NGX_HTTP_PARSE_INVALID_METHOD;
}
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 57128a361..d60384fe1 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -2694,7 +2694,13 @@ ngx_http_send_special(ngx_http_request_t *r, ngx_uint_t flags)
}
if (flags & NGX_HTTP_LAST) {
- b->last_buf = 1;
+
+ if (r == r->main && !r->post_action) {
+ b->last_buf = 1;
+
+ } else {
+ b->last_in_chain = 1;
+ }
}
if (flags & NGX_HTTP_FLUSH) {
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index add5b21d9..cc303b431 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2888,7 +2888,7 @@ ngx_http_upstream_finalize_request(ngx_http_request_t *r,
r->connection->log->action = "sending to client";
- if (rc == 0 && r == r->main && !r->post_action) {
+ if (rc == 0) {
rc = ngx_http_send_special(r, NGX_HTTP_LAST);
}