Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-04-19 19:30:56 +0400
committerIgor Sysoev <igor@sysoev.ru>2006-04-19 19:30:56 +0400
commit7bdb720d6a7b75021ca7cea17d6f3199b5acf4ca (patch)
tree1ff27cb0b6a00fc3a58aee44f869baa6574f0329 /src/http/modules
parentafae3fd4a4ba16147fa7a4db8e4d90799ee3b56b (diff)
nginx-0.3.40-RELEASE importrelease-0.3.40
*) Feature: the ngx_http_dav_module supports the MKCOL method. *) Feature: the "create_full_put_path" directive. *) Feature: the "$limit_rate" variable.
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_autoindex_module.c4
-rw-r--r--src/http/modules/ngx_http_dav_module.c249
-rw-r--r--src/http/modules/ngx_http_fastcgi_module.c2
-rw-r--r--src/http/modules/ngx_http_geo_module.c2
-rw-r--r--src/http/modules/ngx_http_gzip_filter_module.c2
-rw-r--r--src/http/modules/ngx_http_index_module.c4
-rw-r--r--src/http/modules/ngx_http_map_module.c2
-rw-r--r--src/http/modules/ngx_http_proxy_module.c14
-rw-r--r--src/http/modules/ngx_http_referer_module.c2
-rw-r--r--src/http/modules/ngx_http_rewrite_module.c46
-rw-r--r--src/http/modules/ngx_http_ssi_filter_module.c8
-rw-r--r--src/http/modules/ngx_http_ssl_module.c8
-rw-r--r--src/http/modules/ngx_http_userid_filter_module.c4
-rw-r--r--src/http/modules/perl/ngx_http_perl_module.c6
14 files changed, 268 insertions, 85 deletions
diff --git a/src/http/modules/ngx_http_autoindex_module.c b/src/http/modules/ngx_http_autoindex_module.c
index 8e2ad0255..e1a0e86c6 100644
--- a/src/http/modules/ngx_http_autoindex_module.c
+++ b/src/http/modules/ngx_http_autoindex_module.c
@@ -162,6 +162,10 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
return NGX_DECLINED;
}
+ if (r->method != NGX_HTTP_GET && r->method != NGX_HTTP_HEAD) {
+ return NGX_DECLINED;
+ }
+
alcf = ngx_http_get_module_loc_conf(r, ngx_http_autoindex_module);
if (!alcf->enable) {
diff --git a/src/http/modules/ngx_http_dav_module.c b/src/http/modules/ngx_http_dav_module.c
index 1b982044f..e60b8cf34 100644
--- a/src/http/modules/ngx_http_dav_module.c
+++ b/src/http/modules/ngx_http_dav_module.c
@@ -13,11 +13,15 @@
typedef struct {
ngx_uint_t methods;
+ ngx_flag_t create_full_put_path;
} ngx_http_dav_loc_conf_t;
static ngx_int_t ngx_http_dav_handler(ngx_http_request_t *r);
static void ngx_http_dav_put_handler(ngx_http_request_t *r);
+static ngx_int_t ngx_http_dav_error(ngx_http_request_t *, ngx_err_t err,
+ ngx_int_t not_found, char *failed, u_char *path);
+static ngx_int_t ngx_http_dav_location(ngx_http_request_t *r, u_char *path);
static void *ngx_http_dav_create_loc_conf(ngx_conf_t *cf);
static char *ngx_http_dav_merge_loc_conf(ngx_conf_t *cf,
void *parent, void *child);
@@ -28,6 +32,7 @@ static ngx_conf_bitmask_t ngx_http_dav_methods_mask[] = {
{ ngx_string("off"), NGX_HTTP_DAV_OFF },
{ ngx_string("put"), NGX_HTTP_PUT },
{ ngx_string("delete"), NGX_HTTP_DELETE },
+ { ngx_string("mkcol"), NGX_HTTP_MKCOL },
{ ngx_null_string, 0 }
};
@@ -41,6 +46,13 @@ static ngx_command_t ngx_http_dav_commands[] = {
offsetof(ngx_http_dav_loc_conf_t, methods),
&ngx_http_dav_methods_mask },
+ { ngx_string("create_full_put_path"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
+ ngx_conf_set_flag_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_dav_loc_conf_t, create_full_put_path),
+ NULL },
+
ngx_null_command
};
@@ -79,8 +91,10 @@ ngx_module_t ngx_http_dav_module = {
static ngx_int_t
ngx_http_dav_handler(ngx_http_request_t *r)
{
+ char *failed;
ngx_int_t rc;
ngx_str_t path;
+ ngx_file_info_t fi;
ngx_http_dav_loc_conf_t *dlcf;
/* TODO: Win32 */
@@ -102,10 +116,15 @@ ngx_http_dav_handler(ngx_http_request_t *r)
return NGX_DECLINED;
}
+ if (r->headers_in.content_length_n < 0) {
+ return NGX_HTTP_BAD_REQUEST;
+ }
+
r->request_body_in_file_only = 1;
r->request_body_in_persistent_file = 1;
r->request_body_delete_incomplete_file = 1;
r->request_body_file_group_access = 1;
+ r->request_body_file_log_level = 0;
rc = ngx_http_read_client_request_body(r, ngx_http_dav_put_handler);
@@ -117,8 +136,14 @@ ngx_http_dav_handler(ngx_http_request_t *r)
case NGX_HTTP_DELETE:
- if (r->uri.data[r->uri.len - 1] == '/') {
- return NGX_DECLINED;
+ if (r->headers_in.content_length_n > 0) {
+ return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
+ }
+
+ rc = ngx_http_discard_body(r);
+
+ if (rc != NGX_OK && rc != NGX_AGAIN) {
+ return rc;
}
ngx_http_map_uri_to_path(r, &path, 0);
@@ -126,14 +151,83 @@ ngx_http_dav_handler(ngx_http_request_t *r)
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http delete filename: \"%s\"", path.data);
- if (ngx_delete_file(path.data) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
- ngx_delete_file_n " \"%s\" failed", path.data);
+ if (ngx_file_info(path.data, &fi) != -1) {
+
+ if (ngx_is_dir(&fi)) {
+
+ if (r->uri.data[r->uri.len - 1] != '/'
+ || r->headers_in.depth == NULL
+ || r->headers_in.depth->value.len != sizeof("infinity") - 1
+ || ngx_strcmp(r->headers_in.depth->value.data, "infinity")
+ != 0)
+ {
+ return NGX_HTTP_BAD_REQUEST;
+ }
+
+ if (ngx_delete_dir(path.data) != NGX_FILE_ERROR) {
+ return NGX_HTTP_NO_CONTENT;
+ }
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ failed = ngx_delete_dir_n;
+
+ } else {
+
+ if (r->uri.data[r->uri.len - 1] == '/') {
+ return NGX_HTTP_BAD_REQUEST;
+ }
+
+ if (r->headers_in.depth
+ && r->headers_in.depth->value.len == 1
+ && r->headers_in.depth->value.data[0] == '1')
+ {
+ return NGX_HTTP_BAD_REQUEST;
+ }
+
+ if (ngx_delete_file(path.data) != NGX_FILE_ERROR) {
+ return NGX_HTTP_NO_CONTENT;
+ }
+
+ failed = ngx_delete_file_n;
+ }
+
+ } else {
+ failed = ngx_file_info_n;
}
- return NGX_HTTP_NO_CONTENT;
+ return ngx_http_dav_error(r, ngx_errno, NGX_HTTP_NOT_FOUND, failed,
+ path.data);
+
+ case NGX_HTTP_MKCOL:
+
+ if (r->uri.data[r->uri.len - 1] != '/') {
+ return NGX_DECLINED;
+ }
+
+ if (r->headers_in.content_length_n > 0) {
+ return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
+ }
+
+ rc = ngx_http_discard_body(r);
+
+ if (rc != NGX_OK && rc != NGX_AGAIN) {
+ return rc;
+ }
+
+ ngx_http_map_uri_to_path(r, &path, 0);
+
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+ "http mkcol path: \"%s\"", path.data);
+
+ if (ngx_create_dir(path.data) != NGX_FILE_ERROR) {
+ if (ngx_http_dav_location(r, path.data) != NGX_OK) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
+
+ return NGX_HTTP_CREATED;
+ }
+
+ return ngx_http_dav_error(r, ngx_errno, NGX_HTTP_CONFLICT,
+ ngx_create_dir_n, path.data);
}
return NGX_DECLINED;
@@ -143,12 +237,11 @@ ngx_http_dav_handler(ngx_http_request_t *r)
static void
ngx_http_dav_put_handler(ngx_http_request_t *r)
{
- u_char *location;
- ngx_err_t err;
- ngx_str_t *temp, path;
- ngx_uint_t status;
- ngx_file_info_t fi;
- ngx_http_core_loc_conf_t *clcf;
+ ngx_err_t err;
+ ngx_str_t *temp, path;
+ ngx_uint_t status;
+ ngx_file_info_t fi;
+ ngx_http_dav_loc_conf_t *dlcf;
ngx_http_map_uri_to_path(r, &path, 0);
@@ -164,12 +257,34 @@ ngx_http_dav_put_handler(ngx_http_request_t *r)
status = NGX_HTTP_NO_CONTENT;
}
+ if (ngx_is_dir(&fi)) {
+ ngx_http_finalize_request(r, NGX_HTTP_CONFLICT);
+ return;
+ }
+
if (ngx_rename_file(temp->data, path.data) != NGX_FILE_ERROR) {
goto ok;
}
err = ngx_errno;
+ if (err == NGX_ENOENT) {
+
+ dlcf = ngx_http_get_module_loc_conf(r, ngx_http_dav_module);
+
+ if (dlcf->create_full_put_path) {
+ err = ngx_create_full_path(path.data);
+
+ if (err == 0) {
+ if (ngx_rename_file(temp->data, path.data) != NGX_FILE_ERROR) {
+ goto ok;
+ }
+
+ err = ngx_errno;
+ }
+ }
+ }
+
#if (NGX_WIN32)
if (err == NGX_EEXIST) {
@@ -185,52 +300,97 @@ ngx_http_dav_put_handler(ngx_http_request_t *r)
#endif
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, err,
- ngx_rename_file_n " \"%s\" failed", path.data);
-
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
+ ngx_http_finalize_request(r, ngx_http_dav_error(r, err, NGX_HTTP_CONFLICT,
+ ngx_rename_file_n,
+ path.data));
return;
ok:
if (status == NGX_HTTP_CREATED) {
-
- r->headers_out.location = ngx_palloc(r->pool, sizeof(ngx_table_elt_t));
- if (r->headers_out.location == NULL) {
+ if (ngx_http_dav_location(r, path.data) != NGX_OK) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
return;
}
+ }
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
+ r->headers_out.status = status;
+ r->header_only = 1;
- if (!clcf->alias && clcf->root_lengths == NULL) {
- location = path.data + clcf->root.len;
+ ngx_http_finalize_request(r, ngx_http_send_header(r));
+ return;
+}
- } else {
- location = ngx_palloc(r->pool, r->uri.len);
- if (location == NULL) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
- ngx_memcpy(location, r->uri.data, r->uri.len);
- }
+static ngx_int_t
+ngx_http_dav_error(ngx_http_request_t *r, ngx_err_t err, ngx_int_t not_found,
+ char *failed, u_char *path)
+{
+ ngx_int_t rc;
+ ngx_uint_t level;
+
+ if (err == NGX_ENOENT || err == NGX_ENOTDIR || err == NGX_ENAMETOOLONG) {
+ level = NGX_LOG_ERR;
+ rc = not_found;
+
+ } else if (err == NGX_EACCES || err == NGX_EPERM) {
+ level = NGX_LOG_ERR;
+ rc = NGX_HTTP_FORBIDDEN;
- /*
- * we do not need to set the r->headers_out.location->hash and
- * r->headers_out.location->key fields
- */
+ } else if (err == NGX_EEXIST) {
+ level = NGX_LOG_ERR;
+ rc = NGX_HTTP_NOT_ALLOWED;
- r->headers_out.location->value.len = r->uri.len;
- r->headers_out.location->value.data = location;
+ } else if (err == NGX_ENOSPC) {
+ level = NGX_LOG_CRIT;
+ rc = NGX_HTTP_INSUFFICIENT_STORAGE;
+ } else {
+ level = NGX_LOG_CRIT;
+ rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
}
- r->headers_out.status = status;
- r->header_only = 1;
+ ngx_log_error(level, r->connection->log, err,
+ "%s \"%s\" failed", failed, path);
- ngx_http_finalize_request(r, ngx_http_send_header(r));
- return;
+ return rc;
+}
+
+
+static ngx_int_t
+ngx_http_dav_location(ngx_http_request_t *r, u_char *path)
+{
+ u_char *location;
+ ngx_http_core_loc_conf_t *clcf;
+
+ r->headers_out.location = ngx_palloc(r->pool, sizeof(ngx_table_elt_t));
+ if (r->headers_out.location == NULL) {
+ return NGX_ERROR;
+ }
+
+ clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
+
+ if (!clcf->alias && clcf->root_lengths == NULL) {
+ location = path + clcf->root.len;
+
+ } else {
+ location = ngx_palloc(r->pool, r->uri.len);
+ if (location == NULL) {
+ return NGX_ERROR;
+ }
+
+ ngx_memcpy(location, r->uri.data, r->uri.len);
+ }
+
+ /*
+ * we do not need to set the r->headers_out.location->hash and
+ * r->headers_out.location->key fields
+ */
+
+ r->headers_out.location->value.len = r->uri.len;
+ r->headers_out.location->value.data = location;
+
+ return NGX_OK;
}
@@ -250,6 +410,8 @@ ngx_http_dav_create_loc_conf(ngx_conf_t *cf)
* conf->methods = 0;
*/
+ conf->create_full_put_path = NGX_CONF_UNSET;
+
return conf;
}
@@ -261,7 +423,10 @@ ngx_http_dav_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_http_dav_loc_conf_t *conf = child;
ngx_conf_merge_bitmask_value(conf->methods, prev->methods,
- (NGX_CONF_BITMASK_SET|NGX_HTTP_DAV_OFF));
+ (NGX_CONF_BITMASK_SET|NGX_HTTP_DAV_OFF));
+
+ ngx_conf_merge_value(conf->create_full_put_path, prev->create_full_put_path,
+ 0);
return NGX_CONF_OK;
}
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
index ee603d17d..f901a5223 100644
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -1445,7 +1445,7 @@ ngx_http_fastcgi_add_variables(ngx_conf_t *cf)
return NGX_ERROR;
}
- var->handler = ngx_http_fastcgi_script_name_variable;
+ var->get_handler = ngx_http_fastcgi_script_name_variable;
return NGX_OK;
}
diff --git a/src/http/modules/ngx_http_geo_module.c b/src/http/modules/ngx_http_geo_module.c
index a6e8db301..62ef72cf9 100644
--- a/src/http/modules/ngx_http_geo_module.c
+++ b/src/http/modules/ngx_http_geo_module.c
@@ -127,7 +127,7 @@ ngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- var->handler = ngx_http_geo_variable;
+ var->get_handler = ngx_http_geo_variable;
var->data = (uintptr_t) tree;
pool = ngx_create_pool(16384, cf->log);
diff --git a/src/http/modules/ngx_http_gzip_filter_module.c b/src/http/modules/ngx_http_gzip_filter_module.c
index 663f7f2ed..a08f31cb5 100644
--- a/src/http/modules/ngx_http_gzip_filter_module.c
+++ b/src/http/modules/ngx_http_gzip_filter_module.c
@@ -969,7 +969,7 @@ ngx_http_gzip_add_variables(ngx_conf_t *cf)
return NGX_ERROR;
}
- var->handler = ngx_http_gzip_ratio_variable;
+ var->get_handler = ngx_http_gzip_ratio_variable;
for (op = ngx_http_gzip_log_fmt_ops; op->name.len; op++) { /* void */ }
op->run = NULL;
diff --git a/src/http/modules/ngx_http_index_module.c b/src/http/modules/ngx_http_index_module.c
index 4ef291009..4326e7399 100644
--- a/src/http/modules/ngx_http_index_module.c
+++ b/src/http/modules/ngx_http_index_module.c
@@ -143,6 +143,10 @@ ngx_http_index_handler(ngx_http_request_t *r)
return NGX_DECLINED;
}
+ if (r->method != NGX_HTTP_GET && r->method != NGX_HTTP_HEAD) {
+ return NGX_DECLINED;
+ }
+
log = r->connection->log;
/*
diff --git a/src/http/modules/ngx_http_map_module.c b/src/http/modules/ngx_http_map_module.c
index 2cfb443e2..0a533c0f5 100644
--- a/src/http/modules/ngx_http_map_module.c
+++ b/src/http/modules/ngx_http_map_module.c
@@ -237,7 +237,7 @@ ngx_http_map_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- var->handler = ngx_http_map_variable;
+ var->get_handler = ngx_http_map_variable;
var->data = (uintptr_t) map;
pool = ngx_create_pool(16384, cf->log);
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index e96ba042e..0e3c9491c 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -366,23 +366,23 @@ static ngx_table_elt_t ngx_http_proxy_headers[] = {
static ngx_http_variable_t ngx_http_proxy_vars[] = {
- { ngx_string("proxy_host"), 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_string("proxy_port"), 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_string("proxy_add_x_forwarded_for"),
+ { ngx_string("proxy_add_x_forwarded_for"), NULL,
ngx_http_proxy_add_x_forwarded_for_variable, 0, NGX_HTTP_VAR_NOHASH, 0 },
#if 0
- { ngx_string("proxy_add_via"), NULL, 0, NGX_HTTP_VAR_NOHASH, 0 },
+ { ngx_string("proxy_add_via"), NULL, NULL, 0, NGX_HTTP_VAR_NOHASH, 0 },
#endif
- { ngx_string("proxy_internal_body_length"),
+ { ngx_string("proxy_internal_body_length"), NULL,
ngx_http_proxy_internal_body_length_variable, 0, NGX_HTTP_VAR_NOHASH, 0 },
- { ngx_null_string, NULL, 0, 0, 0 }
+ { ngx_null_string, NULL, NULL, 0, 0, 0 }
};
@@ -1382,7 +1382,7 @@ ngx_http_proxy_add_variables(ngx_conf_t *cf)
return NGX_ERROR;
}
- var->handler = v->handler;
+ var->get_handler = v->get_handler;
var->data = v->data;
}
diff --git a/src/http/modules/ngx_http_referer_module.c b/src/http/modules/ngx_http_referer_module.c
index eb01857ab..f3597a1d2 100644
--- a/src/http/modules/ngx_http_referer_module.c
+++ b/src/http/modules/ngx_http_referer_module.c
@@ -298,7 +298,7 @@ ngx_http_valid_referers(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- var->handler = ngx_http_referer_variable;
+ var->get_handler = ngx_http_referer_variable;
if (rlcf->keys == NULL) {
rlcf->keys = ngx_pcalloc(cf->temp_pool, sizeof(ngx_hash_keys_arrays_t));
diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c
index e3b2edcfe..37266a4d8 100644
--- a/src/http/modules/ngx_http_rewrite_module.c
+++ b/src/http/modules/ngx_http_rewrite_module.c
@@ -74,15 +74,6 @@ static ngx_command_t ngx_http_rewrite_commands[] = {
0,
NULL },
-#if 0
- { ngx_string("valid_referers"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_rewrite_valid_referers,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-#endif
-
{ ngx_string("set"),
NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
|NGX_CONF_TAKE2,
@@ -879,10 +870,11 @@ ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_http_rewrite_loc_conf_t *lcf = conf;
- ngx_int_t index;
- ngx_str_t *value;
- ngx_http_variable_t *v;
- ngx_http_script_var_code_t *var;
+ ngx_int_t index;
+ ngx_str_t *value;
+ ngx_http_variable_t *v;
+ ngx_http_script_var_code_t *vcode;
+ ngx_http_script_var_handler_code_t *vhcode;
value = cf->args->elts;
@@ -905,8 +897,8 @@ ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- if (v->handler == NULL) {
- v->handler = ngx_http_rewrite_var;
+ if (v->get_handler == NULL) {
+ v->get_handler = ngx_http_rewrite_var;
v->data = index;
}
@@ -914,14 +906,28 @@ ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- var = ngx_http_script_start_code(cf->pool, &lcf->codes,
- sizeof(ngx_http_script_var_code_t));
- if (var == NULL) {
+ if (v->set_handler) {
+ vhcode = ngx_http_script_start_code(cf->pool, &lcf->codes,
+ sizeof(ngx_http_script_var_handler_code_t));
+ if (vhcode == NULL) {
+ return NGX_CONF_ERROR;
+ }
+
+ vhcode->code = ngx_http_script_var_set_handler_code;
+ vhcode->handler = v->set_handler;
+ vhcode->data = v->data;
+
+ return NGX_CONF_OK;
+ }
+
+ vcode = ngx_http_script_start_code(cf->pool, &lcf->codes,
+ sizeof(ngx_http_script_var_code_t));
+ if (vcode == NULL) {
return NGX_CONF_ERROR;
}
- var->code = ngx_http_script_set_var_code;
- var->index = (uintptr_t) index;
+ vcode->code = ngx_http_script_set_var_code;
+ vcode->index = (uintptr_t) index;
return NGX_CONF_OK;
}
diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c
index 541b438e7..15cb0c34c 100644
--- a/src/http/modules/ngx_http_ssi_filter_module.c
+++ b/src/http/modules/ngx_http_ssi_filter_module.c
@@ -262,13 +262,13 @@ static ngx_http_ssi_command_t ngx_http_ssi_commands[] = {
static ngx_http_variable_t ngx_http_ssi_vars[] = {
- { ngx_string("date_local"), 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_string("date_gmt"), 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_null_string, NULL, 0, 0, 0 }
+ { ngx_null_string, NULL, NULL, 0, 0, 0 }
};
@@ -2153,7 +2153,7 @@ ngx_http_ssi_preconfiguration(ngx_conf_t *cf)
return NGX_ERROR;
}
- var->handler = v->handler;
+ var->get_handler = v->get_handler;
var->data = v->data;
}
diff --git a/src/http/modules/ngx_http_ssl_module.c b/src/http/modules/ngx_http_ssl_module.c
index a70c7f2f5..e2191ef47 100644
--- a/src/http/modules/ngx_http_ssl_module.c
+++ b/src/http/modules/ngx_http_ssl_module.c
@@ -136,13 +136,13 @@ ngx_module_t ngx_http_ssl_module = {
static ngx_http_variable_t ngx_http_ssl_vars[] = {
- { ngx_string("ssl_protocol"), ngx_http_ssl_variable,
+ { ngx_string("ssl_protocol"), NULL, ngx_http_ssl_variable,
(uintptr_t) ngx_ssl_get_protocol, NGX_HTTP_VAR_CHANGABLE, 0 },
- { ngx_string("ssl_cipher"), ngx_http_ssl_variable,
+ { ngx_string("ssl_cipher"), NULL, ngx_http_ssl_variable,
(uintptr_t) ngx_ssl_get_cipher_name, NGX_HTTP_VAR_CHANGABLE, 0 },
- { ngx_null_string, NULL, 0, 0, 0 }
+ { ngx_null_string, NULL, NULL, 0, 0, 0 }
};
@@ -190,7 +190,7 @@ ngx_http_ssl_add_variables(ngx_conf_t *cf)
return NGX_ERROR;
}
- var->handler = v->handler;
+ var->get_handler = v->get_handler;
var->data = v->data;
}
diff --git a/src/http/modules/ngx_http_userid_filter_module.c b/src/http/modules/ngx_http_userid_filter_module.c
index a7cda3218..810eb3ad1 100644
--- a/src/http/modules/ngx_http_userid_filter_module.c
+++ b/src/http/modules/ngx_http_userid_filter_module.c
@@ -559,7 +559,7 @@ ngx_http_userid_add_variables(ngx_conf_t *cf)
return NGX_ERROR;
}
- var->handler = ngx_http_userid_variable;
+ var->get_handler = ngx_http_userid_variable;
var->data = offsetof(ngx_http_userid_ctx_t, uid_got);
var = ngx_http_add_variable(cf, &ngx_http_userid_set, NGX_HTTP_VAR_NOHASH);
@@ -567,7 +567,7 @@ ngx_http_userid_add_variables(ngx_conf_t *cf)
return NGX_ERROR;
}
- var->handler = ngx_http_userid_variable;
+ var->get_handler = ngx_http_userid_variable;
var->data = offsetof(ngx_http_userid_ctx_t, uid_set);
diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c
index 198971dc9..136bac397 100644
--- a/src/http/modules/perl/ngx_http_perl_module.c
+++ b/src/http/modules/perl/ngx_http_perl_module.c
@@ -190,6 +190,10 @@ ngx_http_perl_handler(ngx_http_request_t *r)
r->request_body_in_persistent_file = 1;
r->request_body_delete_incomplete_file = 1;
+ if (r->request_body_in_file_only) {
+ r->request_body_file_log_level = 0;
+ }
+
rc = ngx_http_read_client_request_body(r, ngx_http_perl_handle_request);
if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
@@ -1011,7 +1015,7 @@ ngx_http_perl_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}
- v->handler = ngx_http_perl_variable;
+ v->get_handler = ngx_http_perl_variable;
v->data = (uintptr_t) pv;
return NGX_CONF_OK;