summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-06-06 19:49:18 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-06-06 19:49:18 +0000
commit0ab91b901299ac41e3867ebec7e04e5082a4c8b4 (patch)
treeb89e863c141bc482c85c351f84d9dca1d3570789 /src/http/modules
parent6e1bbd78967660b49e3a120bbeec6382ed193d5f (diff)
downloadnginx-0ab91b901299ac41e3867ebec7e04e5082a4c8b4.tar.gz
nginx-0ab91b901299ac41e3867ebec7e04e5082a4c8b4.tar.bz2
nginx-0.0.3-2004-06-06-23:49:18 import
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_charset_filter.c2
-rw-r--r--src/http/modules/ngx_http_gzip_filter.c17
-rw-r--r--src/http/modules/ngx_http_range_filter.c2
-rw-r--r--src/http/modules/ngx_http_static_handler.c2
4 files changed, 12 insertions, 11 deletions
diff --git a/src/http/modules/ngx_http_charset_filter.c b/src/http/modules/ngx_http_charset_filter.c
index 279001baf..b79a4606c 100644
--- a/src/http/modules/ngx_http_charset_filter.c
+++ b/src/http/modules/ngx_http_charset_filter.c
@@ -184,7 +184,7 @@ static int ngx_http_charset_header_filter(ngx_http_request_t *r)
ngx_http_create_ctx(r, ctx, ngx_http_charset_filter_module,
sizeof(ngx_http_charset_ctx_t), NGX_ERROR);
- r->filter |= NGX_HTTP_FILTER_NEED_IN_MEMORY;
+ r->filter_need_in_memory = 1;
return ngx_http_next_header_filter(r);
}
diff --git a/src/http/modules/ngx_http_gzip_filter.c b/src/http/modules/ngx_http_gzip_filter.c
index eb9497517..cc7ba9c28 100644
--- a/src/http/modules/ngx_http_gzip_filter.c
+++ b/src/http/modules/ngx_http_gzip_filter.c
@@ -317,7 +317,7 @@ static int ngx_http_gzip_header_filter(ngx_http_request_t *r)
r->headers_out.content_length->key.len = 0;
r->headers_out.content_length = NULL;
}
- r->filter |= NGX_HTTP_FILTER_NEED_IN_MEMORY;
+ r->filter_need_in_memory = 1;
return ngx_http_next_header_filter(r);
}
@@ -438,12 +438,12 @@ static int ngx_http_gzip_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
* We preallocate a memory for zlib in one buffer (200K-400K), this
* dicreases a number of malloc() and free() calls and also probably
* dicreases a number of syscalls (sbrk() or so).
- * Besides we free() this memory as soon as the gzipping will complete
+ * Besides we free this memory as soon as the gzipping will complete
* and do not wait while a whole response will be sent to a client.
*
* 8K is for zlib deflate_state (~6K).
*
- * TODO: 64-bit, round to PAGE_SIZE, autoconf of deflate_state size
+ * TODO: 64-bit, autoconf of deflate_state size
*/
ctx->allocated = 8192 + (1 << (wbits + 2)) + (1 << (memlevel + 9));
@@ -739,10 +739,12 @@ static void *ngx_http_gzip_filter_alloc(void *opaque, u_int items, u_int size)
alloc = items * size;
if (alloc % 512 != 0) {
- /* we allocate 8K for zlib deflate_state (~6K) */
- /* TODO: PAGE_SIZE */
+ /*
+ * allocate the zlib deflate_state, it takes about 6K on x86,
+ * we allocate 8K
+ */
- alloc = (alloc + 4095) & ~4095;
+ alloc = (alloc + ngx_pagesize - 1) & ~(ngx_pagesize - 1);
}
if (alloc <= ctx->allocated) {
@@ -900,8 +902,7 @@ static char *ngx_http_gzip_merge_conf(ngx_conf_t *cf,
ngx_conf_merge_value(conf->enable, prev->enable, 0);
- ngx_conf_merge_bufs_value(conf->bufs, prev->bufs, 4,
- /* STUB: PAGE_SIZE */ 4096);
+ ngx_conf_merge_bufs_value(conf->bufs, prev->bufs, 4, ngx_pagesize);
ngx_conf_merge_unsigned_value(conf->http_version, prev->http_version,
NGX_HTTP_VERSION_11);
diff --git a/src/http/modules/ngx_http_range_filter.c b/src/http/modules/ngx_http_range_filter.c
index 484bcb07b..65a5fd055 100644
--- a/src/http/modules/ngx_http_range_filter.c
+++ b/src/http/modules/ngx_http_range_filter.c
@@ -113,7 +113,7 @@ static ngx_int_t ngx_http_range_header_filter(ngx_http_request_t *r)
if (r->http_version < NGX_HTTP_VERSION_10
|| r->headers_out.status != NGX_HTTP_OK
|| r->headers_out.content_length_n == -1
- || !(r->filter & NGX_HTTP_FILTER_ALLOW_RANGES))
+ || !r->filter_allow_ranges)
{
return ngx_http_next_header_filter(r);
}
diff --git a/src/http/modules/ngx_http_static_handler.c b/src/http/modules/ngx_http_static_handler.c
index 532e8faab..9c11c7eb1 100644
--- a/src/http/modules/ngx_http_static_handler.c
+++ b/src/http/modules/ngx_http_static_handler.c
@@ -480,7 +480,7 @@ static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r)
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
- r->filter |= NGX_HTTP_FILTER_ALLOW_RANGES;
+ r->filter_allow_ranges = 1;
rc = ngx_http_send_header(r);
if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {