Klaus Demo nginx / 87f744c
use boolean expression instead of "if" Igor Sysoev 11 years ago
1 changed file(s) with 2 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
788788 if (!r->internal) {
789789 switch (r->headers_in.connection_type) {
790790 case 0:
791 if (r->http_version > NGX_HTTP_VERSION_10) {
792 r->keepalive = 1;
793 } else {
794 r->keepalive = 0;
795 }
791 r->keepalive = (r->http_version > NGX_HTTP_VERSION_10);
796792 break;
797793
798794 case NGX_HTTP_CONNECTION_CLOSE:
804800 break;
805801 }
806802
807 if (r->headers_in.content_length_n > 0) {
808 r->lingering_close = 1;
809
810 } else {
811 r->lingering_close = 0;
812 }
813
803 r->lingering_close = (r->headers_in.content_length_n > 0);
814804 r->phase_handler = 0;
815805
816806 } else {