summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-apache/mod_fcgid/files/mod_fcgid-2.2-vhost-granularity.patch')
-rw-r--r--www-apache/mod_fcgid/files/mod_fcgid-2.2-vhost-granularity.patch178
1 files changed, 178 insertions, 0 deletions
diff --git a/www-apache/mod_fcgid/files/mod_fcgid-2.2-vhost-granularity.patch b/www-apache/mod_fcgid/files/mod_fcgid-2.2-vhost-granularity.patch
new file mode 100644
index 000000000000..3eaa63465bf2
--- /dev/null
+++ b/www-apache/mod_fcgid/files/mod_fcgid-2.2-vhost-granularity.patch
@@ -0,0 +1,178 @@
+diff --git a/arch/unix/fcgid_pm_unix.c b/arch/unix/fcgid_pm_unix.c
+index 01932aa..2c0c4c4 100644
+--- a/arch/unix/fcgid_pm_unix.c
++++ b/arch/unix/fcgid_pm_unix.c
+@@ -386,6 +386,7 @@ void procmgr_init_spawn_cmd(fcgid_command * command, request_rec * r,
+ command->deviceid = deviceid;
+ command->inode = inode;
+ command->share_grp_id = share_grp_id;
++ command->virtualhost = r->server->server_hostname;
+
+ /* Update fcgid_command with wrapper info */
+ command->wrapperpath[0] = '\0';
+diff --git a/arch/unix/fcgid_proctbl_unix.c b/arch/unix/fcgid_proctbl_unix.c
+index bb8a46b..852c0c4 100644
+--- a/arch/unix/fcgid_proctbl_unix.c
++++ b/arch/unix/fcgid_proctbl_unix.c
+@@ -279,7 +279,7 @@ void proctable_print_debug_info(server_rec * main_server)
+ current_node != g_proc_array;
+ current_node = &g_proc_array[current_node->next_index]) {
+ ap_log_error(APLOG_MARK, APLOG_WARNING, 0, main_server,
+- "mod_fcgid: idle node index: %td",
++ "mod_fcgid: idle node index: %d",
+ current_node - g_proc_array);
+ }
+
+@@ -287,7 +287,7 @@ void proctable_print_debug_info(server_rec * main_server)
+ current_node != g_proc_array;
+ current_node = &g_proc_array[current_node->next_index]) {
+ ap_log_error(APLOG_MARK, APLOG_WARNING, 0, main_server,
+- "mod_fcgid: busy node index: %td",
++ "mod_fcgid: busy node index: %d",
+ current_node - g_proc_array);
+ }
+
+@@ -295,7 +295,7 @@ void proctable_print_debug_info(server_rec * main_server)
+ current_node != g_proc_array;
+ current_node = &g_proc_array[current_node->next_index]) {
+ ap_log_error(APLOG_MARK, APLOG_WARNING, 0, main_server,
+- "mod_fcgid: error node index: %td",
++ "mod_fcgid: error node index: %d",
+ current_node - g_proc_array);
+ }
+ }
+diff --git a/fcgid_bridge.c b/fcgid_bridge.c
+index e4fc184..5a960ff 100644
+--- a/fcgid_bridge.c
++++ b/fcgid_bridge.c
+@@ -34,6 +34,7 @@ static fcgid_procnode *apply_free_procnode(server_rec * main_server,
+ uid_t uid = command->uid;
+ gid_t gid = command->gid;
+ apr_size_t share_grp_id = command->share_grp_id;
++ char *virtualhost = command->virtualhost;
+
+ proc_table = proctable_get_table_array();
+ previous_node = proctable_get_idle_list();
+@@ -47,6 +48,7 @@ static fcgid_procnode *apply_free_procnode(server_rec * main_server,
+ if (current_node->inode == inode
+ && current_node->deviceid == deviceid
+ && current_node->share_grp_id == share_grp_id
++ && current_node->virtualhost == virtualhost
+ && current_node->uid == uid && current_node->gid == gid) {
+ /* Unlink from idle list */
+ previous_node->next_index = current_node->next_index;
+@@ -124,6 +126,7 @@ count_busy_processes(server_rec * main_server, fcgid_command * command)
+ if (current_node->inode == command->inode
+ && current_node->deviceid == command->deviceid
+ && current_node->share_grp_id == command->share_grp_id
++ && current_node->virtualhost == command->virtualhost
+ && current_node->uid == command->uid
+ && current_node->gid == command->gid) {
+ result++;
+diff --git a/fcgid_pm.h b/fcgid_pm.h
+index a157156..0c34f78 100644
+--- a/fcgid_pm.h
++++ b/fcgid_pm.h
+@@ -11,6 +11,7 @@ typedef struct {
+ apr_ino_t inode;
+ dev_t deviceid;
+ apr_size_t share_grp_id;
++ char *virtualhost; /* Virtualhost granularity */
+ uid_t uid; /* For suEXEC */
+ gid_t gid; /* For suEXEC */
+ int userdir; /* For suEXEC */
+diff --git a/fcgid_pm_main.c b/fcgid_pm_main.c
+index 9618aec..fddab47 100644
+--- a/fcgid_pm_main.c
++++ b/fcgid_pm_main.c
+@@ -386,7 +386,7 @@ fastcgi_spawn(fcgid_command * command, server_rec * main_server,
+ if (free_list_header->next_index == 0) {
+ safe_unlock(main_server);
+ ap_log_error(APLOG_MARK, APLOG_WARNING, 0, main_server,
+- "mod_fcgid: too much proecess, please increase FCGID_MAX_APPLICATION");
++ "mod_fcgid: too much processes, please increase FCGID_MAX_APPLICATION");
+ return;
+ }
+ procnode = &proctable_array[free_list_header->next_index];
+@@ -398,12 +398,14 @@ fastcgi_spawn(fcgid_command * command, server_rec * main_server,
+ procnode->deviceid = command->deviceid;
+ procnode->inode = command->inode;
+ procnode->share_grp_id = command->share_grp_id;
++ procnode->virtualhost = command->virtualhost;
+ procnode->uid = command->uid;
+ procnode->gid = command->gid;
+ procnode->start_time = procnode->last_active_time = apr_time_now();
+ procnode->requests_handled = 0;
+ procnode->diewhy = FCGID_DIE_KILLSELF;
+ procnode->proc_pool = NULL;
++
+ procinfo.cgipath = command->cgipath;
+ procinfo.configpool = configpool;
+ procinfo.main_server = main_server;
+@@ -447,8 +449,8 @@ fastcgi_spawn(fcgid_command * command, server_rec * main_server,
+ link_node_to_list(main_server, idle_list_header,
+ procnode, proctable_array);
+ ap_log_error(APLOG_MARK, APLOG_INFO, 0, main_server,
+- "mod_fcgid: server %s(%" APR_PID_T_FMT ") started",
+- command->cgipath, procnode->proc_id->pid);
++ "mod_fcgid: server %s:%s(%" APR_PID_T_FMT ") started",
++ command->virtualhost, command->cgipath, procnode->proc_id->pid);
+ register_spawn(main_server, procnode);
+ }
+ }
+diff --git a/fcgid_proctbl.h b/fcgid_proctbl.h
+index 04d954b..f1807ba 100644
+--- a/fcgid_proctbl.h
++++ b/fcgid_proctbl.h
+@@ -28,6 +28,7 @@ typedef struct {
+ gid_t gid; /* for suEXEC */
+ uid_t uid; /* for suEXEC */
+ apr_size_t share_grp_id; /* cgi wrapper share group id */
++ char *virtualhost; /* the virtualhost this process belongs to */
+ apr_time_t start_time; /* the time of this process create */
+ apr_time_t last_active_time; /* the time this process last active */
+ int requests_handled; /* number of requests process has handled */
+diff --git a/fcgid_spawn_ctl.c b/fcgid_spawn_ctl.c
+index 17039eb..d21c7d0 100644
+--- a/fcgid_spawn_ctl.c
++++ b/fcgid_spawn_ctl.c
+@@ -9,6 +9,7 @@ struct fcgid_stat_node {
+ uid_t uid;
+ gid_t gid;
+ apr_size_t share_grp_id;
++ char *virtualhost;
+ int score;
+ int process_counter;
+ apr_time_t last_stat_time;
+@@ -42,6 +43,7 @@ register_life_death(server_rec * main_server,
+ if (current_node->inode == procnode->inode
+ && current_node->deviceid == procnode->deviceid
+ && current_node->share_grp_id == procnode->share_grp_id
++ && current_node->virtualhost == procnode->virtualhost
+ && current_node->uid == procnode->uid
+ && current_node->gid == procnode->gid)
+ break;
+@@ -81,6 +83,7 @@ register_life_death(server_rec * main_server,
+ current_node->deviceid = procnode->deviceid;
+ current_node->inode = procnode->inode;
+ current_node->share_grp_id = procnode->share_grp_id;
++ current_node->virtualhost = procnode->virtualhost;
+ current_node->uid = procnode->uid;
+ current_node->gid = procnode->gid;
+ current_node->last_stat_time = apr_time_now();
+@@ -152,6 +155,7 @@ int is_spawn_allowed(server_rec * main_server, fcgid_command * command)
+ if (current_node->inode == command->inode
+ && current_node->deviceid == command->deviceid
+ && current_node->share_grp_id == command->share_grp_id
++ && current_node->virtualhost == command->virtualhost
+ && current_node->uid == command->uid
+ && current_node->gid == command->gid)
+ break;
+@@ -218,6 +222,7 @@ int is_kill_allowed(fcgid_procnode * procnode)
+ if (current_node->inode == procnode->inode
+ && current_node->deviceid == procnode->deviceid
+ && current_node->share_grp_id == procnode->share_grp_id
++ && current_node->virtualhost == procnode->virtualhost
+ && current_node->uid == procnode->uid
+ && current_node->gid == procnode->gid)
+ break;