httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1028901 - in /httpd/mod_fcgid/trunk/modules/fcgid: fcgid_bridge.c fcgid_pm.h fcgid_pm_main.c fcgid_pm_unix.c fcgid_pm_win.c
Date Fri, 29 Oct 2010 20:35:35 GMT
Author: trawick
Date: Fri Oct 29 20:35:35 2010
New Revision: 1028901

URL: http://svn.apache.org/viewvc?rev=1028901&view=rev
Log:
follow up r1028683 with another fix for mod_vhost_ldap

that creates per-request r->server->module_config, so
we can't send that ptr over to the daemon; instead,
copy out the one thing we need

Suggested by: Anders Kaseorg <andersk mit.edu>

Modified:
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm.h
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_unix.c
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_win.c

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c?rev=1028901&r1=1028900&r2=1028901&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c Fri Oct 29 20:35:35 2010
@@ -45,8 +45,6 @@ static fcgid_procnode *apply_free_procno
     uid_t uid = command->uid;
     gid_t gid = command->gid;
     const char *cmdline = command->cmdline;
-    fcgid_server_conf *sconf =
-        ap_get_module_config(command->module_config, &fcgid_module);
 
     proc_table = proctable_get_table_array();
     previous_node = proctable_get_idle_list();
@@ -60,7 +58,7 @@ static fcgid_procnode *apply_free_procno
         if (current_node->inode == inode
             && current_node->deviceid == deviceid
             && !strcmp(current_node->cmdline, cmdline)
-            && current_node->vhost_id == sconf->vhost_id
+            && current_node->vhost_id == command->vhost_id
             && current_node->uid == uid && current_node->gid == gid)
{
             /* Unlink from idle list */
             previous_node->next_index = current_node->next_index;
@@ -131,8 +129,6 @@ static int count_busy_processes(request_
     fcgid_procnode *previous_node, *current_node, *next_node;
     fcgid_procnode *proc_table = proctable_get_table_array();
     fcgid_procnode *busy_list_header = proctable_get_busy_list();
-    fcgid_server_conf *sconf =
-        ap_get_module_config(command->module_config, &fcgid_module);
 
     proctable_lock(r);
 
@@ -142,7 +138,7 @@ static int count_busy_processes(request_
         if (current_node->inode == command->inode
             && current_node->deviceid == command->deviceid
             && !strcmp(current_node->cmdline, command->cmdline)
-            && current_node->vhost_id == sconf->vhost_id
+            && current_node->vhost_id == command->vhost_id
             && current_node->uid == command->uid
             && current_node->gid == command->gid) {
             result++;

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm.h
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm.h?rev=1028901&r1=1028900&r2=1028901&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm.h (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm.h Fri Oct 29 20:35:35 2010
@@ -25,12 +25,10 @@ typedef struct {
     char cmdline[FCGID_CMDLINE_MAX];
     apr_ino_t inode;
     dev_t deviceid;
-    /* module_config and server_hostname are copied from the
-     * server_rec of the vhost that started the process, in
-     * support of mass vhost modules that create server_rec
-     * during the request phase
+    /* can't reference these via server_rec because some mass vhost
+     * module may have copied it for per-request customization
      */
-    struct ap_conf_vector_t *module_config;
+    int vhost_id;
     char server_hostname[32];   /* for logging only; ok to truncate */
     uid_t uid;                  /* For suEXEC */
     gid_t gid;                  /* For suEXEC */

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c?rev=1028901&r1=1028900&r2=1028901&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c Fri Oct 29 20:35:35 2010
@@ -537,8 +537,6 @@ fastcgi_spawn(fcgid_command * command, s
     fcgid_proc_info procinfo;
     apr_status_t rv;
     int i;
-    fcgid_server_conf *sconf =
-        ap_get_module_config(command->module_config, &fcgid_module);
 
     free_list_header = proctable_get_free_list();
     idle_list_header = proctable_get_idle_list();
@@ -565,7 +563,7 @@ fastcgi_spawn(fcgid_command * command, s
     AP_DEBUG_ASSERT(sizeof procnode->cmdline > strlen(command->cmdline));
     apr_cpystrn(procnode->cmdline, command->cmdline, sizeof procnode->cmdline);
 
-    procnode->vhost_id = sconf->vhost_id;
+    procnode->vhost_id = command->vhost_id;
     procnode->uid = command->uid;
     procnode->gid = command->gid;
     procnode->start_time = procnode->last_active_time = apr_time_now();

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_unix.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_unix.c?rev=1028901&r1=1028900&r2=1028901&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_unix.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_unix.c Fri Oct 29 20:35:35 2010
@@ -421,6 +421,8 @@ void procmgr_init_spawn_cmd(fcgid_comman
                             fcgid_cmd_conf *cmd_conf)
 {
     ap_unix_identity_t *ugid;
+    fcgid_server_conf *sconf =
+        ap_get_module_config(r->server->module_config, &fcgid_module);
 
     memset(command, 0, sizeof(*command));
 
@@ -443,7 +445,7 @@ void procmgr_init_spawn_cmd(fcgid_comman
 
     command->deviceid = cmd_conf->deviceid;
     command->inode = cmd_conf->inode;
-    command->module_config = r->server->module_config;
+    command->vhost_id = sconf->vhost_id;
     if (r->server->server_hostname) {
         apr_cpystrn(command->server_hostname, r->server->server_hostname,
                     sizeof command->server_hostname);

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_win.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_win.c?rev=1028901&r1=1028900&r2=1028901&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_win.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_win.c Fri Oct 29 20:35:35 2010
@@ -130,6 +130,9 @@ procmgr_post_config(server_rec * main_se
 void procmgr_init_spawn_cmd(fcgid_command * command, request_rec * r,
                             fcgid_cmd_conf *cmd_conf)
 {
+    fcgid_server_conf *sconf =
+        ap_get_module_config(r->server->module_config, &fcgid_module);
+
     memset(command, 0, sizeof(*command));
 
     /* no truncation should ever occur */
@@ -141,7 +144,7 @@ void procmgr_init_spawn_cmd(fcgid_comman
     command->uid = (uid_t) - 1;
     command->gid = (gid_t) - 1;
     command->userdir = 0;
-    command->module_config = r->server->module_config;
+    command->vhost_id = sconf->vhost_id;
     if (r->server->server_hostname) {
         apr_cpystrn(command->server_hostname, r->server->server_hostname,
                     sizeof command->server_hostname);



Mime
View raw message