httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Sanders <>
Subject Re: ScriptAlias-like extensions for perl etc
Date Fri, 26 Apr 1996 21:48:08 GMT
Rob Hartill writes:
> > What you *really* want is to design a protocol for sending CGI data
> > (possibly with some extensions) over a socket to a coopertating daemon.
> > 
> > That way you can write server co-daemons.  No exec'ing!!
> I'm missing something. If you have a CGI daemon (say for perl) sitting
> waiting for requests, then it'll need to fork children to process each
> request (unless you queue them - hmm, yuck). But you do save on the
> initial perl startup/parsing.

fork is generally cheaper than exec.  And nobody says how the daemon
does what it does.  It could pre-fork if it wanted.

> At first glance, from a perl prespective this doesn't sound too
> complicated. Let's get a feel for what's needed;
Yes, it should be very simple to do.

> Talking to a perl daemon Apache needs a way to send environment
> variables to give to the 'CGI script'. If (as I suspect) env vars
> can't contain line feeds, then they can be sent in a HTTP-header-like
> way
Just send it null terminated like it is in memory.
Saves having to think about it.

I think you want to touch the data as little as possible for
performance reasons.  I would use counted strings so the server
can read an "int" (I would convert it to a fixed length ASCII string
and not use native machine format) and then read that many bytes
off the stream.

If you do write this make sure that you can connect to servers
*off* the current machine.  No reason to limit yourself.

Hmmm, maybe it should even be a URL like thing where
ScriptServer is like ScriptAlias and ``coserver'' is
whatever we call the thing...  servercgi maybe?  Hmmm?

    ScriptServer /my_application coserver://

View raw message