Mailing List Archive

r141 - in cherokee: . cherokee
Author: alo
Date: 2006-01-15 16:45:49 +0100 (Sun, 15 Jan 2006)
New Revision: 141

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


Modified: cherokee/ChangeLog
===================================================================
--- cherokee/ChangeLog 2006-01-15 12:26:19 UTC (rev 140)
+++ cherokee/ChangeLog 2006-01-15 15:45:49 UTC (rev 141)
@@ -3,6 +3,11 @@
* cherokee/handler_fastcgi.c, cherokee/fcgi_manager.c, ,
cherokee/fcgi_manager.h: Some FastCGI fixes by Mohammad DAMT.

+ * cherokee/handler_fastcgi.h,
+ cherokee/handler_fastcgi.c (add_more_env): Added "Env" support.
+ It allows to add custom environment variables just like the CGI
+ handler.
+
2006-01-13 Alvaro Lopez Ortega <alvaro at alobbs.com>

* cherokee/http.c (entry): There was a memory corruption problem

Modified: cherokee/cherokee/handler_fastcgi.c
===================================================================
--- cherokee/cherokee/handler_fastcgi.c 2006-01-15 12:26:19 UTC (rev 140)
+++ cherokee/cherokee/handler_fastcgi.c 2006-01-15 15:45:49 UTC (rev 141)
@@ -106,6 +106,7 @@
n->server_list = NULL;
n->configuration = NULL;
n->phase = fcgi_phase_init;
+ n->system_env = NULL;

n->post_sent = false;
n->post_phase = fcgi_post_init;
@@ -119,6 +120,7 @@
*/
if (properties != NULL) {
cherokee_typed_table_get_list (properties, "servers", &n->server_list);
+ cherokee_typed_table_get_list (properties, "env", &n->system_env);
}

if ((n->server_list == NULL) || (list_empty (n->server_list))) {
@@ -291,6 +293,24 @@
buffer.buf, buffer.len);


+ /* Add the custom define environment variables
+ */
+ if (fcgi->system_env != NULL) {
+ list_t *i;
+
+ list_for_each (i, fcgi->system_env) {
+ char *name;
+ cuint_t name_len;
+ char *value;
+
+ name = LIST_ITEM_INFO(i);
+ name_len = strlen(name);
+ value = name + name_len + 1;
+
+ add_env_pair_with_id (buf, fcgi->id, name, name_len, value, strlen(value));
+ }
+ }
+
/* The last package has a special treatment, we need
* to now where the header begins to set the right padding
*/

Modified: cherokee/cherokee/handler_fastcgi.h
===================================================================
--- cherokee/cherokee/handler_fastcgi.h 2006-01-15 12:26:19 UTC (rev 140)
+++ cherokee/cherokee/handler_fastcgi.h 2006-01-15 15:45:49 UTC (rev 141)
@@ -94,6 +94,8 @@
cherokee_fcgi_server_t *configuration;
list_t *server_list;
int max_manager;
+
+ list_t *system_env;
} cherokee_handler_fastcgi_t;