nginx-0.1.42-RELEASE import

*) Bugfix: if the request URI had a zero length after the processing in
       the ngx_http_proxy_module, then the segmentation fault or bus error
       occurred in the ngx_http_proxy_module.

    *) Bugfix: the "limit_rate" directive did not work inside the "if"
       block; the bug had appeared in 0.1.38.
This commit is contained in:
Igor Sysoev 2005-08-23 15:36:54 +00:00
parent 25e571ff74
commit b85fd593e0
10 changed files with 81 additions and 33 deletions

View File

@ -9,6 +9,35 @@
<title lang="en">nginx changelog</title>
<changes ver="0.1.42" date="23.08.2005">
<change type="bugfix">
<para lang="ru">
ÅÓÌÉ URI ÚÁÐÒÏÓÁ ÐÏÌÕÞÁÌÓÑ ÎÕÌÅ×ÏÊ ÄÌÉÎÙ ÐÏÓÌÅ ÏÂÒÁÂÏÔËÉ ÍÏÄÕÌÅÍ
ngx_http_rewrite_module, ÔÏ × ÍÏÄÕÌÅ ngx_http_proxy_module ÐÒÏÉÓÈÏÄÉÌ
segmentation fault ÉÌÉ bus error.
</para>
<para lang="en">
if the request URI had a zero length after the processing in
the ngx_http_proxy_module, then the segmentation fault or bus error occurred
in the ngx_http_proxy_module.
</para>
</change>
<change type="bugfix">
<para lang="ru">
ÄÉÒÅËÔÉ×Á limit_rate ÎÅ ÒÁÂÏÔÁÌÁ ×ÎÕÔÒÉ ÂÌÏËÁ if;
ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.1.38.
</para>
<para lang="en">
the "limit_rate" directive did not work inside the "if" block;
bug appeared in 0.1.38.
</para>
</change>
</changes>
<changes ver="0.1.41" date="25.07.2005">
<change type="bugfix">

View File

@ -8,7 +8,7 @@
#define _NGINX_H_INCLUDED_
#define NGINX_VER "nginx/0.1.41"
#define NGINX_VER "nginx/0.1.42"
#define NGINX_VAR "NGINX"
#define NGX_NEWPID_EXT ".newbin"

View File

@ -67,7 +67,7 @@ ngx_event_find_timer(void)
(node->key * NGX_TIMER_RESOLUTION - ngx_elapsed_msec);
#endif
return timer > 0 ? timer: 0 ;
return timer > 0 ? timer : 0 ;
}

View File

@ -67,6 +67,7 @@ ngx_int_t ngx_http_parse_multi_header_lines(ngx_array_t *headers,
ngx_str_t *name, ngx_str_t *value);
ngx_int_t ngx_http_find_server_conf(ngx_http_request_t *r);
void ngx_http_update_location_config(ngx_http_request_t *r);
void ngx_http_handler(ngx_http_request_t *r);
void ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc);

View File

@ -586,27 +586,7 @@ ngx_http_find_location_config(ngx_http_request_t *r)
return NGX_HTTP_NOT_FOUND;
}
r->connection->log->file = clcf->err_log->file;
if (!(r->connection->log->log_level & NGX_LOG_DEBUG_CONNECTION)) {
r->connection->log->log_level = clcf->err_log->log_level;
}
if ((ngx_io.flags & NGX_IO_SENDFILE) && clcf->sendfile) {
r->connection->sendfile = 1;
} else {
r->connection->sendfile = 0;
}
if (r->keepalive && clcf->keepalive_timeout == 0) {
r->keepalive = 0;
}
if (!clcf->tcp_nopush) {
/* disable TCP_NOPUSH/TCP_CORK use */
r->connection->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
}
ngx_http_update_location_config(r);
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http cl:%z max:%uz",
@ -640,13 +620,43 @@ ngx_http_find_location_config(ngx_http_request_t *r)
return NGX_HTTP_MOVED_PERMANENTLY;
}
return NGX_OK;
}
void
ngx_http_update_location_config(ngx_http_request_t *r)
{
ngx_http_core_loc_conf_t *clcf;
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
r->connection->log->file = clcf->err_log->file;
if (!(r->connection->log->log_level & NGX_LOG_DEBUG_CONNECTION)) {
r->connection->log->log_level = clcf->err_log->log_level;
}
if ((ngx_io.flags & NGX_IO_SENDFILE) && clcf->sendfile) {
r->connection->sendfile = 1;
} else {
r->connection->sendfile = 0;
}
if (r->keepalive && clcf->keepalive_timeout == 0) {
r->keepalive = 0;
}
if (!clcf->tcp_nopush) {
/* disable TCP_NOPUSH/TCP_CORK use */
r->connection->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
}
r->limit_rate = clcf->limit_rate;
if (clcf->handler) {
r->content_handler = clcf->handler;
}
return NGX_OK;
}
@ -1072,6 +1082,8 @@ ngx_http_internal_redirect(ngx_http_request_t *r,
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
r->loc_conf = cscf->ctx->loc_conf;
ngx_http_update_location_config(r);
r->internal = 1;
ngx_http_handler(r);

View File

@ -1696,9 +1696,6 @@ static ngx_int_t
ngx_http_postponed_handler(ngx_http_request_t *r)
{
ngx_int_t rc;
#if 0
ngx_http_request_t *mr;
#endif
ngx_http_postponed_request_t *pr;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,

View File

@ -687,6 +687,14 @@ ngx_http_script_regex_end_code(ngx_http_script_engine_t *e)
if (code->uri) {
r->uri = e->buf;
if (r->uri.len == 0) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"the rewritten URI has a zero length");
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
return;
}
if (ngx_http_set_exten(r) != NGX_OK) {
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
@ -737,6 +745,7 @@ ngx_http_script_if_code(ngx_http_script_engine_t *e)
if (e->sp->value) {
if (code->loc_conf) {
e->request->loc_conf = code->loc_conf;
ngx_http_update_location_config(e->request);
}
e->ip += sizeof(ngx_http_script_if_code_t);

View File

@ -161,7 +161,7 @@ static char error_501_page[] =
"<html>" CRLF
"<head><title>501 Method Not Implemented</title></head>" CRLF
"<body bgcolor=\"white\">" CRLF
"<center><h1>500 Method Not Implemented</h1></center>" CRLF
"<center><h1>501 Method Not Implemented</h1></center>" CRLF
;