Mailing List Archive

r145 - in cherokee: . cherokee
Author: alo
Date: 2006-01-16 12:24:49 +0100 (Mon, 16 Jan 2006)
New Revision: 145

Modified:
cherokee/ChangeLog
cherokee/cherokee/fcgi_manager.c
cherokee/cherokee/handler_fastcgi.c
Log:


Modified: cherokee/ChangeLog
===================================================================
--- cherokee/ChangeLog 2006-01-15 21:13:48 UTC (rev 144)
+++ cherokee/ChangeLog 2006-01-16 11:24:49 UTC (rev 145)
@@ -1,3 +1,12 @@
+2006-01-16 Alvaro Lopez Ortega <alvaro at alobbs.com>
+
+ * cherokee/fcgi_manager.c (connect_to_srv): Now the socket opened
+ to the FastCGI is set in non-blocking mode.
+
+ * cherokee/handler_fastcgi.c (cherokee_handler_fastcgi_step,
+ cherokee_handler_fastcgi_add_headers): Integrated with the
+ connection polling list.
+
2006-01-15 Alvaro Lopez Ortega <alvaro at alobbs.com>

* cherokee/handler_fastcgi.c (cherokee_handler_fastcgi_add_headers):

Modified: cherokee/cherokee/fcgi_manager.c
===================================================================
--- cherokee/cherokee/fcgi_manager.c 2006-01-15 21:13:48 UTC (rev 144)
+++ cherokee/cherokee/fcgi_manager.c 2006-01-16 11:24:49 UTC (rev 145)
@@ -173,9 +173,7 @@
ret = cherokee_socket_connect (fcgim->socket);
fcgim->connected = (ret == ret_ok);

-#if 0
cherokee_fd_set_nonblocking (fcgim->socket->socket);
-#endif
return ret;
}

@@ -187,7 +185,7 @@
int i;

for (i=0; i<fcgim->conn_poll_size; i++) {
- conn = fcgim->conn_poll [i];
+ conn = fcgim->conn_poll[i];
if (conn != NULL)
unregister_conn (fcgim, conn);
}

Modified: cherokee/cherokee/handler_fastcgi.c
===================================================================
--- cherokee/cherokee/handler_fastcgi.c 2006-01-15 21:13:48 UTC (rev 144)
+++ cherokee/cherokee/handler_fastcgi.c 2006-01-16 11:24:49 UTC (rev 145)
@@ -406,44 +406,6 @@
}


-/* static ret_t */
-/* manager_connect (cherokee_fcgi_manager_t *fcgim, cherokee_fcgi_server_t *conf) */
-/* { */
-/* ret_t ret; */
-
-/* ret = cherokee_fcgi_manager_connect_to_srv (fcgim); */
-/* if (unlikely (ret != ret_ok)) { */
-
-/* TRACE (ENTRIES, "Could not connect to \"%s\"\n", conf->host.buf); */
-
-/* if (cherokee_buffer_is_empty (&conf->interpreter)) */
-/* return ret_error; */
-
-/* /\* Maybe it is reusing a Fcgi manager object, clean it up */
-/* *\/ */
-/* ret = cherokee_fcgi_manager_clean (fcgim); */
-/* if (unlikely (ret != ret_ok)) return ret_error; */
-
-/* /\* Spawn a new FastCGI server */
-/* *\/ */
-/* ret = cherokee_fcgi_manager_spawn_srv (fcgim); */
-/* if (unlikely (ret != ret_ok)) return ret_error; */
-
-/* TRACE (ENTRIES, "Spawning \"%s\"\n", conf->interpreter.buf); */
-
-/* /\* Try to connect again */
-/* *\/ */
-/* ret = cherokee_fcgi_manager_connect_to_srv (fcgim); */
-/* if (unlikely (ret != ret_ok)) { */
-/* PRINT_ERROR ("Couldn't connect to FCGI server.\n"); */
-/* return ret_error; */
-/* } */
-/* } */
-
-/* return ret_ok; */
-/* } */
-
-
ret_t
cherokee_handler_fastcgi_init (cherokee_handler_fastcgi_t *fcgi)
{
@@ -479,7 +441,6 @@

/* Launch and connect to the server
*/
-// ret = manager_connect (n, fcgi->configuration);
ret = cherokee_fcgi_manager_spawn_connect (n);
if (ret != ret_ok) return ret;
}
@@ -765,8 +726,12 @@
fcgi->phase = fcgi_phase_init;

return ret_eagain;
+
case ret_eagain:
- return ret;
+ cherokee_thread_deactive_to_polling (HANDLER_THREAD(fcgi), HANDLER_CONN(fcgi),
+ fcgi->manager_ref->socket->socket, 0);
+ return ret_eagain;
+
default:
RET_UNKNOWN(ret);
}
@@ -855,6 +820,8 @@

case ret_error:
case ret_eagain:
+ cherokee_thread_deactive_to_polling (HANDLER_THREAD(fcgi), HANDLER_CONN(fcgi),
+ fcgi->manager_ref->socket->socket, 0);
return ret;
default:
RET_UNKNOWN(ret);