use boolean expression instead of "if"

This commit is contained in:
Igor Sysoev 2010-12-15 14:10:33 +00:00
parent f00e81d75a
commit 87f744c24b

View File

@ -789,11 +789,7 @@ ngx_http_handler(ngx_http_request_t *r)
if (!r->internal) { if (!r->internal) {
switch (r->headers_in.connection_type) { switch (r->headers_in.connection_type) {
case 0: case 0:
if (r->http_version > NGX_HTTP_VERSION_10) { r->keepalive = (r->http_version > NGX_HTTP_VERSION_10);
r->keepalive = 1;
} else {
r->keepalive = 0;
}
break; break;
case NGX_HTTP_CONNECTION_CLOSE: case NGX_HTTP_CONNECTION_CLOSE:
@ -805,13 +801,7 @@ ngx_http_handler(ngx_http_request_t *r)
break; break;
} }
if (r->headers_in.content_length_n > 0) { r->lingering_close = (r->headers_in.content_length_n > 0);
r->lingering_close = 1;
} else {
r->lingering_close = 0;
}
r->phase_handler = 0; r->phase_handler = 0;
} else { } else {