diff src/http/ngx_http_core_module.h @ 138:8e6d4d96ec4c NGINX_0_3_16

nginx 0.3.16 *) Feature: the ngx_http_map_module. *) Feature: the "types_hash_max_size" and "types_hash_bucket_size" directives. *) Feature: the "ssi_value_length" directive. *) Feature: the "worker_rlimit_core" directive. *) Workaround: the connection number in logs was always 1 if nginx was built by the icc 8.1 or 9.0 compilers with optimization for Pentium 4. *) Bugfix: the "config timefmt" SSI command set incorrect time format. *) Bugfix: nginx did not close connection to IMAP/POP3 backend for the SSL connections; bug appeared in 0.3.13. Thanks to Rob Mueller. *) Bugfix: segmentation fault may occurred in at SSL shutdown; bug appeared in 0.3.13.
author Igor Sysoev <http://sysoev.ru>
date Fri, 16 Dec 2005 00:00:00 +0300
parents 82d695e3d662
children 84910468f6de
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.h
+++ b/src/http/ngx_http_core_module.h
@@ -70,8 +70,8 @@ typedef struct {
 
     ngx_http_phase_t           phases[NGX_HTTP_LOG_PHASE + 1];
 
-    ngx_hash_t                 headers_in_hash;
-    ngx_hash_t                 variables_hash;
+    ngx_hash0_t                headers_in_hash;
+    ngx_hash0_t                variables_hash;
 
     ngx_uint_t                 server_names_hash;
     ngx_uint_t                 server_names_hash_threshold;
@@ -154,23 +154,6 @@ typedef struct {
         }
 
 
-#define NGX_HTTP_TYPES_HASH_PRIME  13
-
-#define ngx_http_types_hash_key(key, ext)                                   \
-        {                                                                   \
-            ngx_uint_t  n;                                                  \
-            for (key = 0, n = 0; n < ext.len; n++) {                        \
-                key += ext.data[n];                                         \
-            }                                                               \
-            key %= NGX_HTTP_TYPES_HASH_PRIME;                               \
-        }
-
-typedef struct {
-    ngx_str_t     exten;
-    ngx_str_t     type;
-} ngx_http_type_t;
-
-
 typedef struct {
     ngx_int_t     status;
     ngx_int_t     overwrite;
@@ -203,12 +186,13 @@ struct ngx_http_core_loc_conf_s {
 
     ngx_http_handler_pt  handler;
 
-    ngx_array_t  *types;
-    ngx_str_t     default_type;
-
     ngx_str_t     root;                    /* root, alias */
     ngx_str_t     post_action;
 
+    ngx_array_t  *types;
+    ngx_hash_t    types_hash;
+    ngx_str_t     default_type;
+
     size_t        client_max_body_size;    /* client_max_body_size */
     size_t        client_body_buffer_size; /* client_body_buffer_size */
     size_t        send_lowat;              /* send_lowat */
@@ -241,6 +225,9 @@ struct ngx_http_core_loc_conf_s {
 
     ngx_log_t    *err_log;
 
+    ngx_uint_t    types_hash_max_size;
+    ngx_uint_t    types_hash_bucket_size;
+
 #if 0
     ngx_http_core_loc_conf_t  *prev_location;
 #endif