Skip to content

Commit

Permalink
Bugfix: now nginx allows underscores in a request method.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Igor Sysoev authored and Git Mirror committed Jul 13, 2009
1 parent 58237a4 commit c19c093
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 14 deletions.
16 changes: 15 additions & 1 deletion CHANGES
@@ -1,4 +1,17 @@

Changes with nginx 0.8.5 13 Jul 2009

*) 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.


Changes with nginx 0.8.4 22 Jun 2009

*) Bugfix: nginx could not be built --without-http-cache; the bug had
Expand Down Expand Up @@ -26,7 +39,8 @@ Changes with nginx 0.8.2 15 Jun 2009
*) Bugfix: in open_file_cache and proxy/fastcgi cache interaction on
start up.

*) Bugfix: open_file_cache might cache open file descriptors too long.
*) Bugfix: open_file_cache might cache open file descriptors too long;
the bug had appeared in 0.7.4.


Changes with nginx 0.8.1 08 Jun 2009
Expand Down
22 changes: 18 additions & 4 deletions CHANGES.ru
@@ -1,4 +1,18 @@

Изменения в nginx 0.8.5 13.07.2009

*) Исправление: теперь nginx разрешает подчёркивания в методе запроса.

*) Исправление: при использовании HTTP Basic-аутентификации на Windows
для неверных имени/пароля возвращалась 500-ая ошибка.

*) Исправление: ответы модуля ngx_http_perl_module не работали в
подзапросах.

*) Исправление: в модуле ngx_http_limit_req_module.
Спасибо Максиму Дунину.


Изменения в nginx 0.8.4 22.06.2009

*) Исправление: nginx не собирался с параметром --without-http-cache;
Expand All @@ -14,9 +28,9 @@
*) Исправление: nginx не собирался с параметром --without-http-cache;
ошибка появилась в 0.8.2.

*) Исправление: если было использовался перехват 401 ошибки от бэкенда
и бэкенд не возвращал строку "WWW-Authenticate" в заголовке ответа,
то в рабочем процессе происходил segmentation fault.
*) Исправление: если использовался перехват 401 ошибки от бэкенда и
бэкенд не возвращал строку "WWW-Authenticate" в заголовке ответа, то
в рабочем процессе происходил segmentation fault.
Спасибо Евгению Мычло.


Expand All @@ -26,7 +40,7 @@
на старте.

*) Исправление: open_file_cache мог кэшировать открытые файлы очень
долго.
долго; ошибка появилась в 0.7.4.


Изменения в nginx 0.8.1 08.06.2009
Expand Down
4 changes: 2 additions & 2 deletions src/core/nginx.h
Expand Up @@ -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"
Expand Down
19 changes: 17 additions & 2 deletions src/http/modules/ngx_http_limit_req_module.c
Expand Up @@ -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);
Expand Down Expand Up @@ -263,8 +263,23 @@ ngx_http_limit_req_handler(ngx_http_request_t *r)
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);
Expand Down
2 changes: 1 addition & 1 deletion src/http/modules/perl/nginx.pm
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/http/ngx_http_parse.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down
8 changes: 7 additions & 1 deletion src/http/ngx_http_request.c
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/http/ngx_http_upstream.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit c19c093

Please sign in to comment.