]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Change the storage allocation mechanism for ap_proc_t structures
authorJeff Trawick <trawick@apache.org>
Sat, 29 Jul 2000 03:08:13 +0000 (03:08 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 29 Jul 2000 03:08:13 +0000 (03:08 +0000)
passed to ap_note_subprocess() by mod_rewrite and mod_include.  The
storage needs to last as long as the pool passed to
ap_note_subprocess(), so autodata won't work.

The mod_rewrite change wasn't tested.  A normal build with mod_rewrite
on Linux currently results in the link failing due to unresolved
references to dbm_*.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85928 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_include.c
modules/mappers/mod_rewrite.c

index 7de805551616f8c1dde0735098486772de463908..1482f1dff2a6d146450584ac6494df1065d795cf 100644 (file)
@@ -831,7 +831,7 @@ static int include_cmd(char *s, request_rec *r)
     include_cmd_arg arg;
     BUFF *script_in;
     ap_procattr_t *procattr;
-    ap_proc_t procnew;
+    ap_proc_t *procnew;
     ap_status_t rc;
     ap_table_t *env = r->subprocess_env;
     char **argv;
@@ -896,7 +896,8 @@ static int include_cmd(char *s, request_rec *r)
     else {
         build_argv_list(&argv, r, r->pool);
         argv[0] = ap_pstrdup(r->pool, s);
-        rc = ap_create_process(&procnew, s, argv, ap_create_environment(r->pool, env), procattr, r->pool);
+        procnew = ap_pcalloc(r->pool, sizeof(*procnew));
+        rc = ap_create_process(procnew, s, argv, ap_create_environment(r->pool, env), procattr, r->pool);
 
         if (rc != APR_SUCCESS) {
             /* Bad things happened. Everyone should have cleaned up. */
@@ -904,9 +905,9 @@ static int include_cmd(char *s, request_rec *r)
                         "couldn't create child process: %d: %s", rc, s);
         }
         else {
-            ap_note_subprocess(r->pool, &procnew, kill_after_timeout);
+            ap_note_subprocess(r->pool, procnew, kill_after_timeout);
             /* Fill in BUFF structure for parents pipe to child's stdout */
-            file = procnew.out;
+            file = procnew->out;
             iol = ap_create_file_iol(file);
             if (!iol)
                 return APR_EBADF;
index 88ae72d2dd27257c9f6e0a5599524738ef875cdd..e295df7aa288c22efd531a35aa5d2114ba0b23fd 100644 (file)
@@ -3421,7 +3421,7 @@ static int rewritemap_program_child(ap_pool_t *p, char *progname,
 {
     int rc = -1;
     ap_procattr_t *procattr;
-    ap_proc_t procnew;
+    ap_proc_t *procnew;
 
 #ifdef SIGHUP
     ap_signal(SIGHUP, SIG_IGN);
@@ -3439,21 +3439,22 @@ static int rewritemap_program_child(ap_pool_t *p, char *progname,
         rc = -1;
     }
     else {
-        rc = ap_create_process(&procnew, progname, NULL, NULL, procattr, p);
+        procnew = ap_pcalloc(p, sizeof(*procnew));
+        rc = ap_create_process(procnew, progname, NULL, NULL, procattr, p);
     
         if (rc == APR_SUCCESS) {
-            ap_note_subprocess(p, &procnew, kill_after_timeout);
+            ap_note_subprocess(p, procnew, kill_after_timeout);
 
             if (fpin) {
-                (*fpin) = procnew.in;
+                (*fpin) = procnew->in;
             }
 
             if (fpout) {
-                (*fpout) = procnew.out;
+                (*fpout) = procnew->out;
             }
 
             if (fperr) {
-                (*fperr) = procnew.err;
+                (*fperr) = procnew->err;
             }
         }
     }