httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <hart...@hyperreal.com>
Subject Apache with embedded Python interpreter (fwd)
Date Sat, 09 Dec 1995 21:17:45 GMT

I told the submitter that if anyone is interested in this then one
of you will contact him.


Forwarded message:
> From skip@automatrix.com  Fri Dec  8 22:46:46 1995
> Date: Sat, 9 Dec 1995 01:46:32 -0500
> From: Skip Montanaro <skip@automatrix.com>
> Message-Id: <199512090646.BAA13367@dolphin.automatrix.com>
> To: apache-bugs@mail.apache.org
> Subject: Apache with embedded Python interpreter
> Reply-to: skip@calendar.com (Skip Montanaro)
> 
> 
> It's quite easy to embed a Python interpreter (http://www.python.org/) in
> Apache by modifying the cgi_child() function in mod_cgi.c.  Dave Mitchell at
> magnet.com did this recently.  This avoids the exec call, but unfortunately
> doesn't avoid the fork call.  It's not clear to me just what all has to be
> done to set things up for the interpreter so I can invoke it before the call
> to spawn_child in cgi_handler.
> 
> Is it sufficient to set up the environment variables and provide someplace
> for the CGI script to read stdin and dump stdout?  It looks like POST/PUT
> input for the script is in a buffer waiting to toss at the script and that
> all script output is just shuffled off to the client connection (modulo any
> Location: headers).
> 
> What I'm trying to do may not be entirely feasible since CGI scripts are
> designed to write to stdout and read from stdin.  However, Python does have
> a StringIO class that can suffice for most uses of stdin and stdout.  I can
> set up instances of StringIO in place of the script's stdin and stdout
> before invoking the interpreter, then read and process their contents after
> the script completes execution.
> 
> Any feedback appreciated.
> 
> Skip Montanaro		skip@calendar.com			  (518)372-5583
> Musi-Cal: http://www.calendar.com/concerts/ or mailto:concerts@calendar.com
> Internet Conference Calendar: http://www.calendar.com/conferences/
> 	       >>> ZLDF: http://www.netresponse.com/zldf <<<
> 


Mime
View raw message