Skip to content
Browse files

git-svn-id: svn://cherokee-project.com/cherokee/trunk@3264 5dc97367-9…

…7f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent 642b128 commit b830ce055c268b9a12a15eb57dbb5399efc73923 @alobbs alobbs committed May 26, 2009
Showing with 18 additions and 11 deletions.
  1. +3 −0 ChangeLog
  2. +11 −8 cherokee/handler_cgi_base.c
  3. +4 −3 cherokee/handler_fcgi.c
View
3 ChangeLog
@@ -1,5 +1,8 @@
2009-05-26 Alvaro Lopez Ortega <alvaro@octality.com>
+ * cherokee/handler_cgi_base.c, cherokee/handler_fcgi.c: Better
+ error management. Fixes: http://bugs.cherokee-project.com/469
+
* cherokee/buffer.h (cherokee_buffer_encode_sha1_digest),
cherokee/buffer.c: Adds new method.
View
19 cherokee/handler_cgi_base.c
@@ -74,12 +74,7 @@ cherokee_handler_cgi_base_init (cherokee_handler_cgi_base_t *cgi,
/* Read the properties
*/
- HANDLER(cgi)->support = hsupport_nothing;
-
- if (HANDLER_CGI_BASE_PROPS(cgi)->is_error_handler) {
- HANDLER(cgi)->support |= hsupport_error;
- }
-
+ HANDLER(cgi)->support = hsupport_nothing;
return ret_ok;
}
@@ -752,7 +747,8 @@ mix_headers (cherokee_buffer_t *target,
ret_t
-cherokee_handler_cgi_base_extract_path (cherokee_handler_cgi_base_t *cgi, cherokee_boolean_t check_filename)
+cherokee_handler_cgi_base_extract_path (cherokee_handler_cgi_base_t *cgi,
+ cherokee_boolean_t check_filename)
{
ret_t ret;
cint_t req_len;
@@ -1071,11 +1067,18 @@ cherokee_handler_cgi_base_add_headers (cherokee_handler_cgi_base_t *cgi,
*/
cherokee_buffer_move_to_begin (inbuf, len + end_len);
+ /* From this moment, it can handle errors
+ */
+ if (HANDLER_CGI_BASE_PROPS(cgi)->is_error_handler) {
+ HANDLER(cgi)->support |= hsupport_error;
+ }
+
/* Parse the header.. it is likely we will have something to do with it.
*/
ret = parse_header (cgi, outbuf);
- if (unlikely (ret != ret_ok))
+ if (unlikely (ret != ret_ok)) {
return ret;
+ }
/* Handle X-Sendfile
*/
View
7 cherokee/handler_fcgi.c
@@ -708,8 +708,9 @@ send_post (cherokee_handler_fcgi_t *hdl, cherokee_buffer_t *buf)
ret_t
cherokee_handler_fcgi_init (cherokee_handler_fcgi_t *hdl)
{
- ret_t ret;
- cherokee_connection_t *conn = HANDLER_CONN(hdl);
+ ret_t ret;
+ cherokee_connection_t *conn = HANDLER_CONN(hdl);
+ cherokee_handler_cgi_base_props_t *props = HANDLER_CGI_BASE_PROPS(hdl);
switch (HDL_CGI_BASE(hdl)->init_phase) {
case hcgi_phase_build_headers:
@@ -724,7 +725,7 @@ cherokee_handler_fcgi_init (cherokee_handler_fcgi_t *hdl)
/* Extracts PATH_INFO and filename from request uri
*/
- ret = cherokee_handler_cgi_base_extract_path (HDL_CGI_BASE(hdl), false);
+ ret = cherokee_handler_cgi_base_extract_path (HDL_CGI_BASE(hdl), props->check_file);
if (unlikely (ret < ret_ok)) return ret;
/* Build the headers

0 comments on commit b830ce0

Please sign in to comment.
Something went wrong with that request. Please try again.