mirror of
https://github.com/nginx/nginx.git
synced 2025-06-13 06:12:44 +08:00
disable keepalive for Safari:
https://bugs.webkit.org/show_bug.cgi?id=5760
This commit is contained in:
parent
4e20f24b5b
commit
8164f329fe
@ -783,14 +783,24 @@ ngx_http_handler(ngx_http_request_t *r)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r->keepalive && r->headers_in.msie && r->method == NGX_HTTP_POST) {
|
if (r->keepalive) {
|
||||||
|
|
||||||
/*
|
if (r->headers_in.msie) {
|
||||||
* MSIE may wait for some time if an response for
|
if (r->method == NGX_HTTP_POST) {
|
||||||
* a POST request was sent over a keepalive connection
|
/*
|
||||||
*/
|
* MSIE may wait for some time if an response for
|
||||||
|
* a POST request was sent over a keepalive connection
|
||||||
|
*/
|
||||||
|
r->keepalive = 0;
|
||||||
|
}
|
||||||
|
|
||||||
r->keepalive = 0;
|
} 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->headers_in.content_length_n > 0) {
|
if (r->headers_in.content_length_n > 0) {
|
||||||
|
@ -1450,6 +1450,9 @@ ngx_http_process_user_agent(ngx_http_request_t *r, ngx_table_elt_t *h,
|
|||||||
} else if (ngx_strstrn(user_agent, "Chrome/", 7 - 1)) {
|
} else if (ngx_strstrn(user_agent, "Chrome/", 7 - 1)) {
|
||||||
r->headers_in.chrome = 1;
|
r->headers_in.chrome = 1;
|
||||||
|
|
||||||
|
} else if (ngx_strstrn(user_agent, "Safari/", 7 - 1)) {
|
||||||
|
r->headers_in.safari = 1;
|
||||||
|
|
||||||
} else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) {
|
} else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) {
|
||||||
r->headers_in.konqueror = 1;
|
r->headers_in.konqueror = 1;
|
||||||
}
|
}
|
||||||
|
@ -220,6 +220,7 @@ typedef struct {
|
|||||||
unsigned opera:1;
|
unsigned opera:1;
|
||||||
unsigned gecko:1;
|
unsigned gecko:1;
|
||||||
unsigned chrome:1;
|
unsigned chrome:1;
|
||||||
|
unsigned safari:1;
|
||||||
unsigned konqueror:1;
|
unsigned konqueror:1;
|
||||||
} ngx_http_headers_in_t;
|
} ngx_http_headers_in_t;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user