summaryrefslogtreecommitdiff
path: root/src/http/modules
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-03-03 17:00:17 +0000
committerJonathan Kolb <jon@b0g.us>2010-03-03 17:00:17 +0000
commitff85fb51bb4e2e33a5cc30178b6e1fe73e6c9c87 (patch)
treebde66a301205f97b0e4b34e6560d1f99a62a88c2 /src/http/modules
parentf44c4b757edbb4266a440a0236ff47965aebbfa3 (diff)
downloadnginx-ff85fb51bb4e2e33a5cc30178b6e1fe73e6c9c87.tar.gz
Changes with nginx 0.8.34 03 Mar 2010v0.8.34
*) Bugfix: nginx did not support all ciphers and digests used in client certificates. Thanks to Innocenty Enikeew. *) Bugfix: nginx cached incorrectly FastCGI responses if there was large stderr output before response. *) Bugfix: nginx did not support HTTPS referrers. *) Bugfix: nginx/Windows might not find file if path in configuration was given in other character case; the bug had appeared in 0.8.34. *) Bugfix: the $date_local variable has an incorrect value, if the "%s" format was used. Thanks to Maxim Dounin. *) Bugfix: if ssl_session_cache was not set or was set to "none", then during client certificate verify the error "session id context uninitialized" might occur; the bug had appeared in 0.7.1. *) Bugfix: a geo range returned default value if the range included two or more /16 networks and did not begin at /16 network boundary. *) Bugfix: a block used in a "stub" parameter of an "include" SSI directive was output with "text/plain" MIME type. *) Bugfix: $r->sleep() did not work; the bug had appeared in 0.8.11.
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_fastcgi_module.c57
-rw-r--r--src/http/modules/ngx_http_geo_module.c2
-rw-r--r--src/http/modules/ngx_http_referer_module.c25
-rw-r--r--src/http/modules/ngx_http_ssi_filter_module.c9
-rw-r--r--src/http/modules/perl/nginx.pm2
-rw-r--r--src/http/modules/perl/nginx.xs1
-rw-r--r--src/http/modules/perl/ngx_http_perl_module.c6
7 files changed, 78 insertions, 24 deletions
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
index 710b98db7..845dd5f5e 100644
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -62,7 +62,8 @@ typedef struct {
size_t length;
size_t padding;
- ngx_uint_t fastcgi_stdout; /* unsigned :1 */
+ unsigned fastcgi_stdout:1;
+ unsigned large_stderr:1;
ngx_array_t *split_parts;
@@ -1081,6 +1082,7 @@ ngx_http_fastcgi_reinit_request(ngx_http_request_t *r)
f->state = ngx_http_fastcgi_st_version;
f->fastcgi_stdout = 0;
+ f->large_stderr = 0;
return NGX_OK;
}
@@ -1099,6 +1101,7 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
ngx_table_elt_t *h;
ngx_http_upstream_t *u;
ngx_http_fastcgi_ctx_t *f;
+ ngx_http_fastcgi_header_t *fh;
ngx_http_upstream_header_t *hh;
ngx_http_fastcgi_loc_conf_t *flcf;
ngx_http_fastcgi_split_part_t *part;
@@ -1223,8 +1226,17 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
* of the PHP warnings to not allocate memory
*/
- u->buffer.pos = u->buffer.start;
- u->buffer.last = u->buffer.start;
+#if (NGX_HTTP_CACHE)
+ if (r->cache) {
+ u->buffer.pos = u->buffer.start
+ + r->cache->header_start;
+ } else {
+ u->buffer.pos = u->buffer.start;
+ }
+#endif
+
+ u->buffer.last = u->buffer.pos;
+ f->large_stderr = 1;
}
return NGX_AGAIN;
@@ -1240,6 +1252,45 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
/* f->type == NGX_HTTP_FASTCGI_STDOUT */
+#if (NGX_HTTP_CACHE)
+
+ if (f->large_stderr) {
+ u_char *start;
+ ssize_t len;
+
+ start = u->buffer.start + r->cache->header_start;
+
+ len = u->buffer.pos - start - 2 * sizeof(ngx_http_fastcgi_header_t);
+
+ /*
+ * A tail of large stderr output before HTTP header is placed
+ * in a cache file without a FastCGI record header.
+ * To workaround it we put a dummy FastCGI record header at the
+ * start of the stderr output or update r->cache_header_start,
+ * if there is no enough place for the record header.
+ */
+
+ if (len >= 0) {
+ fh = (ngx_http_fastcgi_header_t *) start;
+ fh->version = 1;
+ fh->type = NGX_HTTP_FASTCGI_STDERR;
+ fh->request_id_hi = 0;
+ fh->request_id_lo = 1;
+ fh->content_length_hi = (u_char) ((len >> 8) & 0xff);
+ fh->content_length_lo = (u_char) (len & 0xff);
+ fh->padding_length = 0;
+ fh->reserved = 0;
+
+ } else {
+ r->cache->header_start += u->buffer.pos - start
+ - sizeof(ngx_http_fastcgi_header_t);
+ }
+
+ f->large_stderr = 0;
+ }
+
+#endif
+
f->fastcgi_stdout = 1;
start = u->buffer.pos;
diff --git a/src/http/modules/ngx_http_geo_module.c b/src/http/modules/ngx_http_geo_module.c
index 0ec8d093b..a184a7ae3 100644
--- a/src/http/modules/ngx_http_geo_module.c
+++ b/src/http/modules/ngx_http_geo_module.c
@@ -589,7 +589,7 @@ ngx_http_geo_add_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
ngx_array_t *a;
ngx_http_geo_range_t *range;
- for (n = start; n <= end; n += 0x10000) {
+ for (n = start; n <= end; n = (n + 0x10000) & 0xffff0000) {
h = n >> 16;
diff --git a/src/http/modules/ngx_http_referer_module.c b/src/http/modules/ngx_http_referer_module.c
index e655be967..78cc7f4dd 100644
--- a/src/http/modules/ngx_http_referer_module.c
+++ b/src/http/modules/ngx_http_referer_module.c
@@ -124,18 +124,27 @@ ngx_http_referer_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
len = r->headers_in.referer->value.len;
ref = r->headers_in.referer->value.data;
- if (len < sizeof("http://i.ru") - 1
- || (ngx_strncasecmp(ref, (u_char *) "http://", 7) != 0))
- {
- if (rlcf->blocked_referer) {
- goto valid;
+ if (len >= sizeof("http://i.ru") - 1) {
+ last = ref + len;
+
+ if (ngx_strncasecmp(ref, (u_char *) "http://", 7) == 0) {
+ ref += 7;
+ goto valid_scheme;
+
+ } else if (ngx_strncasecmp(ref, (u_char *) "https://", 8) == 0) {
+ ref += 8;
+ goto valid_scheme;
}
+ }
- goto invalid;
+ if (rlcf->blocked_referer) {
+ goto valid;
}
- last = ref + len;
- ref += 7;
+ goto invalid;
+
+valid_scheme:
+
i = 0;
key = 0;
diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c
index 2520cdbe5..6dcce3f31 100644
--- a/src/http/modules/ngx_http_ssi_filter_module.c
+++ b/src/http/modules/ngx_http_ssi_filter_module.c
@@ -2061,9 +2061,9 @@ ngx_http_ssi_stub_output(ngx_http_request_t *r, void *data, ngx_int_t rc)
out = data;
if (!r->header_sent) {
- if (ngx_http_set_content_type(r) != NGX_OK) {
- return NGX_ERROR;
- }
+ r->headers_out.content_type_len =
+ r->parent->headers_out.content_type_len;
+ r->headers_out.content_type = r->parent->headers_out.content_type;
if (ngx_http_send_header(r) == NGX_ERROR) {
return NGX_ERROR;
@@ -2615,8 +2615,7 @@ ngx_http_ssi_date_gmt_local_variable(ngx_http_request_t *r,
return NGX_ERROR;
}
- v->len = ngx_sprintf(v->data, "%T", tp->sec + (gmt ? 0 : tp->gmtoff))
- - v->data;
+ v->len = ngx_sprintf(v->data, "%T", tp->sec) - v->data;
return NGX_OK;
}
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index 0bca5b26e..fb12dbaa0 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.33';
+our $VERSION = '0.8.34';
require XSLoader;
XSLoader::load('nginx', $VERSION);
diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs
index 0c2c9b617..357b1b9ae 100644
--- a/src/http/modules/perl/nginx.xs
+++ b/src/http/modules/perl/nginx.xs
@@ -944,6 +944,7 @@ sleep(r, sleep, next)
ngx_add_timer(r->connection->write, sleep);
r->write_event_handler = ngx_http_perl_sleep_handler;
+ r->main->count++;
void
diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c
index 9cdd17551..e1388f1c1 100644
--- a/src/http/modules/perl/ngx_http_perl_module.c
+++ b/src/http/modules/perl/ngx_http_perl_module.c
@@ -30,12 +30,6 @@ typedef struct {
} ngx_http_perl_variable_t;
-typedef struct {
- SV *sv;
- PerlInterpreter *perl;
-} ngx_http_perl_cleanup_t;
-
-
#if (NGX_HTTP_SSI)
static ngx_int_t ngx_http_perl_ssi(ngx_http_request_t *r,
ngx_http_ssi_ctx_t *ssi_ctx, ngx_str_t **params);