mirror of
https://github.com/openresty/openresty.git
synced 2024-10-13 00:29:41 +00:00
FreeBSD
clients
demo
misc
patches
lua-5.1.4-makefile_install_fix.patch
lua-5.1.5-disable_lua50_compat.patch
lua-5.1.5-makefile_install_fix.patch
lua_cjson-1.0.2-array_detection_fix.patch
nginx-0.8.54-allow_request_body_updating.patch
nginx-0.8.54-named_location_clear_mods_ctx.patch
nginx-0.8.54-no_Werror.patch
nginx-0.8.54-no_error_pages.patch
nginx-0.8.54-redirect_memcpy_overlap.patch
nginx-0.8.54-request_body_in_single_buf.patch
nginx-0.8.54-request_body_preread_fix.patch
nginx-0.8.54-server_header.patch
nginx-0.8.54-subrequest_loop.patch
nginx-0.8.54-variable_header_ignore_no_hash.patch
nginx-1.0.10-allow_request_body_updating.patch
nginx-1.0.10-epoll_check_stale_wev.patch
nginx-1.0.10-gzip_empty_flush_buf.patch
nginx-1.0.10-log_escape_non_ascii.patch
nginx-1.0.10-named_location_clear_mods_ctx.patch
nginx-1.0.10-no_Werror.patch
nginx-1.0.10-no_error_pages.patch
nginx-1.0.10-no_pool.patch
nginx-1.0.10-request_body_in_single_buf.patch
nginx-1.0.10-request_body_preread_fix.patch
nginx-1.0.10-server_header.patch
nginx-1.0.10-subrequest_loop.patch
nginx-1.0.10-variable_header_ignore_no_hash.patch
nginx-1.0.11-allow_request_body_updating.patch
nginx-1.0.11-epoll_check_stale_wev.patch
nginx-1.0.11-gzip_empty_flush_buf.patch
nginx-1.0.11-log_escape_non_ascii.patch
nginx-1.0.11-max_subrequests.patch
nginx-1.0.11-named_location_clear_mods_ctx.patch
nginx-1.0.11-no_Werror.patch
nginx-1.0.11-no_error_pages.patch
nginx-1.0.11-no_pool.patch
nginx-1.0.11-null_character_fixes.patch
nginx-1.0.11-request_body_in_single_buf.patch
nginx-1.0.11-request_body_preread_fix.patch
nginx-1.0.11-server_header.patch
nginx-1.0.11-subrequest_loop.patch
nginx-1.0.11-upstream_pipelining.patch
nginx-1.0.11-variable_header_ignore_no_hash.patch
nginx-1.0.12-allow_request_body_updating.patch
nginx-1.0.12-epoll_check_stale_wev.patch
nginx-1.0.12-gzip_empty_flush_buf.patch
nginx-1.0.12-log_escape_non_ascii.patch
nginx-1.0.12-max_subrequests.patch
nginx-1.0.12-named_location_clear_mods_ctx.patch
nginx-1.0.12-no_Werror.patch
nginx-1.0.12-no_error_pages.patch
nginx-1.0.12-no_pool.patch
nginx-1.0.12-request_body_in_single_buf.patch
nginx-1.0.12-request_body_preread_fix.patch
nginx-1.0.12-server_header.patch
nginx-1.0.12-subrequest_loop.patch
nginx-1.0.12-variable_header_ignore_no_hash.patch
nginx-1.0.14-allow_request_body_updating.patch
nginx-1.0.14-epoll_check_stale_wev.patch
nginx-1.0.14-gzip_empty_flush_buf.patch
nginx-1.0.14-log_escape_non_ascii.patch
nginx-1.0.14-max_subrequests.patch
nginx-1.0.14-named_location_clear_mods_ctx.patch
nginx-1.0.14-no_Werror.patch
nginx-1.0.14-no_error_pages.patch
nginx-1.0.14-no_pool.patch
nginx-1.0.14-null_character_fixes.patch
nginx-1.0.14-request_body_in_single_buf.patch
nginx-1.0.14-request_body_preread_fix.patch
nginx-1.0.14-server_header.patch
nginx-1.0.14-subrequest_loop.patch
nginx-1.0.14-upstream_pipelining.patch
nginx-1.0.14-variable_header_ignore_no_hash.patch
nginx-1.0.15-add_core_vars_polluting_globals.patch
nginx-1.0.15-allow_request_body_updating.patch
nginx-1.0.15-filter_finalize_hang.patch
nginx-1.0.15-gzip_empty_flush_buf.patch
nginx-1.0.15-log_escape_non_ascii.patch
nginx-1.0.15-max_subrequests.patch
nginx-1.0.15-named_location_clear_mods_ctx.patch
nginx-1.0.15-no_Werror.patch
nginx-1.0.15-no_error_pages.patch
nginx-1.0.15-no_pool.patch
nginx-1.0.15-null_character_fixes.patch
nginx-1.0.15-poll_del_event_at_exit.patch
nginx-1.0.15-request_body_in_single_buf.patch
nginx-1.0.15-request_body_preread_fix.patch
nginx-1.0.15-reset_wev_handler_in_named_locations.patch
nginx-1.0.15-resolver_debug_log_overflow.patch
nginx-1.0.15-server_header.patch
nginx-1.0.15-subrequest_loop.patch
nginx-1.0.15-upstream_pipelining.patch
nginx-1.0.15-variable_header_ignore_no_hash.patch
nginx-1.0.4-gcc46_fixes.patch
nginx-1.0.4-no_Werror.patch
nginx-1.0.4-no_error_pages.patch
nginx-1.0.4-no_pool.patch
nginx-1.0.4-request_body_in_single_buf.patch
nginx-1.0.4-request_body_preread_fix.patch
nginx-1.0.4-server_header.patch
nginx-1.0.4-subrequest_loop.patch
nginx-1.0.5-no_Werror.patch
nginx-1.0.5-no_error_pages.patch
nginx-1.0.5-no_pool.patch
nginx-1.0.5-request_body_in_single_buf.patch
nginx-1.0.5-request_body_preread_fix.patch
nginx-1.0.5-server_header.patch
nginx-1.0.5-subrequest_loop.patch
nginx-1.0.6-gzip_empty_flush_buf.patch
nginx-1.0.6-no_Werror.patch
nginx-1.0.6-no_error_pages.patch
nginx-1.0.6-no_pool.patch
nginx-1.0.6-request_body_in_single_buf.patch
nginx-1.0.6-request_body_preread_fix.patch
nginx-1.0.6-server_header.patch
nginx-1.0.6-subrequest_loop.patch
nginx-1.0.6-variable_header_ignore_no_hash.patch
nginx-1.0.8-allow_request_body_updating.patch
nginx-1.0.8-gzip_empty_flush_buf.patch
nginx-1.0.8-named_location_clear_mods_ctx.patch
nginx-1.0.8-no_Werror.patch
nginx-1.0.8-no_error_pages.patch
nginx-1.0.8-no_pool.patch
nginx-1.0.8-request_body_in_single_buf.patch
nginx-1.0.8-request_body_preread_fix.patch
nginx-1.0.8-server_header.patch
nginx-1.0.8-subrequest_loop.patch
nginx-1.0.8-variable_header_ignore_no_hash.patch
nginx-1.0.9-allow_request_body_updating.patch
nginx-1.0.9-epoll_check_stale_wev.patch
nginx-1.0.9-gzip_empty_flush_buf.patch
nginx-1.0.9-log_escape_non_ascii.patch
nginx-1.0.9-named_location_clear_mods_ctx.patch
nginx-1.0.9-no_Werror.patch
nginx-1.0.9-no_error_pages.patch
nginx-1.0.9-no_pool.patch
nginx-1.0.9-request_body_in_single_buf.patch
nginx-1.0.9-request_body_preread_fix.patch
nginx-1.0.9-server_header.patch
nginx-1.0.9-subrequest_loop.patch
nginx-1.0.9-variable_header_ignore_no_hash.patch
nginx-1.1.15-allow_request_body_updating.patch
nginx-1.1.15-gzip_empty_flush_buf.patch
nginx-1.1.15-log_escape_non_ascii.patch
nginx-1.1.15-named_location_clear_mods_ctx.patch
nginx-1.1.15-no_Werror.patch
nginx-1.1.15-no_error_pages.patch
nginx-1.1.15-no_pool.patch
nginx-1.1.15-server_header.patch
nginx-1.1.15-subrequest_loop.patch
nginx-1.1.2-no_error_pages.patch
nginx-1.1.4-variable_header_ignore_no_hash.patch
nginx-1.1.5-named_location_clear_mods_ctx.patch
nginx-1.2.1-add_core_vars_polluting_globals.patch
nginx-1.2.1-allow_request_body_updating.patch
nginx-1.2.1-dtrace.patch
nginx-1.2.1-location_if_inherits_proxy.patch
nginx-1.2.1-log_escape_non_ascii.patch
nginx-1.2.1-no_Werror.patch
nginx-1.2.1-no_error_pages.patch
nginx-1.2.1-no_pool.patch
nginx-1.2.1-poll_del_event_at_exit.patch
nginx-1.2.1-resolver_debug_log_overflow.patch
nginx-1.2.1-server_header.patch
nginx-1.2.1-upstream_pipelining.patch
nginx-1.2.3-allow_request_body_updating.patch
nginx-1.2.3-channel-uninit-params.patch
nginx-1.2.3-dtrace.patch
nginx-1.2.3-location_if_inherits_proxy.patch
nginx-1.2.3-log_escape_non_ascii.patch
nginx-1.2.3-no_Werror.patch
nginx-1.2.3-no_error_pages.patch
nginx-1.2.3-no_pool.patch
nginx-1.2.3-nonbuffered-upstream-truncation.patch
nginx-1.2.3-server_header.patch
nginx-1.2.3-upstream_pipelining.patch
nginx-1.2.4-allow_request_body_updating.patch
nginx-1.2.4-channel-uninit-params.patch
nginx-1.2.4-dtrace.patch
nginx-1.2.4-location_if_inherits_proxy.patch
nginx-1.2.4-log_escape_non_ascii.patch
nginx-1.2.4-no_Werror.patch
nginx-1.2.4-no_error_pages.patch
nginx-1.2.4-no_pool.patch
nginx-1.2.4-nonbuffered-upstream-truncation.patch
nginx-1.2.4-server_header.patch
nginx-1.2.4-upstream_pipelining.patch
nginx-1.2.4-upstream_test_connect_kqueue.patch
nginx-1.3.0-resolver_debug_log_overflow.patch
nginx-1.3.4-allow_request_body_updating.patch
nginx-1.3.4-dtrace.patch
nginx-1.3.4-location_if_inherits_proxy.patch
nginx-1.3.4-log_escape_non_ascii.patch
nginx-1.3.4-no_Werror.patch
nginx-1.3.4-no_error_pages.patch
nginx-1.3.4-no_pool.patch
nginx-1.3.4-server_header.patch
nginx-1.3.4-upstream_pipelining.patch
nginx-1.3.6-allow_request_body_updating.patch
nginx-1.3.6-channel-uninit-params.patch
nginx-1.3.6-dtrace.patch
nginx-1.3.6-location_if_inherits_proxy.patch
nginx-1.3.6-log_escape_non_ascii.patch
nginx-1.3.6-no_Werror.patch
nginx-1.3.6-no_error_pages.patch
nginx-1.3.6-no_pool.patch
nginx-1.3.6-nonbuffered-upstream-truncation.patch
nginx-1.3.6-server_header.patch
nginx-1.3.6-upstream_pipelining.patch
nginx-1.3.7-allow_request_body_updating.patch
nginx-1.3.7-channel-uninit-params.patch
nginx-1.3.7-dtrace.patch
nginx-1.3.7-location_if_inherits_proxy.patch
nginx-1.3.7-log_escape_non_ascii.patch
nginx-1.3.7-no_Werror.patch
nginx-1.3.7-no_error_pages.patch
nginx-1.3.7-no_pool.patch
nginx-1.3.7-nonbuffered-upstream-truncation.patch
nginx-1.3.7-server_header.patch
nginx-1.3.7-upstream_pipelining.patch
specs
t
util
.gitignore
Makefile
README
116 lines
3.5 KiB
Diff
116 lines
3.5 KiB
Diff
--- nginx-1.0.10/src/http/modules/ngx_http_log_module.c 2011-11-01 21:24:50.000000000 +0800
|
|
+++ nginx-1.0.10-patched/src/http/modules/ngx_http_log_module.c 2011-11-10 16:17:29.599039534 +0800
|
|
@@ -61,6 +61,8 @@
|
|
time_t open_file_cache_valid;
|
|
ngx_uint_t open_file_cache_min_uses;
|
|
|
|
+ ngx_flag_t escape_non_ascii;
|
|
+
|
|
ngx_uint_t off; /* unsigned off:1 */
|
|
} ngx_http_log_loc_conf_t;
|
|
|
|
@@ -104,7 +106,8 @@
|
|
uintptr_t data);
|
|
static u_char *ngx_http_log_variable(ngx_http_request_t *r, u_char *buf,
|
|
ngx_http_log_op_t *op);
|
|
-static uintptr_t ngx_http_log_escape(u_char *dst, u_char *src, size_t size);
|
|
+static uintptr_t ngx_http_log_escape(ngx_http_log_loc_conf_t *lcf, u_char *dst,
|
|
+ u_char *src, size_t size);
|
|
|
|
|
|
static void *ngx_http_log_create_main_conf(ngx_conf_t *cf);
|
|
@@ -146,6 +149,13 @@
|
|
0,
|
|
NULL },
|
|
|
|
+ { ngx_string("log_escape_non_ascii"),
|
|
+ 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_log_loc_conf_t, escape_non_ascii),
|
|
+ NULL },
|
|
+
|
|
ngx_null_command
|
|
};
|
|
|
|
@@ -637,6 +647,7 @@
|
|
ngx_http_log_variable_getlen(ngx_http_request_t *r, uintptr_t data)
|
|
{
|
|
uintptr_t len;
|
|
+ ngx_http_log_loc_conf_t *lcf;
|
|
ngx_http_variable_value_t *value;
|
|
|
|
value = ngx_http_get_indexed_variable(r, data);
|
|
@@ -645,7 +656,9 @@
|
|
return 1;
|
|
}
|
|
|
|
- len = ngx_http_log_escape(NULL, value->data, value->len);
|
|
+ lcf = ngx_http_get_module_loc_conf(r, ngx_http_log_module);
|
|
+
|
|
+ len = ngx_http_log_escape(lcf, NULL, value->data, value->len);
|
|
|
|
value->escape = len ? 1 : 0;
|
|
|
|
@@ -656,6 +669,7 @@
|
|
static u_char *
|
|
ngx_http_log_variable(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
|
|
{
|
|
+ ngx_http_log_loc_conf_t *lcf;
|
|
ngx_http_variable_value_t *value;
|
|
|
|
value = ngx_http_get_indexed_variable(r, op->data);
|
|
@@ -669,16 +683,18 @@
|
|
return ngx_cpymem(buf, value->data, value->len);
|
|
|
|
} else {
|
|
- return (u_char *) ngx_http_log_escape(buf, value->data, value->len);
|
|
+ lcf = ngx_http_get_module_loc_conf(r, ngx_http_log_module);
|
|
+ return (u_char *) ngx_http_log_escape(lcf, buf, value->data, value->len);
|
|
}
|
|
}
|
|
|
|
|
|
static uintptr_t
|
|
-ngx_http_log_escape(u_char *dst, u_char *src, size_t size)
|
|
+ngx_http_log_escape(ngx_http_log_loc_conf_t *lcf, u_char *dst, u_char *src,
|
|
+ size_t size)
|
|
{
|
|
- ngx_uint_t n;
|
|
- static u_char hex[] = "0123456789ABCDEF";
|
|
+ ngx_uint_t n;
|
|
+ static u_char hex[] = "0123456789ABCDEF";
|
|
|
|
static uint32_t escape[] = {
|
|
0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
|
|
@@ -698,6 +714,12 @@
|
|
0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
|
|
};
|
|
|
|
+ if (lcf->escape_non_ascii) {
|
|
+ ngx_memset(&escape[4], 0xff, sizeof(uint32_t) * 4);
|
|
+
|
|
+ } else {
|
|
+ ngx_memzero(&escape[4], sizeof(uint32_t) * 4);
|
|
+ }
|
|
|
|
if (dst == NULL) {
|
|
|
|
@@ -781,6 +803,7 @@
|
|
}
|
|
|
|
conf->open_file_cache = NGX_CONF_UNSET_PTR;
|
|
+ conf->escape_non_ascii = NGX_CONF_UNSET;
|
|
|
|
return conf;
|
|
}
|
|
@@ -796,6 +819,8 @@
|
|
ngx_http_log_fmt_t *fmt;
|
|
ngx_http_log_main_conf_t *lmcf;
|
|
|
|
+ ngx_conf_merge_value(conf->escape_non_ascii, prev->escape_non_ascii, 1);
|
|
+
|
|
if (conf->open_file_cache == NGX_CONF_UNSET_PTR) {
|
|
|
|
conf->open_file_cache = prev->open_file_cache;
|