Skip to content

Commit

Permalink
git-svn-id: svn://cherokee-project.com/cherokee/trunk@3264 5dc97367-9…
Browse files Browse the repository at this point in the history
…7f1-0310-9951-d761b3857238
  • Loading branch information
alobbs committed May 26, 2009
1 parent 642b128 commit b830ce0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -1,5 +1,8 @@
2009-05-26 Alvaro Lopez Ortega <alvaro@octality.com> 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.h (cherokee_buffer_encode_sha1_digest),
cherokee/buffer.c: Adds new method. cherokee/buffer.c: Adds new method.


Expand Down
19 changes: 11 additions & 8 deletions cherokee/handler_cgi_base.c
Expand Up @@ -74,12 +74,7 @@ cherokee_handler_cgi_base_init (cherokee_handler_cgi_base_t *cgi,


/* Read the properties /* Read the properties
*/ */
HANDLER(cgi)->support = hsupport_nothing; HANDLER(cgi)->support = hsupport_nothing;

if (HANDLER_CGI_BASE_PROPS(cgi)->is_error_handler) {
HANDLER(cgi)->support |= hsupport_error;
}

return ret_ok; return ret_ok;
} }


Expand Down Expand Up @@ -752,7 +747,8 @@ mix_headers (cherokee_buffer_t *target,




ret_t 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; ret_t ret;
cint_t req_len; cint_t req_len;
Expand Down Expand Up @@ -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); 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. /* Parse the header.. it is likely we will have something to do with it.
*/ */
ret = parse_header (cgi, outbuf); ret = parse_header (cgi, outbuf);
if (unlikely (ret != ret_ok)) if (unlikely (ret != ret_ok)) {
return ret; return ret;
}


/* Handle X-Sendfile /* Handle X-Sendfile
*/ */
Expand Down
7 changes: 4 additions & 3 deletions cherokee/handler_fcgi.c
Expand Up @@ -708,8 +708,9 @@ send_post (cherokee_handler_fcgi_t *hdl, cherokee_buffer_t *buf)
ret_t ret_t
cherokee_handler_fcgi_init (cherokee_handler_fcgi_t *hdl) cherokee_handler_fcgi_init (cherokee_handler_fcgi_t *hdl)
{ {
ret_t ret; ret_t ret;
cherokee_connection_t *conn = HANDLER_CONN(hdl); 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) { switch (HDL_CGI_BASE(hdl)->init_phase) {
case hcgi_phase_build_headers: case hcgi_phase_build_headers:
Expand All @@ -724,7 +725,7 @@ cherokee_handler_fcgi_init (cherokee_handler_fcgi_t *hdl)


/* Extracts PATH_INFO and filename from request uri /* 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; if (unlikely (ret < ret_ok)) return ret;


/* Build the headers /* Build the headers
Expand Down

0 comments on commit b830ce0

Please sign in to comment.