mirror of
https://github.com/openresty/openresty.git
synced 2024-10-13 00:29:41 +00:00
upgraded the nginx core to 1.2.1. bumped the version of ngx_openresty to 1.2.1.1rc1.
This commit is contained in:
26
patches/nginx-1.2.1-add_core_vars_polluting_globals.patch
Normal file
26
patches/nginx-1.2.1-add_core_vars_polluting_globals.patch
Normal file
@ -0,0 +1,26 @@
|
||||
--- nginx-1.2.1/src/http/ngx_http_variables.c 2012-03-05 20:36:51.000000000 +0800
|
||||
+++ nginx-1.2.1-patched/src/http/ngx_http_variables.c 2012-05-17 16:21:42.120968722 +0800
|
||||
@@ -1898,6 +1898,7 @@
|
||||
{
|
||||
ngx_int_t rc;
|
||||
ngx_http_variable_t *v;
|
||||
+ ngx_http_variable_t *value;
|
||||
ngx_http_core_main_conf_t *cmcf;
|
||||
|
||||
cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
|
||||
@@ -1918,7 +1919,14 @@
|
||||
}
|
||||
|
||||
for (v = ngx_http_core_variables; v->name.len; v++) {
|
||||
- rc = ngx_hash_add_key(cmcf->variables_keys, &v->name, v,
|
||||
+ value = ngx_palloc(cf->pool, sizeof(ngx_http_variable_t));
|
||||
+ if (value == NULL) {
|
||||
+ return NGX_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ *value = *v;
|
||||
+
|
||||
+ rc = ngx_hash_add_key(cmcf->variables_keys, &value->name, value,
|
||||
NGX_HASH_READONLY_KEY);
|
||||
|
||||
if (rc == NGX_OK) {
|
Reference in New Issue
Block a user