httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: mod_include broken?
Date Tue, 19 May 1998 20:37:50 GMT
Brian Behlendorf wrote:
> 
> Ben, is this how, in general, one would change occurances of spawn_child
> to ap_spawn_child_err_buff?  Seems simple enough but this is unfamiliar
> enough to me that I thought I would seek a second opinion.

Seems about right to me. Obviously testing is required, though! Though I
think the choice of names is a bit weird (like, I'd've called what you
called in, out and vice versa. If you see what I mean).

Don't forget that, like spawn_child, you can use NULLs for handles you
aren't interested in (at least, you should be able to), so in this case
(note, I've also done the in/out transpose, and this is NOT tested):

Index: mod_include.c
===================================================================
RCS file:
/export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v
retrieving revision 1.88
diff -u -r1.88 mod_include.c
--- mod_include.c       1998/05/19 19:19:01     1.88
+++ mod_include.c       1998/05/19 19:51:22
@@ -811,20 +811,18 @@
 static int include_cmd(char *s, request_rec *r)
 {
     include_cmd_arg arg;
-    FILE *f;
+    BUFF *script_out;

     arg.r = r;
     arg.s = s;

-    if (!spawn_child(r->pool, include_cmd_child, &arg,
-                     kill_after_timeout, NULL, &f)) {
+    if (!ap_spawn_child_err_buff(r->pool, include_cmd_child, &arg,
+                     kill_after_timeout, NULL, &script_out, NULL)) {
         return -1;
     }

-    ap_send_fd(f, r);
-    ap_pfclose(r->pool, f);        /* will wait for zombie when
-                                 * r->pool is cleared
-                                 */
+    ap_send_fb(script_out, r);
+    ap_bclose(script_out);
     return 0;
 }
 #endif


Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|  Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd,     |Apache-SSL author    http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Mime
View raw message