comparison src/http/modules/ngx_http_gzip_static_module.c @ 578:f3a9e57d2e17

Merge with current.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 11 Mar 2010 21:27:17 +0300
parents e19e5f542878
children 566e105a89f1
comparison
equal deleted inserted replaced
539:5f4de8cf0d9d 578:f3a9e57d2e17
93 return NGX_DECLINED; 93 return NGX_DECLINED;
94 } 94 }
95 95
96 gzcf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_static_module); 96 gzcf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_static_module);
97 97
98 if (!gzcf->enable || ngx_http_gzip_ok(r) != NGX_OK) { 98 if (!gzcf->enable) {
99 return NGX_DECLINED;
100 }
101
102 rc = ngx_http_gzip_ok(r);
103
104 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
105
106 if (!clcf->gzip_vary && rc != NGX_OK) {
99 return NGX_DECLINED; 107 return NGX_DECLINED;
100 } 108 }
101 109
102 log = r->connection->log; 110 log = r->connection->log;
103 111
114 path.len = p - path.data; 122 path.len = p - path.data;
115 123
116 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, 124 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0,
117 "http filename: \"%s\"", path.data); 125 "http filename: \"%s\"", path.data);
118 126
119 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
120
121 ngx_memzero(&of, sizeof(ngx_open_file_info_t)); 127 ngx_memzero(&of, sizeof(ngx_open_file_info_t));
122 128
129 of.read_ahead = clcf->read_ahead;
123 of.directio = clcf->directio; 130 of.directio = clcf->directio;
124 of.valid = clcf->open_file_cache_valid; 131 of.valid = clcf->open_file_cache_valid;
125 of.min_uses = clcf->open_file_cache_min_uses; 132 of.min_uses = clcf->open_file_cache_min_uses;
126 of.errors = clcf->open_file_cache_errors; 133 of.errors = clcf->open_file_cache_errors;
127 of.events = clcf->open_file_cache_events; 134 of.events = clcf->open_file_cache_events;
155 "%s \"%s\" failed", of.failed, path.data); 162 "%s \"%s\" failed", of.failed, path.data);
156 163
157 return NGX_DECLINED; 164 return NGX_DECLINED;
158 } 165 }
159 166
167 r->gzip_vary = 1;
168
169 if (rc != NGX_OK) {
170 return NGX_DECLINED;
171 }
172
160 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", of.fd); 173 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", of.fd);
161 174
162 if (of.is_dir) { 175 if (of.is_dir) {
163 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http dir"); 176 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http dir");
164 return NGX_DECLINED; 177 return NGX_DECLINED;