Skip to content

Commit

Permalink
nginx-0.3.53-RELEASE import
Browse files Browse the repository at this point in the history
    *) Change: the "add_header" directive adds the string to 204, 301, and
       302 responses.

    *) Feature: the "server" directive in the "upstream" context supports
       the "weight" parameter.

    *) Feature: the "server_name" directive supports the "*" wildcard.

    *) Feature: nginx supports the request body size more than 2G.

    *) Bugfix: if a client was successfully authorized using "satisfy_any
       on", then anyway the message "access forbidden by rule" was written
       in the log.

    *) Bugfix: the "PUT" method may erroneously not create a file and
       return the 409 code.

    *) Bugfix: if the IMAP/POP3 backend returned an error, then nginx
       continued proxying anyway.
  • Loading branch information
igorsysoev committed Jul 7, 2006
1 parent b798d50 commit 1765f47
Show file tree
Hide file tree
Showing 40 changed files with 440 additions and 160 deletions.
8 changes: 6 additions & 2 deletions docs/html/50x.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
</style>
</head>
<body bgcolor="white" text="black">
<p>
<table width="100%" height="100%">
<tr>
<td align="center" valign="middle">
The page you are looking for is temporarily unavailable.<br/>
Please try again later.
</p>
</td>
</tr>
</table>
</body>
</html>
79 changes: 76 additions & 3 deletions docs/xml/nginx/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,79 @@
<title lang="en">nginx changelog</title>


<changes ver="0.3.53" date="07.07.2006">

<change type="change">
<para lang="ru">
ÄÉÒÅËÔÉ×Á add_header ÄÏÂÁ×ÌÑÅÔ ÓÔÒÏËÉ × ÏÔ×ÅÔÙ Ó ËÏÄÏÍ 204, 301 É 302.
</para>
<para lang="en">
the "add_header" directive adds the string to 204, 301, and 302 responses.
</para>
</change>

<change type="feature">
<para lang="ru">
ÄÉÒÅËÔÉ×Á server × ÂÌÏËÅ upstream ÐÏÄÄÅÒÖÉ×ÁÅÔ ÐÁÒÁÍÅÔÒ weight.
</para>
<para lang="en">
the "server" directive if the "upstream" context supports
the "weight" parameter.
</para>
</change>

<change type="feature">
<para lang="ru">
ÄÉÒÅËÔÉ×Á server_name ÐÏÄÄÅÒÖÉ×ÁÅÔ ÍÁÓËÕ "*".
</para>
<para lang="en">
the "server_name" directive supports the "*" wildcard.
</para>
</change>

<change type="feature">
<para lang="ru">
nginx ÐÏÄÄÅÒÖÉ×ÁÅÔ ÔÅÌÏ ÚÁÐÒÏÓÁ ÂÏÌØÛÅ 2G.
</para>
<para lang="en">
nginx supports the request body size more than 2G.
</para>
</change>

<change type="bugfix">
<para lang="ru">
ÅÓÌÉ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ "satisfy_any on" ËÌÉÅÎÔ ÕÓÐÅÛÎÏ ÐÒÏÈÏÄÉÌ ÁÕÔÅÎÔÉÆÉËÁÃÉÀ,
× ÌÏÇ ×Ó£ ÒÁ×ÎÏ ÚÁÐÉÓÁÌÏcØ ÓÏÏÂÝÅÎÉÅ "access forbidden by rule".
</para>
<para lang="en">
if a client was successfully authorized using "satisfy_any on", then anyway
the "access forbidden by rule" message was written in the log.
</para>
</change>

<change type="bugfix">
<para lang="ru">
ÍÅÔÏÄ PUT ÍÏÇ ÏÛÉÂÏÞÎÏ ÎÅ ÓÏÚÄÁÔØ ÆÁÊÌ É ×ÅÒÎÕÔØ ËÏÄ 409.
</para>
<para lang="en">
the "PUT" method may erroneously not create a file and return the 409 code.
</para>
</change>

<change type="bugfix">
<para lang="ru">
ÅÓÌÉ ×Ï ×ÒÅÍÑ ÁÕÔÅÎÔÉÆÉËÁÃÉÉ IMAP/POP3 ÂÜËÅÎÄ ×ÏÚ×ÒÁÝÁÌ ÏÛÉÂËÕ, nginx
ÐÒÏÄÏÌÖÁÌ ÐÒÏËÓÉÒÏ×ÁÎÉÅ.
</para>
<para lang="en">
if the IMAP/POP3 backend returned an error, then nginx continued proxying
anyway.
</para>
</change>

</changes>


<changes ver="0.3.52" date="03.07.2006">

<change type="change">
Expand Down Expand Up @@ -4510,8 +4583,8 @@ proxy_preserve_host
ÓÅÒ×ÅÒÁ ÉÚ ÄÉÒÅËÔÉ×Ù server_name.
</para>
<para lang="en">
if the request has no the "Host" header line, then the proxy_preserve_host
directive set this header line to the first server name of the server_name
if the request has no the "Host" header line, then the "proxy_preserve_host"
directive set this header line to the first server name of the "server_name"
directive.
</para>
</change>
Expand Down Expand Up @@ -5173,7 +5246,7 @@ the server_names_hash and server_names_hash_threshold directives.
ÉÍÅÎÁ *.domain.tld × ÄÉÒÅËÔÉ×Å server_name ÎÅ ÒÁÂÏÔÁÌÉ.
</para>
<para lang="en">
the *.domain.tld names in the server_name directive did not work.
the *.domain.tld names in the "server_name" directive did not work.
</para>
</change>

Expand Down
2 changes: 1 addition & 1 deletion src/core/nginx.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define _NGINX_H_INCLUDED_


#define NGINX_VER "nginx/0.3.52"
#define NGINX_VER "nginx/0.3.53"

#define NGINX_VAR "NGINX"
#define NGX_OLDPID_EXT ".oldbin"
Expand Down
31 changes: 31 additions & 0 deletions src/core/ngx_conf_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,37 @@ ngx_conf_set_size_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}


char *
ngx_conf_set_off_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
char *p = conf;

off_t *op;
ngx_str_t *value;
ngx_conf_post_t *post;


op = (off_t *) (p + cmd->offset);
if (*op != NGX_CONF_UNSET) {
return "is duplicate";
}

value = cf->args->elts;

*op = ngx_parse_offset(&value[1]);
if (*op == (off_t) NGX_ERROR) {
return "invalid value";
}

if (cmd->post) {
post = cmd->post;
return post->post_handler(cf, post, op);
}

return NGX_CONF_OK;
}


char *
ngx_conf_set_msec_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
Expand Down
12 changes: 9 additions & 3 deletions src/core/ngx_conf_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ char *ngx_conf_check_num_bounds(ngx_conf_t *cf, void *post, void *data);
conf = default; \
}

#define ngx_conf_init_unsigned_value(conf, default) \
if (conf == (unsigned) NGX_CONF_UNSET) { \
#define ngx_conf_init_uint_value(conf, default) \
if (conf == NGX_CONF_UNSET_UINT) { \
conf = default; \
}

Expand All @@ -261,7 +261,7 @@ char *ngx_conf_check_num_bounds(ngx_conf_t *cf, void *post, void *data);
conf = (prev == NULL) ? default : prev; \
}

#define ngx_conf_merge_unsigned_value(conf, prev, default) \
#define ngx_conf_merge_uint_value(conf, prev, default) \
if (conf == NGX_CONF_UNSET_UINT) { \
conf = (prev == NGX_CONF_UNSET_UINT) ? default : prev; \
}
Expand All @@ -281,6 +281,11 @@ char *ngx_conf_check_num_bounds(ngx_conf_t *cf, void *post, void *data);
conf = (prev == NGX_CONF_UNSET_SIZE) ? default : prev; \
}

#define ngx_conf_merge_off_value(conf, prev, default) \
if (conf == NGX_CONF_UNSET) { \
conf = (prev == NGX_CONF_UNSET) ? default : prev; \
}

#define ngx_conf_merge_str_value(conf, prev, default) \
if (conf.data == NULL) { \
if (prev.data) { \
Expand Down Expand Up @@ -328,6 +333,7 @@ char *ngx_conf_set_str_array_slot(ngx_conf_t *cf, ngx_command_t *cmd,
char *ngx_conf_set_keyval_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
char *ngx_conf_set_num_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
char *ngx_conf_set_size_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
char *ngx_conf_set_off_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
char *ngx_conf_set_msec_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
char *ngx_conf_set_sec_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
char *ngx_conf_set_bufs_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
Expand Down
10 changes: 8 additions & 2 deletions src/core/ngx_inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,6 @@ ngx_inet_resolve_peer(ngx_conf_t *cf, ngx_str_t *name, in_port_t port)
}

peers->number = i;
peers->weight = 1;

for (i = 0; h->h_addr_list[i] != NULL; i++) {

Expand Down Expand Up @@ -511,6 +510,10 @@ ngx_inet_resolve_peer(ngx_conf_t *cf, ngx_str_t *name, in_port_t port)
- peers->peer[i].name.data;

peers->peer[i].uri_separator = "";

peers->peer[i].weight = NGX_CONF_UNSET_UINT;
peers->peer[i].max_fails = NGX_CONF_UNSET_UINT;
peers->peer[i].fail_timeout = NGX_CONF_UNSET;
}

} else {
Expand Down Expand Up @@ -643,7 +646,6 @@ ngx_inet_upstream_parse(ngx_conf_t *cf, ngx_inet_upstream_t *u)
}

peers->number = i;
peers->weight = 1;

for (i = 0; h->h_addr_list[i] != NULL; i++) {

Expand Down Expand Up @@ -677,6 +679,10 @@ ngx_inet_upstream_parse(ngx_conf_t *cf, ngx_inet_upstream_t *u)
peers->peer[i].name.len = len + u->port_text.len;

peers->peer[i].uri_separator = "";

peers->peer[i].weight = NGX_CONF_UNSET_UINT;
peers->peer[i].max_fails = NGX_CONF_UNSET_UINT;
peers->peer[i].fail_timeout = NGX_CONF_UNSET;
}

} else {
Expand Down
2 changes: 1 addition & 1 deletion src/core/ngx_inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ typedef struct {
ngx_str_t name;
char *uri_separator;

ngx_uint_t current_weight;
ngx_uint_t weight;

ngx_uint_t fails;
Expand All @@ -45,7 +46,6 @@ typedef struct {

struct ngx_peers_s {
ngx_uint_t current;
ngx_uint_t weight;

ngx_uint_t number;
ngx_uint_t last_cached;
Expand Down
45 changes: 45 additions & 0 deletions src/core/ngx_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,51 @@ ngx_parse_size(ngx_str_t *line)
}


off_t
ngx_parse_offset(ngx_str_t *line)
{
u_char last;
off_t offset;
size_t len;
ngx_int_t scale;

len = line->len;
last = line->data[len - 1];

switch (last) {
case 'K':
case 'k':
len--;
scale = 1024;
break;

case 'M':
case 'm':
len--;
scale = 1024 * 1024;
break;

case 'G':
case 'g':
len--;
scale = 1024 * 1024 * 1024;
break;

default:
scale = 1;
}

offset = ngx_atoof(line->data, len);
if (offset == NGX_ERROR) {
return NGX_ERROR;
}

offset *= scale;

return offset;
}


ngx_int_t
ngx_parse_time(ngx_str_t *line, ngx_int_t sec)
{
Expand Down
1 change: 1 addition & 0 deletions src/core/ngx_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@


ssize_t ngx_parse_size(ngx_str_t *line);
off_t ngx_parse_offset(ngx_str_t *line);
ngx_int_t ngx_parse_time(ngx_str_t *line, ngx_int_t sec);


Expand Down
4 changes: 2 additions & 2 deletions src/event/modules/ngx_devpoll_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ ngx_devpoll_init_conf(ngx_cycle_t *cycle, void *conf)
{
ngx_devpoll_conf_t *dpcf = conf;

ngx_conf_init_unsigned_value(dpcf->changes, 32);
ngx_conf_init_unsigned_value(dpcf->events, 32);
ngx_conf_init_uint_value(dpcf->changes, 32);
ngx_conf_init_uint_value(dpcf->events, 32);

return NGX_CONF_OK;
}
4 changes: 3 additions & 1 deletion src/event/modules/ngx_epoll_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,13 @@ ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
c->fd, revents);
}

#if 0
if (revents & ~(EPOLLIN|EPOLLOUT|EPOLLERR|EPOLLHUP)) {
ngx_log_error(NGX_LOG_ALERT, log, 0,
"strange epoll_wait() events fd:%d ev:%04XD",
c->fd, revents);
}
#endif

if ((revents & (EPOLLERR|EPOLLHUP))
&& (revents & (EPOLLIN|EPOLLOUT)) == 0)
Expand Down Expand Up @@ -564,7 +566,7 @@ ngx_epoll_init_conf(ngx_cycle_t *cycle, void *conf)
{
ngx_epoll_conf_t *epcf = conf;

ngx_conf_init_unsigned_value(epcf->events, 512);
ngx_conf_init_uint_value(epcf->events, 512);

return NGX_CONF_OK;
}
4 changes: 2 additions & 2 deletions src/event/ngx_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1205,10 +1205,10 @@ ngx_event_init_conf(ngx_cycle_t *cycle, void *conf)
return NGX_CONF_ERROR;
}

ngx_conf_init_unsigned_value(ecf->connections, connections);
ngx_conf_init_uint_value(ecf->connections, connections);
cycle->connection_n = ecf->connections;

ngx_conf_init_unsigned_value(ecf->use, module->ctx_index);
ngx_conf_init_uint_value(ecf->use, module->ctx_index);

event_module = module->ctx;
ngx_conf_init_ptr_value(ecf->name, event_module->name->data);
Expand Down
Loading

0 comments on commit 1765f47

Please sign in to comment.