httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1028683 - 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 10:57:52 GMT
Author: trawick
Date: Fri Oct 29 10:57:52 2010
New Revision: 1028683

URL: http://svn.apache.org/viewvc?rev=1028683&view=rev
Log:
follow up r1028551 with an additional fix in support
of modules which create server_rec dynamically

in this case, server_rec was used in the fcgid daemon
to obtain the vhost config for a process being started
and for logging the ServerName setting for a process

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=1028683&r1=1028682&r2=1028683&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c Fri Oct 29 10:57:52 2010
@@ -46,7 +46,7 @@ static fcgid_procnode *apply_free_procno
     gid_t gid = command->gid;
     const char *cmdline = command->cmdline;
     fcgid_server_conf *sconf =
-        ap_get_module_config(command->server->module_config, &fcgid_module);
+        ap_get_module_config(command->module_config, &fcgid_module);
 
     proc_table = proctable_get_table_array();
     previous_node = proctable_get_idle_list();
@@ -132,7 +132,7 @@ static int count_busy_processes(request_
     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->server->module_config, &fcgid_module);
+        ap_get_module_config(command->module_config, &fcgid_module);
 
     proctable_lock(r);
 

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=1028683&r1=1028682&r2=1028683&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm.h (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm.h Fri Oct 29 10:57:52 2010
@@ -25,7 +25,13 @@ typedef struct {
     char cmdline[FCGID_CMDLINE_MAX];
     apr_ino_t inode;
     dev_t deviceid;
-    const server_rec *server;   /* Virtualhost granularity */
+    /* 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
+     */
+    struct ap_conf_vector_t *module_config;
+    char server_hostname[32];   /* for logging only; ok to truncate */
     uid_t uid;                  /* For suEXEC */
     gid_t gid;                  /* For suEXEC */
     int userdir;                /* 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=1028683&r1=1028682&r2=1028683&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 10:57:52 2010
@@ -481,7 +481,7 @@ fastcgi_spawn(fcgid_command * command, s
     apr_status_t rv;
     int i;
     fcgid_server_conf *sconf =
-        ap_get_module_config(command->server->module_config, &fcgid_module);
+        ap_get_module_config(command->module_config, &fcgid_module);
 
     free_list_header = proctable_get_free_list();
     idle_list_header = proctable_get_idle_list();
@@ -568,8 +568,8 @@ fastcgi_spawn(fcgid_command * command, s
                           procnode, proctable_array);
         ap_log_error(APLOG_MARK, APLOG_INFO, 0, main_server,
                      "mod_fcgid: server %s:%s(%" APR_PID_T_FMT ") started",
-                     command->server->server_hostname ?
-                         command->server->server_hostname : "(unknown)",
+                     command->server_hostname[0] ?
+                         command->server_hostname : "(unknown)",
                      command->cgipath,
                      procnode->proc_id.pid);
         register_spawn(main_server, procnode);

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=1028683&r1=1028682&r2=1028683&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 10:57:52 2010
@@ -443,7 +443,11 @@ void procmgr_init_spawn_cmd(fcgid_comman
 
     command->deviceid = cmd_conf->deviceid;
     command->inode = cmd_conf->inode;
-    command->server = r->server;
+    command->module_config = r->server->module_config;
+    if (r->server->server_hostname) {
+        apr_cpystrn(command->server_hostname, r->server->server_hostname,
+                    sizeof command->server_hostname);
+    }
 
     get_cmd_options(r, command->cgipath, &command->cmdopts, &command->cmdenv);
 }

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=1028683&r1=1028682&r2=1028683&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 10:57:52 2010
@@ -141,7 +141,11 @@ void procmgr_init_spawn_cmd(fcgid_comman
     command->uid = (uid_t) - 1;
     command->gid = (gid_t) - 1;
     command->userdir = 0;
-    command->server = r->server;
+    command->module_config = r->server->module_config;
+    if (r->server->server_hostname) {
+        apr_cpystrn(command->server_hostname, r->server->server_hostname,
+                    sizeof command->server_hostname);
+    }
 
     get_cmd_options(r, command->cgipath, &command->cmdopts, &command->cmdenv);
 }



Mime
View raw message