Changeset 1806
- Timestamp:
- 08/14/08 11:09:01 (3 months ago)
- Files:
-
- cherokee/trunk/ChangeLog (modified) (1 diff)
- cherokee/trunk/cherokee/connection.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/ChangeLog
r1801 r1806 1 2008-08-14 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 3 * cherokee/connection.c: Allows 3xx replies to keep the connection 4 alive. 5 1 6 2008-08-13 Taher Shihadeh <taher@unixwars.com> 2 7 cherokee/trunk/cherokee/connection.c
r1788 r1806 357 357 entry = vsrv->error_handler; 358 358 359 /* On error, it will close the socket360 */361 conn->keepalive = 0;362 363 359 /* It has a common handler. It has to be freed. 364 360 */ … … 389 385 } 390 386 #endif 387 388 /* Only 3xx errors can keep the connection alive 389 */ 390 if ((! (http_type_300 (conn->error_code))) || 391 (! (conn->handler->support & hsupport_length))) 392 { 393 conn->keepalive = 0; 394 } 391 395 392 396 /* Nothing should be mmaped any longer … … 559 563 } 560 564 565 /* It might need to deactive Keep-Alive 566 */ 561 567 if ((conn->keepalive != 0) && 562 HANDLER_SUPPORTS(conn->handler, hsupport_maybe_length)) { 563 if (strcasestr (conn->header_buffer.buf, "Content-Length: ") == NULL) { 568 (http_method_with_body (conn->error_code))) 569 { 570 if (HANDLER_SUPPORTS (conn->handler, hsupport_maybe_length)) { 571 if (strcasestr (conn->header_buffer.buf, "Content-Length: ") == NULL) 572 conn->keepalive = 0; 573 } 574 575 if (HANDLER_SUPPORTS (conn->handler, hsupport_length) == 0) 564 576 conn->keepalive = 0; 565 }566 577 } 567 578 … … 1711 1722 conn->keepalive = 0; 1712 1723 } 1713 1714 1724 } else { 1715 1725 conn->keepalive = 0; … … 1784 1794 conn->local_directory.buf); 1785 1795 1786 /* If the connection is keep-alive1787 * then verify whether the handler supports it.1788 */1789 if ((conn->keepalive != 0) &&1790 (HANDLER_SUPPORTS (conn->handler, hsupport_length) == 0) &&1791 (HANDLER_SUPPORTS (conn->handler, hsupport_maybe_length) == 0))1792 {1793 conn->keepalive = 0;1794 }1795 1796 1796 /* Ensure the space for headers and I/O buffer 1797 1797 */ … … 1799 1799 cherokee_buffer_ensure_size (&conn->buffer, DEFAULT_READ_SIZE+1); 1800 1800 1801 /* Init the connection handler object 1802 */ 1801 1803 return cherokee_handler_init (conn->handler); 1802 1804 }