Latency problem with one browser

Maxim Dounin mdounin at mdounin.ru
Thu Mar 15 18:42:53 UTC 2012


Hello!

On Sun, Mar 04, 2012 at 10:08:45PM +0100, Piotr Sikora wrote:

> 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;
> +            }

I would rather do 

--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -1493,7 +1493,9 @@ ngx_http_process_user_agent(ngx_http_req
         } else if (ngx_strstrn(user_agent, "Chrome/", 7 - 1)) {
             r->headers_in.chrome = 1;
 
-        } else if (ngx_strstrn(user_agent, "Safari/", 7 - 1)) {
+        } else if (ngx_strstrn(user_agent, "Safari/", 7 - 1)
+                   && ngx_strstrn(user_agent, "Mac OS X", 8 - 1))
+        {
             r->headers_in.safari = 1;
 
         } else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) {

As the sole purpose of r->headers_in.safari bit is to activate 
this particular workaround.  Any objections?

Maxim Dounin



More information about the nginx mailing list