comparison src/http/modules/ngx_http_gzip_static_module.c @ 546:e19e5f542878 NGINX_0_8_25

nginx 0.8.25 *) Change: now no message is written in an error log if a variable is not found by $r->variable() method. *) Feature: the ngx_http_degradation_module. *) Feature: regular expression named captures. *) Feature: now URI part is not required a "proxy_pass" directive if variables are used. *) Feature: now the "msie_padding" directive works for Chrome too. *) Bugfix: a segmentation fault occurred in a worker process on low memory condition; the bug had appeared in 0.8.18. *) Bugfix: nginx sent gzipped responses to clients those do not support gzip, if "gzip_static on" and "gzip_vary off"; the bug had appeared in 0.8.16.
author Igor Sysoev <http://sysoev.ru>
date Mon, 16 Nov 2009 00:00:00 +0300
parents f7ec98e3caeb
children 566e105a89f1
comparison
equal deleted inserted replaced
545:91e4b06e1a01 546:e19e5f542878
97 97
98 if (!gzcf->enable) { 98 if (!gzcf->enable) {
99 return NGX_DECLINED; 99 return NGX_DECLINED;
100 } 100 }
101 101
102 rc = ngx_http_gzip_ok(r);
103
102 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 104 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
103 105
104 if (clcf->gzip_vary && ngx_http_gzip_ok(r) != NGX_OK) { 106 if (!clcf->gzip_vary && rc != NGX_OK) {
105 return NGX_DECLINED; 107 return NGX_DECLINED;
106 } 108 }
107 109
108 log = r->connection->log; 110 log = r->connection->log;
109 111
141 143
142 case NGX_ENOENT: 144 case NGX_ENOENT:
143 case NGX_ENOTDIR: 145 case NGX_ENOTDIR:
144 case NGX_ENAMETOOLONG: 146 case NGX_ENAMETOOLONG:
145 147
146 r->gzip = 0;
147 return NGX_DECLINED; 148 return NGX_DECLINED;
148 149
149 case NGX_EACCES: 150 case NGX_EACCES:
150 151
151 level = NGX_LOG_ERR; 152 level = NGX_LOG_ERR;
158 } 159 }
159 160
160 ngx_log_error(level, log, of.err, 161 ngx_log_error(level, log, of.err,
161 "%s \"%s\" failed", of.failed, path.data); 162 "%s \"%s\" failed", of.failed, path.data);
162 163
164 return NGX_DECLINED;
165 }
166
167 r->gzip_vary = 1;
168
169 if (rc != NGX_OK) {
163 return NGX_DECLINED; 170 return NGX_DECLINED;
164 } 171 }
165 172
166 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);
167 174