Skip to content

Commit

Permalink
git-svn-id: svn://cherokee-project.com/cherokee/trunk@600 5dc97367-97…
Browse files Browse the repository at this point in the history
…f1-0310-9951-d761b3857238
  • Loading branch information
alobbs committed Jan 11, 2007
1 parent 61fcba4 commit f11857f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,5 +1,9 @@
2007-01-11 Alvaro Lopez Ortega <alvaro@alobbs.com>

* cherokee/handler_fcgi.c (send_no_post,
cherokee_handler_fcgi_init): It wasn't sending the STDIN empty
package to notify it is closed. Reported by bil.

* qa/141-FastCGI-EmptyVars.py: Added new QA test to ensure that
PATH_INFO and QUERY_STRING are sent to the FastCGI servers even if
there are empty strings.
Expand Down
23 changes: 22 additions & 1 deletion cherokee/handler_fcgi.c
Expand Up @@ -571,6 +571,24 @@ do_send (cherokee_handler_fcgi_t *hdl, cherokee_buffer_t *buffer)
}


static ret_t
send_no_post (cherokee_handler_fcgi_t *hdl, cherokee_buffer_t *buf)
{
switch (hdl->post_phase) {
case fcgi_post_init:
add_empty_packet (hdl, FCGI_STDIN);
hdl->post_phase = fcgi_post_write;

case fcgi_post_write:
return do_send (hdl, buf);

default:
SHOULDNT_HAPPEN;
}
return ret_error;
}


static ret_t
send_post (cherokee_handler_fcgi_t *hdl, cherokee_buffer_t *buf)
{
Expand Down Expand Up @@ -685,7 +703,7 @@ cherokee_handler_fcgi_init (cherokee_handler_fcgi_t *hdl)
{
ret_t ret;
cherokee_connection_t *conn = HANDLER_CONN(hdl);

switch (HDL_CGI_BASE(hdl)->init_phase) {
case hcgi_phase_build_headers:
TRACE (ENTRIES, "Init %s\n", "begins");
Expand Down Expand Up @@ -732,6 +750,9 @@ cherokee_handler_fcgi_init (cherokee_handler_fcgi_t *hdl)
*/
if (hdl->post_len > 0) {
return send_post (hdl, &hdl->write_buffer);
} else {
ret = send_no_post (hdl, &hdl->write_buffer);
if (ret != ret_ok) return ret;
}
break;
}
Expand Down

0 comments on commit f11857f

Please sign in to comment.