Permalink
Browse files

fixed a warning from the Microsoft C compiler. thanks Edwin Cleton fo…

…r the report.
  • Loading branch information...
1 parent 4b718e7 commit 40414ca1f6f709094ead7dd21e6ef6c4a89a51ac @agentzh agentzh committed Dec 22, 2013
Showing with 29 additions and 0 deletions.
  1. +6 −0 src/ngx_http_headers_more_filter_module.c
  2. +23 −0 src/ngx_http_headers_more_util.h
@@ -13,6 +13,7 @@
#include "ngx_http_headers_more_filter_module.h"
#include "ngx_http_headers_more_headers_out.h"
#include "ngx_http_headers_more_headers_in.h"
+#include "ngx_http_headers_more_util.h"
#include <ngx_config.h>
@@ -32,6 +33,8 @@ static ngx_int_t ngx_http_headers_more_handler(ngx_http_request_t *r);
static ngx_int_t ngx_http_headers_more_filter_init(ngx_conf_t *cf);
+ngx_uint_t ngx_http_headers_more_location_hash = 0;
+
static ngx_command_t ngx_http_headers_more_filter_commands[] = {
@@ -214,6 +217,9 @@ ngx_http_headers_more_post_config(ngx_conf_t *cf)
ngx_http_headers_more_main_conf_t *hmcf;
+ ngx_http_headers_more_location_hash =
+ ngx_http_headers_more_hash_literal("location");
+
hmcf = ngx_http_conf_get_module_main_conf(cf,
ngx_http_headers_more_filter_module);
@@ -11,6 +11,29 @@
#include "ngx_http_headers_more_filter_module.h"
+#define ngx_http_headers_more_hash_literal(s) \
+ ngx_http_headers_more_hash_str((u_char *) s, sizeof(s) - 1)
+
+
+static ngx_inline ngx_uint_t
+ngx_http_headers_more_hash_str(u_char *src, size_t n)
+{
+ ngx_uint_t key;
+
+ key = 0;
+
+ while (n--) {
+ key = ngx_hash(key, *src);
+ src++;
+ }
+
+ return key;
+}
+
+
+extern ngx_uint_t ngx_http_headers_more_location_hash;
+
+
ngx_int_t ngx_http_headers_more_parse_header(ngx_conf_t *cf,
ngx_str_t *cmd_name, ngx_str_t *raw_header, ngx_array_t *headers,
ngx_http_headers_more_opcode_t opcode,

0 comments on commit 40414ca

Please sign in to comment.