You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Ralf S. Engelschall" <rs...@engelschall.com> on 1998/05/20 17:52:26 UTC

Hmmm.... spawning child in mod_rewrite.c

Hmmmm... because the spawned childs now have a "pinfo" I'd prefer to call
ap_call_exec() in the child callback funtion.  But this functions needs an
request_rec pointer. It's ok in the other modules like mod_cgi.c where one is
available, but in mod_rewrite the RewriteMap program is run at the init hook
(where only a server_rec is available).

On the other hand using ap_open_piped_log doesn't work correctly (even when I
enhance http_log.c's stuff for the stdout handle). I get the output of a
RewriteMap program N times where N is really non-deterministic. Hmmm..

Has anybody a hint how we should change the  rewritemap_program_child()
function in mod_rewrite.c to let it use the pinfo stuff correctly?

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Re: Hmmm.... spawning child in mod_rewrite.c

Posted by Dean Gaudet <dg...@arctic.org>.

On Wed, 20 May 1998, Brian Behlendorf wrote:

> At 09:40 AM 5/20/98 -0700, Dean Gaudet wrote:
> >ap_call_exec() is a broken hack...  it has two functions really, one
> >is to build arguments and do suexec crap, and the other is to actually
> >call exec, given an argv and envp.  You only want the second function,
> >and it doesn't require a request_rec.
> 
> So would you suggest Ralf portion off that second part into another
> function (which should be too bad) or replicate that other function within
> mod_rewrite (which could be a lot of work and a pain to maintain)?

Yeah, split it up and extend the API.  Provide ap_call_exec() as a
backwards legacy thing if you want. 

Dean


Re: Hmmm.... spawning child in mod_rewrite.c

Posted by Brian Behlendorf <br...@hyperreal.org>.
At 09:40 AM 5/20/98 -0700, Dean Gaudet wrote:
>ap_call_exec() is a broken hack...  it has two functions really, one
>is to build arguments and do suexec crap, and the other is to actually
>call exec, given an argv and envp.  You only want the second function,
>and it doesn't require a request_rec.

So would you suggest Ralf portion off that second part into another
function (which should be too bad) or replicate that other function within
mod_rewrite (which could be a lot of work and a pain to maintain)?

>Of course the entire spawning API is completely broken in 1.3, and it's
>increasingly obvious that we shouldn't try wedging more win32 kludges
>into it... and should consider something more clean (like the api used
>in NSPR for creating processes).

Fairy nuff.  I just want to get 1.3.0 and not have 1000 more reports in the
bug database stating "win32 hangs because I run out of file descriptors".
Maybe at some point we punt and say Win32 is officially unsupported until
2.0 because MS's POSIX layer blows big chunks and our effort is better
spent elsewhere.  But for the time being let's just put something out not
completely broken.

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
pure chewing satisfaction                                  brian@apache.org
                                                        brian@hyperreal.org

Re: Hmmm.... spawning child in mod_rewrite.c

Posted by Brian Behlendorf <br...@hyperreal.org>.
At 09:40 AM 5/20/98 -0700, Dean Gaudet wrote:
>ap_call_exec() is a broken hack...  it has two functions really, one
>is to build arguments and do suexec crap, and the other is to actually
>call exec, given an argv and envp.  You only want the second function,
>and it doesn't require a request_rec.

So would you suggest Ralf portion off that second part into another
function (which should be too bad) or replicate that other function within
mod_rewrite (which could be a lot of work and a pain to maintain)?

>Of course the entire spawning API is completely broken in 1.3, and it's
>increasingly obvious that we shouldn't try wedging more win32 kludges
>into it... and should consider something more clean (like the api used
>in NSPR for creating processes).

Fairy nuff.  I just want to get 1.3.0 and not have 1000 more reports in the
bug database stating "win32 hangs because I run out of file descriptors".
Maybe at some point we punt and say Win32 is officially unsupported until
2.0 because MS's POSIX layer blows big chunks and our effort is better
spent elsewhere.  But for the time being let's just put something out not
completely broken.

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
pure chewing satisfaction                                  brian@apache.org
                                                        brian@hyperreal.org

Re: Hmmm.... spawning child in mod_rewrite.c

Posted by Dean Gaudet <dg...@arctic.org>.
ap_call_exec() is a broken hack...  it has two functions really, one
is to build arguments and do suexec crap, and the other is to actually
call exec, given an argv and envp.  You only want the second function,
and it doesn't require a request_rec.

Of course the entire spawning API is completely broken in 1.3, and it's
increasingly obvious that we shouldn't try wedging more win32 kludges
into it... and should consider something more clean (like the api used
in NSPR for creating processes).

Dean

On Wed, 20 May 1998, Ralf S. Engelschall wrote:

> 
> Hmmmm... because the spawned childs now have a "pinfo" I'd prefer to call
> ap_call_exec() in the child callback funtion.  But this functions needs an
> request_rec pointer. It's ok in the other modules like mod_cgi.c where one is
> available, but in mod_rewrite the RewriteMap program is run at the init hook
> (where only a server_rec is available).
> 
> On the other hand using ap_open_piped_log doesn't work correctly (even when I
> enhance http_log.c's stuff for the stdout handle). I get the output of a
> RewriteMap program N times where N is really non-deterministic. Hmmm..
> 
> Has anybody a hint how we should change the  rewritemap_program_child()
> function in mod_rewrite.c to let it use the pinfo stuff correctly?
> 
>                                        Ralf S. Engelschall
>                                        rse@engelschall.com
>                                        www.engelschall.com
>