Fast CGI fcgiapp questions

Jim Fulton (
Fri, 28 Jun 1996 13:28:47 -0400

Message-Id: <>
Date: Fri, 28 Jun 1996 13:28:47 -0400
From: Jim Fulton <>
Subject: Fast CGI fcgiapp questions


I'm working on a Fast CGI module for the Python scripting language
using the fcgiapp library.  I've been able to get it working OK, 
but I have a couple of questions:

1. It is my understanding that the Fast CGI protocol supports threaded
   applications, because packets for multiple requests can be interleaved.
   The documentation for FCGX_Accept, in the include file says:

 * FCGX_Accept --
 *      Accepts a new request from the HTTP server.
 * Results:
 *	0 for successful call, -1 for error.
 * Side effects:
 *      Finishes the request accepted by (and frees any
 *      storage allocated by) the previous call to FCGX_Accept.
 *      Creates input, output, and error streams and
 *      assigns them to *in, *out, and *err respectively.
 *      Creates a parameters data structure to be accessed
 *      via getenv(3) (if assigned to environ) or by FCGX_GetParam
 *      and assigns it to *envp.

   The above paragraph seems to indicate that only one request can 
   be handled at once, since FCGX_Accept "Finishes the request 
   accepted by (and frees any storage allocated by) the previous 
   call to FCGX_Accept."  Am I reading this right?  This seems like
   a serious limitation, given the capabilities of the protocol.

2. There doesn't seem to be any way to call FCGX_Accept in a non-blocking
   manner or to test for a request without blocking.  I would like to be
   able to test for other events within my "accept" loop, or check for
   Fast CGI events in, say, an CORBA/ILU ORB main loop.

   I suppose I could add a call that does a select call on reqDataPtr->socket
   in fcgiapp.c.  Is there any reason not to do this?  Are there any plans
   to provide a similar interface in the future? Or am I simply missing something.


Jim Fulton         Digital Creations   540.371.6909