Changeset 1788
- Timestamp:
- 08/12/08 23:14:34 (3 months ago)
- Files:
-
- cherokee/trunk/ChangeLog (modified) (1 diff)
- cherokee/trunk/cherokee/connection-protected.h (modified) (1 diff)
- cherokee/trunk/cherokee/connection.c (modified) (1 diff)
- cherokee/trunk/cherokee/thread.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/ChangeLog
r1786 r1788 1 2008-08-12 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 3 * cherokee/connection.c (cherokee_connection_clean_error_headers), 4 cherokee/thread.c (process_active_connections): It had to remove 5 the Content-Length header if the handler is not reporting error 6 messages because it has to add its own. Fixes a bug with previous 7 versions (cgi, fcgi and scgi). 8 1 9 2008-08-12 Taher Shihadeh <taher@unixwars.com> 2 10 * doc/cookbook_ror.txt, doc/cookbook_php.txt, cherokee/trunk/cherokee/connection-protected.h
r1747 r1788 239 239 ret_t cherokee_connection_build_local_directory (cherokee_connection_t *conn, cherokee_virtual_server_t *vsrv, cherokee_config_entry_t *entry); 240 240 ret_t cherokee_connection_build_local_directory_userdir (cherokee_connection_t *conn, cherokee_virtual_server_t *vsrv, cherokee_config_entry_t *entry); 241 ret_t cherokee_connection_clean_error_headers (cherokee_connection_t *conn); 241 242 242 243 ret_t cherokee_connection_clean_for_respin (cherokee_connection_t *conn); cherokee/trunk/cherokee/connection.c
r1785 r1788 1906 1906 1907 1907 1908 ret_t 1909 cherokee_connection_clean_error_headers (cherokee_connection_t *conn) 1910 { 1911 char *begin; 1912 char *end; 1913 1914 if (cherokee_buffer_is_empty (&conn->header_buffer)) 1915 return ret_ok; 1916 1917 begin = strcasestr (conn->header_buffer.buf, "Content-Length: "); 1918 if (begin != NULL) { 1919 end = strchr (begin+16, CHR_CR); 1920 if (end == NULL) 1921 return ret_error; 1922 1923 if (end[1] == CHR_LF) 1924 end++; 1925 1926 cherokee_buffer_remove_chunk (&conn->header_buffer, 1927 begin - conn->header_buffer.buf, 1928 (end-begin)+1); 1929 } 1930 1931 return ret_ok; 1932 } 1933 1934 1908 1935 int 1909 1936 cherokee_connection_use_webdir (cherokee_connection_t *conn) cherokee/trunk/cherokee/thread.c
r1759 r1788 983 983 984 984 /* If it is an error, and the connection has not a handler to manage 985 * this error, the handler has to be changed 986 */ 987 if ((http_type_300(conn->error_code) || 988 http_type_400(conn->error_code) || 989 http_type_500(conn->error_code)) && 990 conn->handler && (!HANDLER_SUPPORTS (conn->handler, hsupport_error))) 985 * this error, the handler has to be changed by an error_handler. 986 */ 987 if (conn->handler == NULL) { 988 conns_freed++; 989 purge_closed_connection (thd, conn); 990 continue; 991 } 992 993 if (http_type_300(conn->error_code) || 994 http_type_400(conn->error_code) || 995 http_type_500(conn->error_code)) 991 996 { 992 /* Try to setup an error handler 993 */ 994 ret = cherokee_connection_setup_error_handler (conn); 995 if (ret != ret_ok) { 997 if (HANDLER_SUPPORTS (conn->handler, hsupport_error)) { 998 ret = cherokee_connection_clean_error_headers (conn); 999 if (unlikely (ret != ret_ok)) { 1000 conns_freed++; 1001 purge_closed_connection (thd, conn); 1002 continue; 1003 } 1004 } else { 1005 /* Try to setup an error handler 1006 */ 1007 ret = cherokee_connection_setup_error_handler (conn); 1008 if (ret != ret_ok) { 996 1009 997 /* It could not change the handler to an error 998 * managing handler, so it is a critical error. 999 */ 1000 conns_freed++; 1001 purge_closed_connection (thd, conn); 1002 continue; 1010 /* It could not change the handler to an error 1011 * managing handler, so it is a critical error. 1012 */ 1013 conns_freed++; 1014 purge_closed_connection (thd, conn); 1015 continue; 1016 } 1017 1018 /* At this point, two different things might happen: 1019 * - It has got a common handler like handler_redir 1020 * - It has got an error handler like handler_error 1021 */ 1022 conn->phase = phase_init; 1023 break; 1003 1024 } 1004 1005 /* At this point, two different things might happen:1006 * - It has got a common handler like handler_redir1007 * - It has got an error handler like handler_error1008 */1009 conn->phase = phase_init;1010 break;1011 1025 } 1012 1026