comparison src/http/modules/ngx_http_gzip_static_module.c @ 635:e67b227c8dbb default tip

Merge with current.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 25 Apr 2011 04:07:55 +0400
parents ff463db0be31
children
comparison
equal deleted inserted replaced
578:f3a9e57d2e17 635:e67b227c8dbb
87 87
88 if (r->uri.data[r->uri.len - 1] == '/') { 88 if (r->uri.data[r->uri.len - 1] == '/') {
89 return NGX_DECLINED; 89 return NGX_DECLINED;
90 } 90 }
91 91
92 if (r->zero_in_uri) {
93 return NGX_DECLINED;
94 }
95
96 gzcf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_static_module); 92 gzcf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_static_module);
97 93
98 if (!gzcf->enable) { 94 if (!gzcf->enable) {
99 return NGX_DECLINED; 95 return NGX_DECLINED;
100 } 96 }
178 } 174 }
179 175
180 #if !(NGX_WIN32) /* the not regular files are probably Unix specific */ 176 #if !(NGX_WIN32) /* the not regular files are probably Unix specific */
181 177
182 if (!of.is_file) { 178 if (!of.is_file) {
183 ngx_log_error(NGX_LOG_CRIT, log, ngx_errno, 179 ngx_log_error(NGX_LOG_CRIT, log, 0,
184 "\"%s\" is not a regular file", path.data); 180 "\"%s\" is not a regular file", path.data);
185 181
186 return NGX_HTTP_NOT_FOUND; 182 return NGX_HTTP_NOT_FOUND;
187 } 183 }
188 184
210 if (h == NULL) { 206 if (h == NULL) {
211 return NGX_ERROR; 207 return NGX_ERROR;
212 } 208 }
213 209
214 h->hash = 1; 210 h->hash = 1;
215 h->key.len = sizeof("Content-Encoding") - 1; 211 ngx_str_set(&h->key, "Content-Encoding");
216 h->key.data = (u_char *) "Content-Encoding"; 212 ngx_str_set(&h->value, "gzip");
217 h->value.len = sizeof("gzip") - 1;
218 h->value.data = (u_char *) "gzip";
219
220 r->headers_out.content_encoding = h; 213 r->headers_out.content_encoding = h;
214
221 r->ignore_content_encoding = 1; 215 r->ignore_content_encoding = 1;
222 216
223 /* we need to allocate all before the header would be sent */ 217 /* we need to allocate all before the header would be sent */
224 218
225 b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)); 219 b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));