Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 2205:5398f47082f0
gzip_disable msie6
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 26 Aug 2008 15:09:28 +0000 |
parents | a953f73273ee |
children | 109849282793 |
comparison
equal
deleted
inserted
replaced
2204:70a2bcc7e307 | 2205:5398f47082f0 |
---|---|
1288 | 1288 |
1289 static ngx_int_t | 1289 static ngx_int_t |
1290 ngx_http_process_user_agent(ngx_http_request_t *r, ngx_table_elt_t *h, | 1290 ngx_http_process_user_agent(ngx_http_request_t *r, ngx_table_elt_t *h, |
1291 ngx_uint_t offset) | 1291 ngx_uint_t offset) |
1292 { | 1292 { |
1293 u_char *ua, *user_agent; | 1293 u_char *user_agent, *msie; |
1294 | 1294 |
1295 if (r->headers_in.user_agent) { | 1295 if (r->headers_in.user_agent) { |
1296 return NGX_OK; | 1296 return NGX_OK; |
1297 } | 1297 } |
1298 | 1298 |
1300 | 1300 |
1301 /* check some widespread browsers while the header is in CPU cache */ | 1301 /* check some widespread browsers while the header is in CPU cache */ |
1302 | 1302 |
1303 user_agent = h->value.data; | 1303 user_agent = h->value.data; |
1304 | 1304 |
1305 ua = ngx_strstrn(user_agent, "MSIE", 4 - 1); | 1305 msie = ngx_strstrn(user_agent, "MSIE ", 5 - 1); |
1306 | 1306 |
1307 if (ua && ua + 8 < user_agent + h->value.len) { | 1307 if (msie && msie + 7 < user_agent + h->value.len) { |
1308 | 1308 |
1309 r->headers_in.msie = 1; | 1309 r->headers_in.msie = 1; |
1310 | 1310 |
1311 if (ua[4] == ' ' && ua[5] == '4' && ua[6] == '.') { | 1311 if (msie[6] == '.') { |
1312 r->headers_in.msie4 = 1; | 1312 |
1313 switch (msie[5]) { | |
1314 case '4': | |
1315 r->headers_in.msie4 = 1; | |
1316 /* fall through */ | |
1317 case '5': | |
1318 case '6': | |
1319 r->headers_in.msie6 = 1; | |
1320 } | |
1313 } | 1321 } |
1314 | 1322 |
1315 #if 0 | 1323 #if 0 |
1316 /* MSIE ignores the SSL "close notify" alert */ | 1324 /* MSIE ignores the SSL "close notify" alert */ |
1317 if (c->ssl) { | 1325 if (c->ssl) { |
1322 | 1330 |
1323 if (ngx_strstrn(user_agent, "Opera", 5 - 1)) { | 1331 if (ngx_strstrn(user_agent, "Opera", 5 - 1)) { |
1324 r->headers_in.opera = 1; | 1332 r->headers_in.opera = 1; |
1325 r->headers_in.msie = 0; | 1333 r->headers_in.msie = 0; |
1326 r->headers_in.msie4 = 0; | 1334 r->headers_in.msie4 = 0; |
1335 r->headers_in.msie6 = 0; | |
1327 } | 1336 } |
1328 | 1337 |
1329 if (!r->headers_in.msie && !r->headers_in.opera) { | 1338 if (!r->headers_in.msie && !r->headers_in.opera) { |
1330 | 1339 |
1331 if (ngx_strstrn(user_agent, "Gecko/", 6 - 1)) { | 1340 if (ngx_strstrn(user_agent, "Gecko/", 6 - 1)) { |