Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-12-15 17:10:33 +0300
committerIgor Sysoev <igor@sysoev.ru>2010-12-15 17:10:33 +0300
commit87f744c24b61c3b25311f62885201541b9161ded (patch)
treef7bf8a744e32a913a4e6365a8872ed4ac17da8a1 /src
parentf00e81d75ac6701ffbc99d0d75755f303ff03231 (diff)
use boolean expression instead of "if"
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_core_module.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index f3fa765c1..ae0264d34 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -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 {