[PATCH] allow keep-alive to safari when it's ok
Igor Sysoev
igor at sysoev.ru
Fri Feb 11 10:47:23 MSK 2011
On Thu, Feb 10, 2011 at 07:05:57PM -0800, Naoki Hiroshima wrote:
> Hi,
>
> The workaround for safari/keep-alive issue being introduced by 0.8.33
> seems to be way too aggressive. Since it's a POST issue, we should
> unwillingly disable keep-alive only when it's POST.
Please read this:
https://bugs.webkit.org/show_bug.cgi?id=5760
The problem is that keepalive should be disable before Safari issues POST.
BTW, keepalive_disable directive has been introduced in 0.9.0.
It has "none", "msie6", "safari" options.
> -- @N
>
> $ diff -u src/http/ngx_http_core_module.c~ src/http/ngx_http_core_module.c
> --- src/http/ngx_http_core_module.c~ 2010-12-14 10:38:42.000000000 +0000
> +++ src/http/ngx_http_core_module.c 2011-02-11 02:55:05.000000000 +0000
> @@ -802,11 +802,13 @@
> }
>
> } else if (r->headers_in.safari) {
> - /*
> - * Safari may send a POST request to a closed keepalive
> - * connection and stalls for some time
> - */
> - r->keepalive = 0;
> + if (r->method == NGX_HTTP_POST) {
> + /*
> + * Safari may send a POST request to a closed keepalive
> + * connection and stalls for some time
> + */
> + r->keepalive = 0;
> + }
> }
> }
--
Igor Sysoev
http://sysoev.ru/en/
More information about the nginx-devel
mailing list