You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2009/07/24 22:54:46 UTC

svn commit: r797647 - /httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c

Author: wrowe
Date: Fri Jul 24 20:54:46 2009
New Revision: 797647

URL: http://svn.apache.org/viewvc?rev=797647&view=rev
Log:
use our apr specific methods of merging this server config table and array

Modified:
    httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c

Modified: httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c?rev=797647&r1=797646&r2=797647&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c (original)
+++ httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c Fri Jul 24 20:54:46 2009
@@ -15,12 +15,13 @@
  * limitations under the License.
  */
 
-#include "ap_config.h"
-#include "ap_mmn.h"
+#define CORE_PRIVATE
+
 #include "httpd.h"
-#include "http_core.h"
+#include "http_config.h"
 #include "http_request.h"
 #include "http_protocol.h"
+#include "ap_mmn.h"
 #include "apr_buckets.h"
 #include "apr_thread_proc.h"
 #include "mod_cgi.h"
@@ -99,6 +100,71 @@
     return APR_SUCCESS;
 }
 
+
+/* This should be proposed as a stand-alone improvement to the httpd module,
+ * either in the arch/ platform-specific modules or util_script.c from whence
+ * it came.
+ */
+static void default_proc_env(apr_table_t *e)
+{
+    const char *env_temp;
+
+    if (!(env_temp = getenv("PATH"))) {
+        env_temp = DEFAULT_PATH;
+    }
+    apr_table_addn(e, "PATH", env_temp);
+
+#ifdef WIN32
+    if (env_temp = getenv("SYSTEMROOT")) {
+        apr_table_addn(e, "SYSTEMROOT", env_temp);
+    }
+    if (env_temp = getenv("COMSPEC")) {
+        apr_table_addn(e, "COMSPEC", env_temp);
+    }
+    if (env_temp = getenv("PATHEXT")) {
+        apr_table_addn(e, "PATHEXT", env_temp);
+    }
+    if (env_temp = getenv("WINDIR")) {
+        apr_table_addn(e, "WINDIR", env_temp);
+    }
+#elif defined(OS2)
+    if ((env_temp = getenv("COMSPEC")) != NULL) {
+        apr_table_addn(e, "COMSPEC", env_temp);
+    }
+    if ((env_temp = getenv("ETC")) != NULL) {
+        apr_table_addn(e, "ETC", env_temp);
+    }
+    if ((env_temp = getenv("DPATH")) != NULL) {
+        apr_table_addn(e, "DPATH", env_temp);
+    }
+    if ((env_temp = getenv("PERLLIB_PREFIX")) != NULL) {
+        apr_table_addn(e, "PERLLIB_PREFIX", env_temp);
+    }
+#elif defined(BEOS)
+    if ((env_temp = getenv("LIBRARY_PATH")) != NULL) {
+        apr_table_addn(e, "LIBRARY_PATH", env_temp);
+    }
+#elif defined (AIX)
+    if (env_temp = getenv("LIBPATH")) {
+        apr_table_addn(e, "LIBPATH", env_temp);
+    }
+#else
+/* DARWIN, HPUX vary depending on circumstance */
+#if defined (DARWIN)
+    if (env_temp = getenv("DYLD_LIBRARY_PATH")) {
+        apr_table_addn(e, "DYLD_LIBRARY_PATH", env_temp);
+    }
+#elif defined (HPUX11) || defined (HPUX10) || defined (HPUX)
+    if (env_temp = getenv("SHLIB_PATH")) {
+        apr_table_addn(e, "SHLIB_PATH", env_temp);
+    }
+#endif
+    if (env_temp = getenv("LD_LIBRARY_PATH")) {
+        apr_table_addn(e, "LD_LIBRARY_PATH", env_temp);
+    }
+#endif
+}
+
 /* End of stolen */
 
 static void fcgid_add_cgi_vars(request_rec * r)



Re: svn commit: r797647 - /httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Jeff Trawick wrote:
> 
> do you have any code yet to call this function?

Once again, compiler warnings are our friend.  Yes, this needs to be
invoked, but it's a NTP, and the code I tossed was a new direction
I wanted to go in, which would pick up all the PassEnv and other
overrides, and set these all aside in a way that it would reinvoke
the program again identically if a worker is lost.  I then looked
at the possibility of using httpd's API but that wasn't suitable either.

So... back to the drawing board to flesh out this table before we
go and invoke apr_proc_create.  Thanks for drawing it to my attention.





Re: svn commit: r797647 - /httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c

Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, Jul 24, 2009 at 4:54 PM, <wr...@apache.org> wrote:

> Author: wrowe
> Date: Fri Jul 24 20:54:46 2009
> New Revision: 797647
>
> URL: http://svn.apache.org/viewvc?rev=797647&view=rev
> Log:
> use our apr specific methods of merging this server config table and array
>
> Modified:
>    httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c
>
> Modified: httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c
> URL:
> http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c?rev=797647&r1=797646&r2=797647&view=diff
>
> ==============================================================================
> --- httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c (original)
> +++ httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c Fri Jul 24 20:54:46 2009
> @@ -99,6 +100,71 @@
>     return APR_SUCCESS;
>  }
>
> +
> +/* This should be proposed as a stand-alone improvement to the httpd
> module,
> + * either in the arch/ platform-specific modules or util_script.c from
> whence
> + * it came.
> + */
> +static void default_proc_env(apr_table_t *e)


do you have any code yet to call this function?