Latency problem with one browser
Piotr Sikora
piotr.sikora at frickle.com
Sun Mar 4 21:08:45 UTC 2012
Hi Maxim,
> Restricting the workaround to something like "Safari on Mac OS X"
> would be fine too, though it's mostly orthogonal to changing the
> default.
I believe this patch is sufficient.
"Mac OS X" string is present in all affected devices, i.e.:
- Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8) ...
- Mozilla/5.0 (iPad; CPU OS 5_0_1 like Mac OS X) ...
- Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) ...
- Mozilla/5.0 (iPod; CPU iPhone OS 5_0_1 like Mac OS X) ...
--- src/http/ngx_http_request.c.orig Sun Mar 4 20:53:14 2012
+++ src/http/ngx_http_request.c Sun Mar 4 20:55:36 2012
@@ -1496,6 +1496,10 @@ ngx_http_process_user_agent(ngx_http_request_t *r, ngx
} else if (ngx_strstrn(user_agent, "Safari/", 7 - 1)) {
r->headers_in.safari = 1;
+ if (ngx_strstrn(user_agent, "Mac OS X", 8 - 1)) {
+ r->headers_in.safari_osx = 1;
+ }
+
} else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) {
r->headers_in.konqueror = 1;
}
--- src/http/ngx_http_request.h.orig Sun Mar 4 20:55:38 2012
+++ src/http/ngx_http_request.h Sun Mar 4 20:56:04 2012
@@ -228,6 +228,7 @@ typedef struct {
unsigned gecko:1;
unsigned chrome:1;
unsigned safari:1;
+ unsigned safari_osx:1;
unsigned konqueror:1;
} ngx_http_headers_in_t;
--- src/http/ngx_http_core_module.c.orig Sun Mar 4 20:56:25 2012
+++ src/http/ngx_http_core_module.c Sun Mar 4 20:56:42 2012
@@ -1485,7 +1485,7 @@ ngx_http_update_location_config(ngx_http_request_t *r)
*/
r->keepalive = 0;
- } else if (r->headers_in.safari
+ } else if (r->headers_in.safari_osx
&& (clcf->keepalive_disable
& NGX_HTTP_KEEPALIVE_DISABLE_SAFARI))
{
Best regards,
Piotr Sikora < piotr.sikora at frickle.com >
More information about the nginx
mailing list