Changeset 1924
- Timestamp:
- 08/17/2007 03:37:45 PM (14 months ago)
- Files:
-
- 1 modified
-
branches/lighttpd-1.4.x/src/connections.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/lighttpd-1.4.x/src/connections.c
r1904 r1924 535 535 } 536 536 } else { 537 /* disable keep-alive if size-info for the body is missing */ 538 if ((con->parsed_response & HTTP_CONTENT_LENGTH) && 537 /** 538 * the file isn't finished yet, but we have all headers 539 * 540 * to get keep-alive we either need: 541 * - Content-Length: ... (HTTP/1.0 and HTTP/1.0) or 542 * - Transfer-Encoding: chunked (HTTP/1.1) 543 */ 544 545 if (((con->parsed_response & HTTP_CONTENT_LENGTH) == 0) && 539 546 ((con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) == 0)) { 540 547 con->keep_alive = 0; 541 548 } 542 549 543 if (0 == (con->parsed_response & HTTP_CONNECTION)) { 544 /* (f)cgi did'nt send Connection: header 545 * 546 * shall we ? 547 */ 548 if (((con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) == 0) && 549 (con->parsed_response & HTTP_CONTENT_LENGTH) == 0) { 550 /* without content_length, no keep-alive */ 551 552 con->keep_alive = 0; 553 } 554 } else { 550 /** 551 * if the backend sent a Connection: close, follow the wish 552 * 553 * NOTE: if the backend sent Connection: Keep-Alive, but no Content-Length, we 554 * will close the connection. That's fine. We can always decide the close 555 * the connection 556 * 557 * FIXME: to be nice we should remove the Connection: ... 558 */ 559 if (con->parsed_response & HTTP_CONNECTION) { 555 560 /* a subrequest disable keep-alive although the client wanted it */ 556 561 if (con->keep_alive && !con->response.keep_alive) { 557 562 con->keep_alive = 0; 558 559 /* FIXME: we have to drop the Connection: Header from the subrequest */560 563 } 561 564 }

