mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
fix English grammar
This commit is contained in:
parent
47a1ebb050
commit
2d3f3f6eb6
@ -28,7 +28,7 @@ typedef struct {
|
|||||||
unsigned len:29;
|
unsigned len:29;
|
||||||
|
|
||||||
unsigned valid:1;
|
unsigned valid:1;
|
||||||
unsigned no_cachable:1;
|
unsigned no_cacheable:1;
|
||||||
unsigned not_found:1;
|
unsigned not_found:1;
|
||||||
|
|
||||||
u_char *data;
|
u_char *data;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include <ngx_event.h>
|
#include <ngx_event.h>
|
||||||
|
|
||||||
|
|
||||||
static ngx_int_t ngx_event_busy_lock_look_cachable(ngx_event_busy_lock_t *bl,
|
static ngx_int_t ngx_event_busy_lock_look_cacheable(ngx_event_busy_lock_t *bl,
|
||||||
ngx_event_busy_lock_ctx_t *ctx);
|
ngx_event_busy_lock_ctx_t *ctx);
|
||||||
static void ngx_event_busy_lock_handler(ngx_event_t *ev);
|
static void ngx_event_busy_lock_handler(ngx_event_t *ev);
|
||||||
static void ngx_event_busy_lock_posted_handler(ngx_event_t *ev);
|
static void ngx_event_busy_lock_posted_handler(ngx_event_t *ev);
|
||||||
@ -65,14 +65,14 @@ ngx_event_busy_lock(ngx_event_busy_lock_t *bl, ngx_event_busy_lock_ctx_t *ctx)
|
|||||||
|
|
||||||
|
|
||||||
ngx_int_t
|
ngx_int_t
|
||||||
ngx_event_busy_lock_cachable(ngx_event_busy_lock_t *bl,
|
ngx_event_busy_lock_cacheable(ngx_event_busy_lock_t *bl,
|
||||||
ngx_event_busy_lock_ctx_t *ctx)
|
ngx_event_busy_lock_ctx_t *ctx)
|
||||||
{
|
{
|
||||||
ngx_int_t rc;
|
ngx_int_t rc;
|
||||||
|
|
||||||
ngx_mutex_lock(bl->mutex);
|
ngx_mutex_lock(bl->mutex);
|
||||||
|
|
||||||
rc = ngx_event_busy_lock_look_cachable(bl, ctx);
|
rc = ngx_event_busy_lock_look_cacheable(bl, ctx);
|
||||||
|
|
||||||
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ctx->event->log, 0,
|
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ctx->event->log, 0,
|
||||||
"event busy lock: %d w:%d mw:%d",
|
"event busy lock: %d w:%d mw:%d",
|
||||||
@ -201,14 +201,14 @@ ngx_event_busy_lock_cancel(ngx_event_busy_lock_t *bl,
|
|||||||
|
|
||||||
|
|
||||||
static ngx_int_t
|
static ngx_int_t
|
||||||
ngx_event_busy_lock_look_cachable(ngx_event_busy_lock_t *bl,
|
ngx_event_busy_lock_look_cacheable(ngx_event_busy_lock_t *bl,
|
||||||
ngx_event_busy_lock_ctx_t *ctx)
|
ngx_event_busy_lock_ctx_t *ctx)
|
||||||
{
|
{
|
||||||
ngx_int_t free;
|
ngx_int_t free;
|
||||||
ngx_uint_t i, bit, cachable, mask;
|
ngx_uint_t i, bit, cacheable, mask;
|
||||||
|
|
||||||
bit = 0;
|
bit = 0;
|
||||||
cachable = 0;
|
cacheable = 0;
|
||||||
free = -1;
|
free = -1;
|
||||||
|
|
||||||
#if (NGX_SUPPRESS_WARN)
|
#if (NGX_SUPPRESS_WARN)
|
||||||
@ -227,14 +227,14 @@ ngx_event_busy_lock_look_cachable(ngx_event_busy_lock_t *bl,
|
|||||||
ctx->slot = i;
|
ctx->slot = i;
|
||||||
return NGX_AGAIN;
|
return NGX_AGAIN;
|
||||||
}
|
}
|
||||||
cachable++;
|
cacheable++;
|
||||||
|
|
||||||
} else if (free == -1) {
|
} else if (free == -1) {
|
||||||
free = i;
|
free = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cachable == bl->cachable) {
|
if (cacheable == bl->cacheable) {
|
||||||
if (free == -1 && cachable < bl->max_busy) {
|
if (free == -1 && cacheable < bl->max_busy) {
|
||||||
free = i + 1;
|
free = i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ ngx_event_busy_lock_look_cachable(ngx_event_busy_lock_t *bl,
|
|||||||
bl->md5_mask[free / 8] |= 1 << (free & 7);
|
bl->md5_mask[free / 8] |= 1 << (free & 7);
|
||||||
ctx->slot = free;
|
ctx->slot = free;
|
||||||
|
|
||||||
bl->cachable++;
|
bl->cacheable++;
|
||||||
bl->busy++;
|
bl->busy++;
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
|
@ -34,7 +34,7 @@ struct ngx_event_busy_lock_ctx_s {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
u_char *md5_mask;
|
u_char *md5_mask;
|
||||||
char *md5;
|
char *md5;
|
||||||
ngx_uint_t cachable;
|
ngx_uint_t cacheable;
|
||||||
|
|
||||||
ngx_uint_t busy;
|
ngx_uint_t busy;
|
||||||
ngx_uint_t max_busy;
|
ngx_uint_t max_busy;
|
||||||
@ -53,7 +53,7 @@ typedef struct {
|
|||||||
|
|
||||||
ngx_int_t ngx_event_busy_lock(ngx_event_busy_lock_t *bl,
|
ngx_int_t ngx_event_busy_lock(ngx_event_busy_lock_t *bl,
|
||||||
ngx_event_busy_lock_ctx_t *ctx);
|
ngx_event_busy_lock_ctx_t *ctx);
|
||||||
ngx_int_t ngx_event_busy_lock_cachable(ngx_event_busy_lock_t *bl,
|
ngx_int_t ngx_event_busy_lock_cacheable(ngx_event_busy_lock_t *bl,
|
||||||
ngx_event_busy_lock_ctx_t *ctx);
|
ngx_event_busy_lock_ctx_t *ctx);
|
||||||
void ngx_event_busy_unlock(ngx_event_busy_lock_t *bl,
|
void ngx_event_busy_unlock(ngx_event_busy_lock_t *bl,
|
||||||
ngx_event_busy_lock_ctx_t *ctx);
|
ngx_event_busy_lock_ctx_t *ctx);
|
||||||
|
@ -192,7 +192,7 @@ ngx_event_pipe_read_upstream(ngx_event_pipe_t *p)
|
|||||||
chain->buf = b;
|
chain->buf = b;
|
||||||
chain->next = NULL;
|
chain->next = NULL;
|
||||||
|
|
||||||
} else if (!p->cachable
|
} else if (!p->cacheable
|
||||||
&& p->downstream->data == p->output_ctx
|
&& p->downstream->data == p->output_ctx
|
||||||
&& p->downstream->write->ready
|
&& p->downstream->write->ready
|
||||||
&& !p->downstream->write->delayed)
|
&& !p->downstream->write->delayed)
|
||||||
@ -209,7 +209,7 @@ ngx_event_pipe_read_upstream(ngx_event_pipe_t *p)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
} else if (p->cachable
|
} else if (p->cacheable
|
||||||
|| p->temp_file->offset < p->max_temp_file_size)
|
|| p->temp_file->offset < p->max_temp_file_size)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -406,7 +406,7 @@ ngx_event_pipe_read_upstream(ngx_event_pipe_t *p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->cachable && p->in) {
|
if (p->cacheable && p->in) {
|
||||||
if (ngx_event_pipe_write_chain_to_temp_file(p) == NGX_ABORT) {
|
if (ngx_event_pipe_write_chain_to_temp_file(p) == NGX_ABORT) {
|
||||||
return NGX_ABORT;
|
return NGX_ABORT;
|
||||||
}
|
}
|
||||||
@ -542,7 +542,7 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
|
|||||||
|
|
||||||
ngx_event_pipe_free_shadow_raw_buf(&p->free_raw_bufs, cl->buf);
|
ngx_event_pipe_free_shadow_raw_buf(&p->free_raw_bufs, cl->buf);
|
||||||
|
|
||||||
} else if (!p->cachable && p->in) {
|
} else if (!p->cacheable && p->in) {
|
||||||
cl = p->in;
|
cl = p->in;
|
||||||
|
|
||||||
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
||||||
@ -612,7 +612,7 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
|
|||||||
for (cl = p->free; cl; cl = cl->next) {
|
for (cl = p->free; cl; cl = cl->next) {
|
||||||
|
|
||||||
if (cl->buf->temp_file) {
|
if (cl->buf->temp_file) {
|
||||||
if (p->cachable || !p->cyclic_temp_file) {
|
if (p->cacheable || !p->cyclic_temp_file) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -659,7 +659,7 @@ ngx_event_pipe_write_chain_to_temp_file(ngx_event_pipe_t *p)
|
|||||||
out = p->in;
|
out = p->in;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!p->cachable) {
|
if (!p->cacheable) {
|
||||||
|
|
||||||
size = 0;
|
size = 0;
|
||||||
cl = out;
|
cl = out;
|
||||||
|
@ -47,7 +47,7 @@ struct ngx_event_pipe_s {
|
|||||||
void *output_ctx;
|
void *output_ctx;
|
||||||
|
|
||||||
unsigned read:1;
|
unsigned read:1;
|
||||||
unsigned cachable:1;
|
unsigned cacheable:1;
|
||||||
unsigned single_buf:1;
|
unsigned single_buf:1;
|
||||||
unsigned free_bufs:1;
|
unsigned free_bufs:1;
|
||||||
unsigned upstream_done:1;
|
unsigned upstream_done:1;
|
||||||
|
@ -397,7 +397,7 @@ ngx_http_browser_add_variable(ngx_conf_t *cf)
|
|||||||
|
|
||||||
for (var = ngx_http_browsers; var->name.len; var++) {
|
for (var = ngx_http_browsers; var->name.len; var++) {
|
||||||
|
|
||||||
v = ngx_http_add_variable(cf, &var->name, NGX_HTTP_VAR_CHANGABLE);
|
v = ngx_http_add_variable(cf, &var->name, NGX_HTTP_VAR_CHANGEABLE);
|
||||||
if (v == NULL) {
|
if (v == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
@ -673,7 +673,7 @@ ngx_http_modern_browser_value(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
|
|
||||||
bcf->modern_browser_value->len = value[1].len;
|
bcf->modern_browser_value->len = value[1].len;
|
||||||
bcf->modern_browser_value->valid = 1;
|
bcf->modern_browser_value->valid = 1;
|
||||||
bcf->modern_browser_value->no_cachable = 0;
|
bcf->modern_browser_value->no_cacheable = 0;
|
||||||
bcf->modern_browser_value->not_found = 0;
|
bcf->modern_browser_value->not_found = 0;
|
||||||
bcf->modern_browser_value->data = value[1].data;
|
bcf->modern_browser_value->data = value[1].data;
|
||||||
|
|
||||||
@ -698,7 +698,7 @@ ngx_http_ancient_browser_value(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
|
|
||||||
bcf->ancient_browser_value->len = value[1].len;
|
bcf->ancient_browser_value->len = value[1].len;
|
||||||
bcf->ancient_browser_value->valid = 1;
|
bcf->ancient_browser_value->valid = 1;
|
||||||
bcf->ancient_browser_value->no_cachable = 0;
|
bcf->ancient_browser_value->no_cacheable = 0;
|
||||||
bcf->ancient_browser_value->not_found = 0;
|
bcf->ancient_browser_value->not_found = 0;
|
||||||
bcf->ancient_browser_value->data = value[1].data;
|
bcf->ancient_browser_value->data = value[1].data;
|
||||||
|
|
||||||
|
@ -505,7 +505,7 @@ ngx_http_fastcgi_create_request(ngx_http_request_t *r)
|
|||||||
if (flcf->params_len) {
|
if (flcf->params_len) {
|
||||||
ngx_memzero(&le, sizeof(ngx_http_script_engine_t));
|
ngx_memzero(&le, sizeof(ngx_http_script_engine_t));
|
||||||
|
|
||||||
ngx_http_script_flush_no_cachable_variables(r, flcf->flushes);
|
ngx_http_script_flush_no_cacheable_variables(r, flcf->flushes);
|
||||||
le.flushed = 1;
|
le.flushed = 1;
|
||||||
|
|
||||||
le.ip = flcf->params_len->elts;
|
le.ip = flcf->params_len->elts;
|
||||||
@ -1186,8 +1186,8 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
|
|||||||
|
|
||||||
u->state->status = u->headers_in.status_n;
|
u->state->status = u->headers_in.status_n;
|
||||||
#if 0
|
#if 0
|
||||||
if (u->cachable) {
|
if (u->cacheable) {
|
||||||
u->cachable = ngx_http_upstream_is_cachable(r);
|
u->cacheable = ngx_http_upstream_is_cacheable(r);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1610,7 +1610,7 @@ ngx_http_fastcgi_add_variables(ngx_conf_t *cf)
|
|||||||
ngx_http_variable_t *var;
|
ngx_http_variable_t *var;
|
||||||
|
|
||||||
var = ngx_http_add_variable(cf, &ngx_http_fastcgi_script_name,
|
var = ngx_http_add_variable(cf, &ngx_http_fastcgi_script_name,
|
||||||
NGX_HTTP_VAR_NOHASH|NGX_HTTP_VAR_NOCACHABLE);
|
NGX_HTTP_VAR_NOHASH|NGX_HTTP_VAR_NOCACHEABLE);
|
||||||
if (var == NULL) {
|
if (var == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
@ -2104,7 +2104,7 @@ ngx_http_fastcgi_script_name_variable(ngx_http_request_t *r,
|
|||||||
|
|
||||||
if (r->uri.len) {
|
if (r->uri.len) {
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
|
flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
|
||||||
@ -2128,7 +2128,7 @@ ngx_http_fastcgi_script_name_variable(ngx_http_request_t *r,
|
|||||||
} else {
|
} else {
|
||||||
v->len = 0;
|
v->len = 0;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = NULL;
|
v->data = NULL;
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ ngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
name.data++;
|
name.data++;
|
||||||
}
|
}
|
||||||
|
|
||||||
var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGABLE);
|
var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE);
|
||||||
if (var == NULL) {
|
if (var == NULL) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
@ -257,7 +257,7 @@ ngx_http_geo(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
var->valid = 1;
|
var->valid = 1;
|
||||||
var->no_cachable = 0;
|
var->no_cacheable = 0;
|
||||||
var->not_found = 0;
|
var->not_found = 0;
|
||||||
|
|
||||||
v = ngx_array_push(&ctx->values);
|
v = ngx_array_push(&ctx->values);
|
||||||
|
@ -940,7 +940,7 @@ ngx_http_gzip_ratio_variable(ngx_http_request_t *r,
|
|||||||
ngx_http_gzip_ctx_t *ctx;
|
ngx_http_gzip_ctx_t *ctx;
|
||||||
|
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
ctx = ngx_http_get_module_ctx(r, ngx_http_gzip_filter_module);
|
ctx = ngx_http_get_module_ctx(r, ngx_http_gzip_filter_module);
|
||||||
|
@ -221,7 +221,7 @@ ngx_http_map_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
name.len--;
|
name.len--;
|
||||||
name.data++;
|
name.data++;
|
||||||
|
|
||||||
var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGABLE);
|
var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE);
|
||||||
if (var == NULL) {
|
if (var == NULL) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
@ -430,7 +430,7 @@ ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
var->valid = 1;
|
var->valid = 1;
|
||||||
var->no_cachable = 0;
|
var->no_cacheable = 0;
|
||||||
var->not_found = 0;
|
var->not_found = 0;
|
||||||
|
|
||||||
vp = ngx_array_push(&ctx->values_hash[key]);
|
vp = ngx_array_push(&ctx->values_hash[key]);
|
||||||
|
@ -420,10 +420,10 @@ static ngx_str_t ngx_http_proxy_hide_headers[] = {
|
|||||||
static ngx_http_variable_t ngx_http_proxy_vars[] = {
|
static ngx_http_variable_t ngx_http_proxy_vars[] = {
|
||||||
|
|
||||||
{ ngx_string("proxy_host"), NULL, ngx_http_proxy_host_variable, 0,
|
{ ngx_string("proxy_host"), NULL, ngx_http_proxy_host_variable, 0,
|
||||||
NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOHASH, 0 },
|
NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOHASH, 0 },
|
||||||
|
|
||||||
{ ngx_string("proxy_port"), NULL, ngx_http_proxy_port_variable, 0,
|
{ ngx_string("proxy_port"), NULL, ngx_http_proxy_port_variable, 0,
|
||||||
NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOHASH, 0 },
|
NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOHASH, 0 },
|
||||||
|
|
||||||
{ ngx_string("proxy_add_x_forwarded_for"), NULL,
|
{ ngx_string("proxy_add_x_forwarded_for"), NULL,
|
||||||
ngx_http_proxy_add_x_forwarded_for_variable, 0, NGX_HTTP_VAR_NOHASH, 0 },
|
ngx_http_proxy_add_x_forwarded_for_variable, 0, NGX_HTTP_VAR_NOHASH, 0 },
|
||||||
@ -561,7 +561,7 @@ ngx_http_proxy_create_request(ngx_http_request_t *r)
|
|||||||
len += r->uri.len - loc_len + escape + sizeof("?") - 1 + r->args.len;
|
len += r->uri.len - loc_len + escape + sizeof("?") - 1 + r->args.len;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngx_http_script_flush_no_cachable_variables(r, plcf->flushes);
|
ngx_http_script_flush_no_cacheable_variables(r, plcf->flushes);
|
||||||
|
|
||||||
if (plcf->body_set_len) {
|
if (plcf->body_set_len) {
|
||||||
le.ip = plcf->body_set_len->elts;
|
le.ip = plcf->body_set_len->elts;
|
||||||
@ -1249,7 +1249,7 @@ ngx_http_proxy_host_variable(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = plcf->host_header.len;
|
v->len = plcf->host_header.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = plcf->host_header.data;
|
v->data = plcf->host_header.data;
|
||||||
|
|
||||||
@ -1267,7 +1267,7 @@ ngx_http_proxy_port_variable(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = plcf->port.len;
|
v->len = plcf->port.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = plcf->port.data;
|
v->data = plcf->port.data;
|
||||||
|
|
||||||
@ -1282,7 +1282,7 @@ ngx_http_proxy_add_x_forwarded_for_variable(ngx_http_request_t *r,
|
|||||||
u_char *p;
|
u_char *p;
|
||||||
|
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
if (r->headers_in.x_forwarded_for == NULL) {
|
if (r->headers_in.x_forwarded_for == NULL) {
|
||||||
@ -1326,7 +1326,7 @@ ngx_http_proxy_internal_body_length_variable(ngx_http_request_t *r,
|
|||||||
}
|
}
|
||||||
|
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
v->data = ngx_palloc(r->connection->pool, NGX_SIZE_T_LEN);
|
v->data = ngx_palloc(r->connection->pool, NGX_SIZE_T_LEN);
|
||||||
|
@ -367,7 +367,7 @@ ngx_http_valid_referers(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
name.data = (u_char *) "invalid_referer";
|
name.data = (u_char *) "invalid_referer";
|
||||||
|
|
||||||
var = ngx_http_add_variable(cf, &name,
|
var = ngx_http_add_variable(cf, &name,
|
||||||
NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOHASH);
|
NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOHASH);
|
||||||
if (var == NULL) {
|
if (var == NULL) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -924,7 +924,7 @@ ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
value[1].len--;
|
value[1].len--;
|
||||||
value[1].data++;
|
value[1].data++;
|
||||||
|
|
||||||
v = ngx_http_add_variable(cf, &value[1], NGX_HTTP_VAR_CHANGABLE);
|
v = ngx_http_add_variable(cf, &value[1], NGX_HTTP_VAR_CHANGEABLE);
|
||||||
if (v == NULL) {
|
if (v == NULL) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -303,10 +303,10 @@ static ngx_http_ssi_command_t ngx_http_ssi_commands[] = {
|
|||||||
static ngx_http_variable_t ngx_http_ssi_vars[] = {
|
static ngx_http_variable_t ngx_http_ssi_vars[] = {
|
||||||
|
|
||||||
{ ngx_string("date_local"), NULL, ngx_http_ssi_date_gmt_local_variable, 0,
|
{ ngx_string("date_local"), NULL, ngx_http_ssi_date_gmt_local_variable, 0,
|
||||||
NGX_HTTP_VAR_NOCACHABLE, 0 },
|
NGX_HTTP_VAR_NOCACHEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("date_gmt"), NULL, ngx_http_ssi_date_gmt_local_variable, 1,
|
{ ngx_string("date_gmt"), NULL, ngx_http_ssi_date_gmt_local_variable, 1,
|
||||||
NGX_HTTP_VAR_NOCACHABLE, 0 },
|
NGX_HTTP_VAR_NOCACHEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_null_string, NULL, NULL, 0, 0, 0 }
|
{ ngx_null_string, NULL, NULL, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
@ -2641,7 +2641,7 @@ ngx_http_ssi_date_gmt_local_variable(ngx_http_request_t *r,
|
|||||||
char buf[NGX_HTTP_SSI_DATE_LEN];
|
char buf[NGX_HTTP_SSI_DATE_LEN];
|
||||||
|
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
tp = ngx_timeofday();
|
tp = ngx_timeofday();
|
||||||
|
@ -170,19 +170,19 @@ ngx_module_t ngx_http_ssl_module = {
|
|||||||
static ngx_http_variable_t ngx_http_ssl_vars[] = {
|
static ngx_http_variable_t ngx_http_ssl_vars[] = {
|
||||||
|
|
||||||
{ ngx_string("ssl_protocol"), NULL, ngx_http_ssl_static_variable,
|
{ ngx_string("ssl_protocol"), NULL, ngx_http_ssl_static_variable,
|
||||||
(uintptr_t) ngx_ssl_get_protocol, NGX_HTTP_VAR_CHANGABLE, 0 },
|
(uintptr_t) ngx_ssl_get_protocol, NGX_HTTP_VAR_CHANGEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("ssl_cipher"), NULL, ngx_http_ssl_static_variable,
|
{ ngx_string("ssl_cipher"), NULL, ngx_http_ssl_static_variable,
|
||||||
(uintptr_t) ngx_ssl_get_cipher_name, NGX_HTTP_VAR_CHANGABLE, 0 },
|
(uintptr_t) ngx_ssl_get_cipher_name, NGX_HTTP_VAR_CHANGEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("ssl_client_s_dn"), NULL, ngx_http_ssl_variable,
|
{ ngx_string("ssl_client_s_dn"), NULL, ngx_http_ssl_variable,
|
||||||
(uintptr_t) ngx_ssl_get_subject_dn, NGX_HTTP_VAR_CHANGABLE, 0 },
|
(uintptr_t) ngx_ssl_get_subject_dn, NGX_HTTP_VAR_CHANGEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("ssl_client_i_dn"), NULL, ngx_http_ssl_variable,
|
{ ngx_string("ssl_client_i_dn"), NULL, ngx_http_ssl_variable,
|
||||||
(uintptr_t) ngx_ssl_get_issuer_dn, NGX_HTTP_VAR_CHANGABLE, 0 },
|
(uintptr_t) ngx_ssl_get_issuer_dn, NGX_HTTP_VAR_CHANGEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("ssl_client_serial"), NULL, ngx_http_ssl_variable,
|
{ ngx_string("ssl_client_serial"), NULL, ngx_http_ssl_variable,
|
||||||
(uintptr_t) ngx_ssl_get_serial_number, NGX_HTTP_VAR_CHANGABLE, 0 },
|
(uintptr_t) ngx_ssl_get_serial_number, NGX_HTTP_VAR_CHANGEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_null_string, NULL, NULL, 0, 0, 0 }
|
{ ngx_null_string, NULL, NULL, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
@ -210,7 +210,7 @@ ngx_http_ssl_static_variable(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = len;
|
v->len = len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
@ -241,7 +241,7 @@ ngx_http_ssl_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
|
|||||||
|
|
||||||
if (v->len) {
|
if (v->len) {
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
|
@ -493,7 +493,7 @@ ngx_http_userid_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
|
|||||||
}
|
}
|
||||||
|
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
ngx_sprintf(v->data, "%V=%08XD%08XD%08XD%08XD",
|
ngx_sprintf(v->data, "%V=%08XD%08XD%08XD%08XD",
|
||||||
|
@ -912,7 +912,7 @@ variable(r, name, value = NULL)
|
|||||||
if (value) {
|
if (value) {
|
||||||
vv->len = val.len;
|
vv->len = val.len;
|
||||||
vv->valid = 1;
|
vv->valid = 1;
|
||||||
vv->no_cachable = 0;
|
vv->no_cacheable = 0;
|
||||||
vv->not_found = 0;
|
vv->not_found = 0;
|
||||||
vv->data = val.data;
|
vv->data = val.data;
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ ngx_http_perl_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
|
|||||||
if (value.data) {
|
if (value.data) {
|
||||||
v->len = value.len;
|
v->len = value.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = value.data;
|
v->data = value.data;
|
||||||
|
|
||||||
@ -954,7 +954,7 @@ ngx_http_perl_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
value[1].len--;
|
value[1].len--;
|
||||||
value[1].data++;
|
value[1].data++;
|
||||||
|
|
||||||
v = ngx_http_add_variable(cf, &value[1], NGX_HTTP_VAR_CHANGABLE);
|
v = ngx_http_add_variable(cf, &value[1], NGX_HTTP_VAR_CHANGEABLE);
|
||||||
if (v == NULL) {
|
if (v == NULL) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int ngx_http_busy_lock_look_cachable(ngx_http_busy_lock_t *bl,
|
static int ngx_http_busy_lock_look_cacheable(ngx_http_busy_lock_t *bl,
|
||||||
ngx_http_busy_lock_ctx_t *bc,
|
ngx_http_busy_lock_ctx_t *bc,
|
||||||
int lock);
|
int lock);
|
||||||
|
|
||||||
|
|
||||||
int ngx_http_busy_lock(ngx_http_busy_lock_t *bl, ngx_http_busy_lock_ctx_t *bc)
|
int ngx_http_busy_lock(ngx_http_busy_lock_t *bl, ngx_http_busy_lock_ctx_t *bc)
|
||||||
@ -60,12 +60,12 @@ int ngx_http_busy_lock(ngx_http_busy_lock_t *bl, ngx_http_busy_lock_ctx_t *bc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ngx_http_busy_lock_cachable(ngx_http_busy_lock_t *bl,
|
int ngx_http_busy_lock_cacheable(ngx_http_busy_lock_t *bl,
|
||||||
ngx_http_busy_lock_ctx_t *bc, int lock)
|
ngx_http_busy_lock_ctx_t *bc, int lock)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
rc = ngx_http_busy_lock_look_cachable(bl, bc, lock);
|
rc = ngx_http_busy_lock_look_cacheable(bl, bc, lock);
|
||||||
|
|
||||||
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, bc->event->log, 0,
|
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, bc->event->log, 0,
|
||||||
"http busylock: %d w:%d mw::%d",
|
"http busylock: %d w:%d mw::%d",
|
||||||
@ -121,22 +121,22 @@ void ngx_http_busy_unlock(ngx_http_busy_lock_t *bl,
|
|||||||
|
|
||||||
if (bl->md5) {
|
if (bl->md5) {
|
||||||
bl->md5_mask[bc->slot / 8] &= ~(1 << (bc->slot & 7));
|
bl->md5_mask[bc->slot / 8] &= ~(1 << (bc->slot & 7));
|
||||||
bl->cachable--;
|
bl->cacheable--;
|
||||||
}
|
}
|
||||||
|
|
||||||
bl->busy--;
|
bl->busy--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int ngx_http_busy_lock_look_cachable(ngx_http_busy_lock_t *bl,
|
static int ngx_http_busy_lock_look_cacheable(ngx_http_busy_lock_t *bl,
|
||||||
ngx_http_busy_lock_ctx_t *bc,
|
ngx_http_busy_lock_ctx_t *bc,
|
||||||
int lock)
|
int lock)
|
||||||
{
|
{
|
||||||
int i, b, cachable, free;
|
int i, b, cacheable, free;
|
||||||
u_int mask;
|
u_int mask;
|
||||||
|
|
||||||
b = 0;
|
b = 0;
|
||||||
cachable = 0;
|
cacheable = 0;
|
||||||
free = -1;
|
free = -1;
|
||||||
|
|
||||||
#if (NGX_SUPPRESS_WARN)
|
#if (NGX_SUPPRESS_WARN)
|
||||||
@ -153,15 +153,15 @@ static int ngx_http_busy_lock_look_cachable(ngx_http_busy_lock_t *bl,
|
|||||||
if (ngx_memcmp(&bl->md5[i * 16], bc->md5, 16) == 0) {
|
if (ngx_memcmp(&bl->md5[i * 16], bc->md5, 16) == 0) {
|
||||||
return NGX_AGAIN;
|
return NGX_AGAIN;
|
||||||
}
|
}
|
||||||
cachable++;
|
cacheable++;
|
||||||
|
|
||||||
} else if (free == -1) {
|
} else if (free == -1) {
|
||||||
free = i;
|
free = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
if (cachable == bl->cachable) {
|
if (cacheable == bl->cacheable) {
|
||||||
if (free == -1 && cachable < bl->max_busy) {
|
if (free == -1 && cacheable < bl->max_busy) {
|
||||||
free = i + 1;
|
free = i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ static int ngx_http_busy_lock_look_cachable(ngx_http_busy_lock_t *bl,
|
|||||||
bl->md5_mask[free / 8] |= 1 << (free & 7);
|
bl->md5_mask[free / 8] |= 1 << (free & 7);
|
||||||
bc->slot = free;
|
bc->slot = free;
|
||||||
|
|
||||||
bl->cachable++;
|
bl->cacheable++;
|
||||||
bl->busy++;
|
bl->busy++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
u_char *md5_mask;
|
u_char *md5_mask;
|
||||||
char *md5;
|
char *md5;
|
||||||
int cachable;
|
int cacheable;
|
||||||
|
|
||||||
int busy;
|
int busy;
|
||||||
int max_busy;
|
int max_busy;
|
||||||
@ -41,8 +41,8 @@ typedef struct {
|
|||||||
|
|
||||||
|
|
||||||
int ngx_http_busy_lock(ngx_http_busy_lock_t *bl, ngx_http_busy_lock_ctx_t *bc);
|
int ngx_http_busy_lock(ngx_http_busy_lock_t *bl, ngx_http_busy_lock_ctx_t *bc);
|
||||||
int ngx_http_busy_lock_cachable(ngx_http_busy_lock_t *bl,
|
int ngx_http_busy_lock_cacheable(ngx_http_busy_lock_t *bl,
|
||||||
ngx_http_busy_lock_ctx_t *bc, int lock);
|
ngx_http_busy_lock_ctx_t *bc, int lock);
|
||||||
void ngx_http_busy_unlock(ngx_http_busy_lock_t *bl,
|
void ngx_http_busy_unlock(ngx_http_busy_lock_t *bl,
|
||||||
ngx_http_busy_lock_ctx_t *bc);
|
ngx_http_busy_lock_ctx_t *bc);
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ struct ngx_http_request_s {
|
|||||||
unsigned limit_zone_set:1;
|
unsigned limit_zone_set:1;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
unsigned cachable:1;
|
unsigned cacheable:1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned pipeline:1;
|
unsigned pipeline:1;
|
||||||
|
@ -314,7 +314,7 @@ ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value,
|
|||||||
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
|
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
|
||||||
|
|
||||||
for (i = 0; i < cmcf->variables.nelts; i++) {
|
for (i = 0; i < cmcf->variables.nelts; i++) {
|
||||||
if (r->variables[i].no_cachable) {
|
if (r->variables[i].no_cacheable) {
|
||||||
r->variables[i].valid = 0;
|
r->variables[i].valid = 0;
|
||||||
r->variables[i].not_found = 0;
|
r->variables[i].not_found = 0;
|
||||||
}
|
}
|
||||||
@ -351,7 +351,7 @@ ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ngx_http_script_flush_no_cachable_variables(ngx_http_request_t *r,
|
ngx_http_script_flush_no_cacheable_variables(ngx_http_request_t *r,
|
||||||
ngx_array_t *indices)
|
ngx_array_t *indices)
|
||||||
{
|
{
|
||||||
ngx_uint_t n, *index;
|
ngx_uint_t n, *index;
|
||||||
@ -359,7 +359,7 @@ ngx_http_script_flush_no_cachable_variables(ngx_http_request_t *r,
|
|||||||
if (indices) {
|
if (indices) {
|
||||||
index = indices->elts;
|
index = indices->elts;
|
||||||
for (n = 0; n < indices->nelts; n++) {
|
for (n = 0; n < indices->nelts; n++) {
|
||||||
if (r->variables[index[n]].no_cachable) {
|
if (r->variables[index[n]].no_cacheable) {
|
||||||
r->variables[index[n]].valid = 0;
|
r->variables[index[n]].valid = 0;
|
||||||
r->variables[index[n]].not_found = 0;
|
r->variables[index[n]].not_found = 0;
|
||||||
}
|
}
|
||||||
@ -1152,7 +1152,7 @@ ngx_http_script_set_var_code(ngx_http_script_engine_t *e)
|
|||||||
|
|
||||||
r->variables[code->index].len = e->sp->len;
|
r->variables[code->index].len = e->sp->len;
|
||||||
r->variables[code->index].valid = 1;
|
r->variables[code->index].valid = 1;
|
||||||
r->variables[code->index].no_cachable = 0;
|
r->variables[code->index].no_cacheable = 0;
|
||||||
r->variables[code->index].not_found = 0;
|
r->variables[code->index].not_found = 0;
|
||||||
r->variables[code->index].data = e->sp->data;
|
r->variables[code->index].data = e->sp->data;
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ ngx_uint_t ngx_http_script_variables_count(ngx_str_t *value);
|
|||||||
ngx_int_t ngx_http_script_compile(ngx_http_script_compile_t *sc);
|
ngx_int_t ngx_http_script_compile(ngx_http_script_compile_t *sc);
|
||||||
u_char *ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value,
|
u_char *ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value,
|
||||||
void *code_lengths, size_t reserved, void *code_values);
|
void *code_lengths, size_t reserved, void *code_values);
|
||||||
void ngx_http_script_flush_no_cachable_variables(ngx_http_request_t *r,
|
void ngx_http_script_flush_no_cacheable_variables(ngx_http_request_t *r,
|
||||||
ngx_array_t *indices);
|
ngx_array_t *indices);
|
||||||
|
|
||||||
void *ngx_http_script_start_code(ngx_pool_t *pool, ngx_array_t **codes,
|
void *ngx_http_script_start_code(ngx_pool_t *pool, ngx_array_t **codes,
|
||||||
|
@ -434,7 +434,7 @@ ngx_http_upstream_check_broken_connection(ngx_http_request_t *r,
|
|||||||
ev->error = 1;
|
ev->error = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!u->cachable && !u->store && u->peer.connection) {
|
if (!u->cacheable && !u->store && u->peer.connection) {
|
||||||
ngx_log_error(NGX_LOG_INFO, ev->log, ev->kq_errno,
|
ngx_log_error(NGX_LOG_INFO, ev->log, ev->kq_errno,
|
||||||
"kevent() reported that client closed prematurely "
|
"kevent() reported that client closed prematurely "
|
||||||
"connection, so upstream connection is closed too");
|
"connection, so upstream connection is closed too");
|
||||||
@ -500,7 +500,7 @@ ngx_http_upstream_check_broken_connection(ngx_http_request_t *r,
|
|||||||
ev->eof = 1;
|
ev->eof = 1;
|
||||||
c->error = 1;
|
c->error = 1;
|
||||||
|
|
||||||
if (!u->cachable && !u->store && u->peer.connection) {
|
if (!u->cacheable && !u->store && u->peer.connection) {
|
||||||
ngx_log_error(NGX_LOG_INFO, ev->log, err,
|
ngx_log_error(NGX_LOG_INFO, ev->log, err,
|
||||||
"client closed prematurely connection, "
|
"client closed prematurely connection, "
|
||||||
"so upstream connection is closed too");
|
"so upstream connection is closed too");
|
||||||
@ -1513,7 +1513,7 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u->cachable) {
|
if (u->cacheable) {
|
||||||
header = (ngx_http_cache_header_t *) u->buffer->start;
|
header = (ngx_http_cache_header_t *) u->buffer->start;
|
||||||
|
|
||||||
header->expires = u->cache->ctx.expires;
|
header->expires = u->cache->ctx.expires;
|
||||||
@ -1541,7 +1541,7 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
|||||||
p->pool = r->pool;
|
p->pool = r->pool;
|
||||||
p->log = c->log;
|
p->log = c->log;
|
||||||
|
|
||||||
p->cachable = u->cachable || u->store;
|
p->cacheable = u->cacheable || u->store;
|
||||||
|
|
||||||
p->temp_file = ngx_pcalloc(r->pool, sizeof(ngx_temp_file_t));
|
p->temp_file = ngx_pcalloc(r->pool, sizeof(ngx_temp_file_t));
|
||||||
if (p->temp_file == NULL) {
|
if (p->temp_file == NULL) {
|
||||||
@ -1554,7 +1554,7 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
|||||||
p->temp_file->path = u->conf->temp_path;
|
p->temp_file->path = u->conf->temp_path;
|
||||||
p->temp_file->pool = r->pool;
|
p->temp_file->pool = r->pool;
|
||||||
|
|
||||||
if (u->cachable || u->store) {
|
if (u->cacheable || u->store) {
|
||||||
p->temp_file->persistent = 1;
|
p->temp_file->persistent = 1;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -1578,7 +1578,7 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
|||||||
|
|
||||||
p->preread_size = u->buffer.last - u->buffer.pos;
|
p->preread_size = u->buffer.last - u->buffer.pos;
|
||||||
|
|
||||||
if (u->cachable) {
|
if (u->cacheable) {
|
||||||
|
|
||||||
p->buf_to_file = ngx_calloc_buf(r->pool);
|
p->buf_to_file = ngx_calloc_buf(r->pool);
|
||||||
if (p->buf_to_file == NULL) {
|
if (p->buf_to_file == NULL) {
|
||||||
@ -1955,14 +1955,14 @@ ngx_http_upstream_process_body(ngx_event_t *ev)
|
|||||||
|
|
||||||
#if (NGX_HTTP_FILE_CACHE)
|
#if (NGX_HTTP_FILE_CACHE)
|
||||||
|
|
||||||
if (p->upstream_done && u->cachable) {
|
if (p->upstream_done && u->cacheable) {
|
||||||
if (ngx_http_cache_update(r) == NGX_ERROR) {
|
if (ngx_http_cache_update(r) == NGX_ERROR) {
|
||||||
ngx_http_busy_unlock(u->conf->busy_lock, &u->busy_lock);
|
ngx_http_busy_unlock(u->conf->busy_lock, &u->busy_lock);
|
||||||
ngx_http_upstream_finalize_request(r, u, 0);
|
ngx_http_upstream_finalize_request(r, u, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (p->upstream_eof && u->cachable) {
|
} else if (p->upstream_eof && u->cacheable) {
|
||||||
|
|
||||||
/* TODO: check length & update cache */
|
/* TODO: check length & update cache */
|
||||||
|
|
||||||
@ -1990,7 +1990,7 @@ ngx_http_upstream_process_body(ngx_event_t *ev)
|
|||||||
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
||||||
"http upstream downstream error");
|
"http upstream downstream error");
|
||||||
|
|
||||||
if (!u->cachable && u->peer.connection) {
|
if (!u->cacheable && u->peer.connection) {
|
||||||
ngx_http_upstream_finalize_request(r, u, 0);
|
ngx_http_upstream_finalize_request(r, u, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2714,7 +2714,7 @@ ngx_http_upstream_addr_variable(ngx_http_request_t *r,
|
|||||||
ngx_http_upstream_state_t *state;
|
ngx_http_upstream_state_t *state;
|
||||||
|
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
if (r->upstream_states == NULL || r->upstream_states->nelts == 0) {
|
if (r->upstream_states == NULL || r->upstream_states->nelts == 0) {
|
||||||
@ -2785,7 +2785,7 @@ ngx_http_upstream_status_variable(ngx_http_request_t *r,
|
|||||||
ngx_http_upstream_state_t *state;
|
ngx_http_upstream_state_t *state;
|
||||||
|
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
if (r->upstream_states == NULL || r->upstream_states->nelts == 0) {
|
if (r->upstream_states == NULL || r->upstream_states->nelts == 0) {
|
||||||
@ -2851,7 +2851,7 @@ ngx_http_upstream_response_time_variable(ngx_http_request_t *r,
|
|||||||
ngx_http_upstream_state_t *state;
|
ngx_http_upstream_state_t *state;
|
||||||
|
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
if (r->upstream_states == NULL || r->upstream_states->nelts == 0) {
|
if (r->upstream_states == NULL || r->upstream_states->nelts == 0) {
|
||||||
|
@ -244,7 +244,7 @@ struct ngx_http_upstream_s {
|
|||||||
ngx_http_cleanup_pt *cleanup;
|
ngx_http_cleanup_pt *cleanup;
|
||||||
|
|
||||||
unsigned store:1;
|
unsigned store:1;
|
||||||
unsigned cachable:1;
|
unsigned cacheable:1;
|
||||||
unsigned accel:1;
|
unsigned accel:1;
|
||||||
|
|
||||||
unsigned buffering:1;
|
unsigned buffering:1;
|
||||||
|
@ -143,34 +143,34 @@ static ngx_http_variable_t ngx_http_core_variables[] = {
|
|||||||
|
|
||||||
{ ngx_string("uri"), NULL, ngx_http_variable_request,
|
{ ngx_string("uri"), NULL, ngx_http_variable_request,
|
||||||
offsetof(ngx_http_request_t, uri),
|
offsetof(ngx_http_request_t, uri),
|
||||||
NGX_HTTP_VAR_NOCACHABLE, 0 },
|
NGX_HTTP_VAR_NOCACHEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("document_uri"), NULL, ngx_http_variable_request,
|
{ ngx_string("document_uri"), NULL, ngx_http_variable_request,
|
||||||
offsetof(ngx_http_request_t, uri),
|
offsetof(ngx_http_request_t, uri),
|
||||||
NGX_HTTP_VAR_NOCACHABLE, 0 },
|
NGX_HTTP_VAR_NOCACHEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("request"), NULL, ngx_http_variable_request,
|
{ ngx_string("request"), NULL, ngx_http_variable_request,
|
||||||
offsetof(ngx_http_request_t, request_line), 0, 0 },
|
offsetof(ngx_http_request_t, request_line), 0, 0 },
|
||||||
|
|
||||||
{ ngx_string("document_root"), NULL,
|
{ ngx_string("document_root"), NULL,
|
||||||
ngx_http_variable_document_root, 0, NGX_HTTP_VAR_NOCACHABLE, 0 },
|
ngx_http_variable_document_root, 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("query_string"), NULL, ngx_http_variable_request,
|
{ ngx_string("query_string"), NULL, ngx_http_variable_request,
|
||||||
offsetof(ngx_http_request_t, args),
|
offsetof(ngx_http_request_t, args),
|
||||||
NGX_HTTP_VAR_NOCACHABLE, 0 },
|
NGX_HTTP_VAR_NOCACHEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("args"),
|
{ ngx_string("args"),
|
||||||
ngx_http_variable_request_set,
|
ngx_http_variable_request_set,
|
||||||
ngx_http_variable_request,
|
ngx_http_variable_request,
|
||||||
offsetof(ngx_http_request_t, args),
|
offsetof(ngx_http_request_t, args),
|
||||||
NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOCACHABLE, 0 },
|
NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("is_args"), NULL, ngx_http_variable_is_args,
|
{ ngx_string("is_args"), NULL, ngx_http_variable_is_args,
|
||||||
0, NGX_HTTP_VAR_NOCACHABLE, 0 },
|
0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("request_filename"), NULL,
|
{ ngx_string("request_filename"), NULL,
|
||||||
ngx_http_variable_request_filename, 0,
|
ngx_http_variable_request_filename, 0,
|
||||||
NGX_HTTP_VAR_NOCACHABLE, 0 },
|
NGX_HTTP_VAR_NOCACHEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("server_name"), NULL, ngx_http_variable_request,
|
{ ngx_string("server_name"), NULL, ngx_http_variable_request,
|
||||||
offsetof(ngx_http_request_t, server_name), 0, 0 },
|
offsetof(ngx_http_request_t, server_name), 0, 0 },
|
||||||
@ -215,7 +215,7 @@ static ngx_http_variable_t ngx_http_core_variables[] = {
|
|||||||
{ ngx_string("limit_rate"), ngx_http_variable_request_set_size,
|
{ ngx_string("limit_rate"), ngx_http_variable_request_set_size,
|
||||||
ngx_http_variable_request,
|
ngx_http_variable_request,
|
||||||
offsetof(ngx_http_request_t, limit_rate),
|
offsetof(ngx_http_request_t, limit_rate),
|
||||||
NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOCACHABLE, 0 },
|
NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },
|
||||||
|
|
||||||
{ ngx_string("nginx_version"), NULL, ngx_http_variable_nginx_version,
|
{ ngx_string("nginx_version"), NULL, ngx_http_variable_nginx_version,
|
||||||
0, 0, 0 },
|
0, 0, 0 },
|
||||||
@ -251,7 +251,7 @@ ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, ngx_uint_t flags)
|
|||||||
|
|
||||||
v = key[i].value;
|
v = key[i].value;
|
||||||
|
|
||||||
if (!(v->flags & NGX_HTTP_VAR_CHANGABLE)) {
|
if (!(v->flags & NGX_HTTP_VAR_CHANGEABLE)) {
|
||||||
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
||||||
"the duplicate \"%V\" variable", name);
|
"the duplicate \"%V\" variable", name);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -375,8 +375,8 @@ ngx_http_get_indexed_variable(ngx_http_request_t *r, ngx_uint_t index)
|
|||||||
if (v[index].get_handler(r, &r->variables[index], v[index].data)
|
if (v[index].get_handler(r, &r->variables[index], v[index].data)
|
||||||
== NGX_OK)
|
== NGX_OK)
|
||||||
{
|
{
|
||||||
if (v[index].flags & NGX_HTTP_VAR_NOCACHABLE) {
|
if (v[index].flags & NGX_HTTP_VAR_NOCACHEABLE) {
|
||||||
r->variables[index].no_cachable = 1;
|
r->variables[index].no_cacheable = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return &r->variables[index];
|
return &r->variables[index];
|
||||||
@ -397,7 +397,7 @@ ngx_http_get_flushed_variable(ngx_http_request_t *r, ngx_uint_t index)
|
|||||||
v = &r->variables[index];
|
v = &r->variables[index];
|
||||||
|
|
||||||
if (v->valid) {
|
if (v->valid) {
|
||||||
if (!v->no_cachable) {
|
if (!v->no_cacheable) {
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -497,7 +497,7 @@ ngx_http_variable_request(ngx_http_request_t *r, ngx_http_variable_value_t *v,
|
|||||||
if (s->data) {
|
if (s->data) {
|
||||||
v->len = s->len;
|
v->len = s->len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = s->data;
|
v->data = s->data;
|
||||||
|
|
||||||
@ -559,7 +559,7 @@ ngx_http_variable_header(ngx_http_request_t *r, ngx_http_variable_value_t *v,
|
|||||||
if (h) {
|
if (h) {
|
||||||
v->len = h->value.len;
|
v->len = h->value.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = h->value.data;
|
v->data = h->value.data;
|
||||||
|
|
||||||
@ -591,7 +591,7 @@ ngx_http_variable_headers(ngx_http_request_t *r, ngx_http_variable_value_t *v,
|
|||||||
}
|
}
|
||||||
|
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
h = a->elts;
|
h = a->elts;
|
||||||
@ -691,7 +691,7 @@ ngx_http_variable_unknown_header(ngx_http_variable_value_t *v, ngx_str_t *var,
|
|||||||
if (n + prefix == var->len && n == header[i].key.len) {
|
if (n + prefix == var->len && n == header[i].key.len) {
|
||||||
v->len = header[i].value.len;
|
v->len = header[i].value.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = header[i].value.data;
|
v->data = header[i].value.data;
|
||||||
|
|
||||||
@ -730,7 +730,7 @@ ngx_http_variable_host(ngx_http_request_t *r, ngx_http_variable_value_t *v,
|
|||||||
}
|
}
|
||||||
|
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
@ -749,7 +749,7 @@ ngx_http_variable_binary_remote_addr(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = sizeof(in_addr_t);
|
v->len = sizeof(in_addr_t);
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = (u_char *) &sin->sin_addr.s_addr;
|
v->data = (u_char *) &sin->sin_addr.s_addr;
|
||||||
|
|
||||||
@ -763,7 +763,7 @@ ngx_http_variable_remote_addr(ngx_http_request_t *r,
|
|||||||
{
|
{
|
||||||
v->len = r->connection->addr_text.len;
|
v->len = r->connection->addr_text.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = r->connection->addr_text.data;
|
v->data = r->connection->addr_text.data;
|
||||||
|
|
||||||
@ -780,7 +780,7 @@ ngx_http_variable_remote_port(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = 0;
|
v->len = 0;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
v->data = ngx_palloc(r->pool, sizeof("65535") - 1);
|
v->data = ngx_palloc(r->pool, sizeof("65535") - 1);
|
||||||
@ -832,7 +832,7 @@ ngx_http_variable_server_addr(ngx_http_request_t *r,
|
|||||||
v->len = ngx_inet_ntop(c->listening->family, &r->in_addr,
|
v->len = ngx_inet_ntop(c->listening->family, &r->in_addr,
|
||||||
v->data, INET_ADDRSTRLEN);
|
v->data, INET_ADDRSTRLEN);
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
@ -845,7 +845,7 @@ ngx_http_variable_server_port(ngx_http_request_t *r,
|
|||||||
{
|
{
|
||||||
v->len = r->port_text->len - 1;
|
v->len = r->port_text->len - 1;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = r->port_text->data + 1;
|
v->data = r->port_text->data + 1;
|
||||||
|
|
||||||
@ -862,7 +862,7 @@ ngx_http_variable_scheme(ngx_http_request_t *r,
|
|||||||
if (r->connection->ssl) {
|
if (r->connection->ssl) {
|
||||||
v->len = sizeof("https") - 1;
|
v->len = sizeof("https") - 1;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = (u_char *) "https";
|
v->data = (u_char *) "https";
|
||||||
|
|
||||||
@ -873,7 +873,7 @@ ngx_http_variable_scheme(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = sizeof("http") - 1;
|
v->len = sizeof("http") - 1;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = (u_char *) "http";
|
v->data = (u_char *) "http";
|
||||||
|
|
||||||
@ -886,7 +886,7 @@ ngx_http_variable_is_args(ngx_http_request_t *r,
|
|||||||
ngx_http_variable_value_t *v, uintptr_t data)
|
ngx_http_variable_value_t *v, uintptr_t data)
|
||||||
{
|
{
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
|
|
||||||
if (r->args.len == 0) {
|
if (r->args.len == 0) {
|
||||||
@ -914,7 +914,7 @@ ngx_http_variable_document_root(ngx_http_request_t *r,
|
|||||||
if (clcf->root_lengths == NULL) {
|
if (clcf->root_lengths == NULL) {
|
||||||
v->len = clcf->root.len;
|
v->len = clcf->root.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = clcf->root.data;
|
v->data = clcf->root.data;
|
||||||
|
|
||||||
@ -934,7 +934,7 @@ ngx_http_variable_document_root(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = path.len;
|
v->len = path.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = path.data;
|
v->data = path.data;
|
||||||
}
|
}
|
||||||
@ -958,7 +958,7 @@ ngx_http_variable_request_filename(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = path.len - 1;
|
v->len = path.len - 1;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = path.data;
|
v->data = path.data;
|
||||||
|
|
||||||
@ -973,7 +973,7 @@ ngx_http_variable_request_method(ngx_http_request_t *r,
|
|||||||
if (r->main->method_name.data) {
|
if (r->main->method_name.data) {
|
||||||
v->len = r->main->method_name.len;
|
v->len = r->main->method_name.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = r->main->method_name.data;
|
v->data = r->main->method_name.data;
|
||||||
|
|
||||||
@ -1004,7 +1004,7 @@ ngx_http_variable_remote_user(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = r->headers_in.user.len;
|
v->len = r->headers_in.user.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = r->headers_in.user.data;
|
v->data = r->headers_in.user.data;
|
||||||
|
|
||||||
@ -1032,7 +1032,7 @@ ngx_http_variable_body_bytes_sent(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = ngx_sprintf(p, "%O", sent) - p;
|
v->len = ngx_sprintf(p, "%O", sent) - p;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = p;
|
v->data = p;
|
||||||
|
|
||||||
@ -1047,7 +1047,7 @@ ngx_http_variable_sent_content_type(ngx_http_request_t *r,
|
|||||||
if (r->headers_out.content_type.len) {
|
if (r->headers_out.content_type.len) {
|
||||||
v->len = r->headers_out.content_type.len;
|
v->len = r->headers_out.content_type.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = r->headers_out.content_type.data;
|
v->data = r->headers_out.content_type.data;
|
||||||
|
|
||||||
@ -1068,7 +1068,7 @@ ngx_http_variable_sent_content_length(ngx_http_request_t *r,
|
|||||||
if (r->headers_out.content_length) {
|
if (r->headers_out.content_length) {
|
||||||
v->len = r->headers_out.content_length->value.len;
|
v->len = r->headers_out.content_length->value.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = r->headers_out.content_length->value.data;
|
v->data = r->headers_out.content_length->value.data;
|
||||||
|
|
||||||
@ -1083,7 +1083,7 @@ ngx_http_variable_sent_content_length(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = ngx_sprintf(p, "%O", r->headers_out.content_length_n) - p;
|
v->len = ngx_sprintf(p, "%O", r->headers_out.content_length_n) - p;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = p;
|
v->data = p;
|
||||||
|
|
||||||
@ -1105,7 +1105,7 @@ ngx_http_variable_sent_last_modified(ngx_http_request_t *r,
|
|||||||
if (r->headers_out.last_modified) {
|
if (r->headers_out.last_modified) {
|
||||||
v->len = r->headers_out.last_modified->value.len;
|
v->len = r->headers_out.last_modified->value.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = r->headers_out.last_modified->value.data;
|
v->data = r->headers_out.last_modified->value.data;
|
||||||
|
|
||||||
@ -1121,7 +1121,7 @@ ngx_http_variable_sent_last_modified(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = ngx_http_time(p, r->headers_out.last_modified_time) - p;
|
v->len = ngx_http_time(p, r->headers_out.last_modified_time) - p;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = p;
|
v->data = p;
|
||||||
|
|
||||||
@ -1152,7 +1152,7 @@ ngx_http_variable_sent_connection(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = len;
|
v->len = len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = (u_char *) p;
|
v->data = (u_char *) p;
|
||||||
|
|
||||||
@ -1179,7 +1179,7 @@ ngx_http_variable_sent_keep_alive(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = ngx_sprintf(p, "timeout=%T", clcf->keepalive_header) - p;
|
v->len = ngx_sprintf(p, "timeout=%T", clcf->keepalive_header) - p;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = p;
|
v->data = p;
|
||||||
|
|
||||||
@ -1200,7 +1200,7 @@ ngx_http_variable_sent_transfer_encoding(ngx_http_request_t *r,
|
|||||||
if (r->chunked) {
|
if (r->chunked) {
|
||||||
v->len = sizeof("chunked") - 1;
|
v->len = sizeof("chunked") - 1;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = (u_char *) "chunked";
|
v->data = (u_char *) "chunked";
|
||||||
|
|
||||||
@ -1219,7 +1219,7 @@ ngx_http_variable_request_completion(ngx_http_request_t *r,
|
|||||||
if (r->request_complete) {
|
if (r->request_complete) {
|
||||||
v->len = 2;
|
v->len = 2;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = (u_char *) "OK";
|
v->data = (u_char *) "OK";
|
||||||
|
|
||||||
@ -1228,7 +1228,7 @@ ngx_http_variable_request_completion(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = 0;
|
v->len = 0;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = (u_char *) "";
|
v->data = (u_char *) "";
|
||||||
|
|
||||||
@ -1248,7 +1248,7 @@ ngx_http_variable_request_body_file(ngx_http_request_t *r,
|
|||||||
|
|
||||||
v->len = r->request_body->temp_file->file.name.len;
|
v->len = r->request_body->temp_file->file.name.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = r->request_body->temp_file->file.name.data;
|
v->data = r->request_body->temp_file->file.name.data;
|
||||||
|
|
||||||
@ -1262,7 +1262,7 @@ ngx_http_variable_nginx_version(ngx_http_request_t *r,
|
|||||||
{
|
{
|
||||||
v->len = sizeof(NGINX_VERSION) - 1;
|
v->len = sizeof(NGINX_VERSION) - 1;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
v->no_cachable = 0;
|
v->no_cacheable = 0;
|
||||||
v->not_found = 0;
|
v->not_found = 0;
|
||||||
v->data = (u_char *) NGINX_VERSION;
|
v->data = (u_char *) NGINX_VERSION;
|
||||||
|
|
||||||
@ -1370,7 +1370,7 @@ ngx_http_variables_init_vars(ngx_conf_t *cf)
|
|||||||
if (ngx_strncmp(v[i].name.data, "upstream_http_", 14) == 0) {
|
if (ngx_strncmp(v[i].name.data, "upstream_http_", 14) == 0) {
|
||||||
v[i].get_handler = ngx_http_upstream_header_variable;
|
v[i].get_handler = ngx_http_upstream_header_variable;
|
||||||
v[i].data = (uintptr_t) &v[i].name;
|
v[i].data = (uintptr_t) &v[i].name;
|
||||||
v[i].flags = NGX_HTTP_VAR_NOCACHABLE;
|
v[i].flags = NGX_HTTP_VAR_NOCACHEABLE;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,10 @@ typedef ngx_int_t (*ngx_http_get_variable_pt) (ngx_http_request_t *r,
|
|||||||
ngx_http_variable_value_t *v, uintptr_t data);
|
ngx_http_variable_value_t *v, uintptr_t data);
|
||||||
|
|
||||||
|
|
||||||
#define NGX_HTTP_VAR_CHANGABLE 1
|
#define NGX_HTTP_VAR_CHANGEABLE 1
|
||||||
#define NGX_HTTP_VAR_NOCACHABLE 2
|
#define NGX_HTTP_VAR_NOCACHEABLE 2
|
||||||
#define NGX_HTTP_VAR_INDEXED 4
|
#define NGX_HTTP_VAR_INDEXED 4
|
||||||
#define NGX_HTTP_VAR_NOHASH 8
|
#define NGX_HTTP_VAR_NOHASH 8
|
||||||
|
|
||||||
|
|
||||||
struct ngx_http_variable_s {
|
struct ngx_http_variable_s {
|
||||||
|
@ -14,7 +14,7 @@ static void ngx_start_worker_processes(ngx_cycle_t *cycle, ngx_int_t n,
|
|||||||
ngx_int_t type);
|
ngx_int_t type);
|
||||||
static void ngx_start_garbage_collector(ngx_cycle_t *cycle, ngx_int_t type);
|
static void ngx_start_garbage_collector(ngx_cycle_t *cycle, ngx_int_t type);
|
||||||
static void ngx_signal_worker_processes(ngx_cycle_t *cycle, int signo);
|
static void ngx_signal_worker_processes(ngx_cycle_t *cycle, int signo);
|
||||||
static ngx_uint_t ngx_reap_childs(ngx_cycle_t *cycle);
|
static ngx_uint_t ngx_reap_children(ngx_cycle_t *cycle);
|
||||||
static void ngx_master_process_exit(ngx_cycle_t *cycle);
|
static void ngx_master_process_exit(ngx_cycle_t *cycle);
|
||||||
static void ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data);
|
static void ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data);
|
||||||
static void ngx_worker_process_init(ngx_cycle_t *cycle, ngx_uint_t priority);
|
static void ngx_worker_process_init(ngx_cycle_t *cycle, ngx_uint_t priority);
|
||||||
@ -157,9 +157,9 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
|
|||||||
|
|
||||||
if (ngx_reap) {
|
if (ngx_reap) {
|
||||||
ngx_reap = 0;
|
ngx_reap = 0;
|
||||||
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "reap childs");
|
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "reap children");
|
||||||
|
|
||||||
live = ngx_reap_childs(cycle);
|
live = ngx_reap_children(cycle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!live && (ngx_terminate || ngx_quit)) {
|
if (!live && (ngx_terminate || ngx_quit)) {
|
||||||
@ -496,7 +496,7 @@ ngx_signal_worker_processes(ngx_cycle_t *cycle, int signo)
|
|||||||
|
|
||||||
|
|
||||||
static ngx_uint_t
|
static ngx_uint_t
|
||||||
ngx_reap_childs(ngx_cycle_t *cycle)
|
ngx_reap_children(ngx_cycle_t *cycle)
|
||||||
{
|
{
|
||||||
ngx_int_t i, n;
|
ngx_int_t i, n;
|
||||||
ngx_uint_t live;
|
ngx_uint_t live;
|
||||||
|
Loading…
Reference in New Issue
Block a user