mirror of
https://github.com/nginx/nginx.git
synced 2025-01-24 07:06:35 -06:00
use boolean expression instead of "if"
This commit is contained in:
parent
f00e81d75a
commit
87f744c24b
@ -789,11 +789,7 @@ ngx_http_handler(ngx_http_request_t *r)
|
||||
if (!r->internal) {
|
||||
switch (r->headers_in.connection_type) {
|
||||
case 0:
|
||||
if (r->http_version > NGX_HTTP_VERSION_10) {
|
||||
r->keepalive = 1;
|
||||
} else {
|
||||
r->keepalive = 0;
|
||||
}
|
||||
r->keepalive = (r->http_version > NGX_HTTP_VERSION_10);
|
||||
break;
|
||||
|
||||
case NGX_HTTP_CONNECTION_CLOSE:
|
||||
@ -805,13 +801,7 @@ ngx_http_handler(ngx_http_request_t *r)
|
||||
break;
|
||||
}
|
||||
|
||||
if (r->headers_in.content_length_n > 0) {
|
||||
r->lingering_close = 1;
|
||||
|
||||
} else {
|
||||
r->lingering_close = 0;
|
||||
}
|
||||
|
||||
r->lingering_close = (r->headers_in.content_length_n > 0);
|
||||
r->phase_handler = 0;
|
||||
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user