Skip to content
Browse files

git-svn-id: svn://cherokee-project.com/cherokee/trunk@600 5dc97367-97…

…f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent 61fcba4 commit f11857fa8a0766f8775fcdf808748ee093d72e79 @alobbs alobbs committed Jan 11, 2007
Showing with 26 additions and 1 deletion.
  1. +4 −0 ChangeLog
  2. +22 −1 cherokee/handler_fcgi.c
View
4 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.
View
23 cherokee/handler_fcgi.c
@@ -572,6 +572,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)
{
ret_t ret;
@@ -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");
@@ -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;
}

0 comments on commit f11857f

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