comparison src/http/ngx_http_cache.h @ 26:45fe5b98a9de NGINX_0_1_13

nginx 0.1.13 *) Feature: the server_names_hash and server_names_hash_threshold directives. *) Bugfix: the *.domain.tld names in the "server_name" directive did not work. *) Bugfix: the %request_length log parameter logged the incorrect length.
author Igor Sysoev <http://sysoev.ru>
date Tue, 21 Dec 2004 00:00:00 +0300
parents 8b6db3bda591
children c8cfb6c462ef
comparison
equal deleted inserted replaced
25:21488c53e135 26:45fe5b98a9de
86 ngx_buf_t *buf; 86 ngx_buf_t *buf;
87 time_t expires; 87 time_t expires;
88 time_t last_modified; 88 time_t last_modified;
89 time_t date; 89 time_t date;
90 off_t length; 90 off_t length;
91 ssize_t header_size; 91 size_t key_len;
92 size_t file_start; 92 size_t file_start;
93 ngx_file_uniq_t uniq;
93 ngx_log_t *log; 94 ngx_log_t *log;
94 95
95 /* STUB */ 96 /* STUB */
97 ssize_t header_size;
96 ngx_str_t key0; 98 ngx_str_t key0;
97 } ngx_http_cache_t; 99 } ngx_http_cache_t;
98 100
99 101
100 typedef struct { 102 typedef struct {
101 ngx_path_t path; 103 ngx_path_t *path;
102 ngx_str_t key; 104 ngx_str_t key;
105 ngx_buf_t *buf;
106
107 unsigned file:1;
108 unsigned memory:1;
109 unsigned primary:1;
103 } ngx_http_cache_ctx_t; 110 } ngx_http_cache_ctx_t;
104 111
105 112
106 #define NGX_HTTP_CACHE_STALE 1 113 #define NGX_HTTP_CACHE_STALE 1
107 #define NGX_HTTP_CACHE_AGED 2 114 #define NGX_HTTP_CACHE_AGED 2
108 #define NGX_HTTP_CACHE_THE_SAME 3 115 #define NGX_HTTP_CACHE_THE_SAME 3
116
117
118 ngx_int_t ngx_http_cache_get(ngx_http_request_t *r, ngx_http_cache_ctx_t *ctx);
119
120 ngx_int_t ngx_http_file_cache_get(ngx_http_request_t *r,
121 ngx_http_cache_ctx_t *ctx);
122
123 ngx_int_t ngx_http_file_cache_open(ngx_http_cache_t *c);
124
125 ngx_int_t ngx_http_cache_cleaner_handler(ngx_gc_t *gc, ngx_str_t *name,
126 ngx_dir_t *dir);
109 127
110 128
111 #if 0 129 #if 0
112 130
113 ngx_http_cache_t *ngx_http_cache_get(ngx_http_cache_hash_t *cache, 131 ngx_http_cache_t *ngx_http_cache_get(ngx_http_cache_hash_t *cache,
123 ngx_str_t *key, ngx_str_t *value, ngx_log_t *log); 141 ngx_str_t *key, ngx_str_t *value, ngx_log_t *log);
124 void ngx_http_cache_lock(ngx_http_cache_hash_t *hash, ngx_http_cache_t *cache); 142 void ngx_http_cache_lock(ngx_http_cache_hash_t *hash, ngx_http_cache_t *cache);
125 void ngx_http_cache_unlock(ngx_http_cache_hash_t *hash, 143 void ngx_http_cache_unlock(ngx_http_cache_hash_t *hash,
126 ngx_http_cache_t *cache, ngx_log_t *log); 144 ngx_http_cache_t *cache, ngx_log_t *log);
127 145
128 int ngx_http_cache_get_file(ngx_http_request_t *r, ngx_http_cache_ctx_t *ctx);
129 int ngx_http_cache_open_file(ngx_http_cache_ctx_t *ctx, ngx_file_uniq_t uniq);
130 int ngx_http_cache_update_file(ngx_http_request_t *r,ngx_http_cache_ctx_t *ctx, 146 int ngx_http_cache_update_file(ngx_http_request_t *r,ngx_http_cache_ctx_t *ctx,
131 ngx_str_t *temp_file); 147 ngx_str_t *temp_file);
132 148
133 int ngx_http_send_cached(ngx_http_request_t *r); 149 int ngx_http_send_cached(ngx_http_request_t *r);
134 150
135
136 int ngx_garbage_collector_http_cache_handler(ngx_gc_t *gc, ngx_str_t *name,
137 ngx_dir_t *dir);
138 151
139 char *ngx_http_set_cache_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); 152 char *ngx_http_set_cache_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
140 153
141 #endif 154 #endif
142 155