-/*
+/*
* cgifcgi.c --
*
* CGI to FastCGI bridge
*/
#ifndef lint
-static const char rcsid[] = "$Id: cgi-fcgi.c,v 1.4 1999/07/26 04:55:14 roberts Exp $";
+static const char rcsid[] = "$Id: cgi-fcgi.c,v 1.5 1999/07/26 22:03:07 roberts Exp $";
#endif /* not lint */
#include <stdio.h>
#include "fcgi_config.h"
#include "fcgios.h"
-extern char *environ[];
+#include <stdlib.h>
static int wsReadPending = 0;
static int fcgiReadPending = 0;
}
ScheduleIo();
-}
+}
\f
/*
*
* Side effects:
* This routine will signal the ioEvent upon completion.
- *
+ *
*/
static void ScheduleIo(void)
{
if(!fcgiReadPending && appServerSock != -1) {
fromAS.next = &fromAS.buff[0];
- if(OS_AsyncRead(appServerSock, 0, fromAS.next, BUFFLEN,
+ if(OS_AsyncRead(appServerSock, 0, fromAS.next, BUFFLEN,
AppServerReadHandler,
(ClientData)appServerSock) == -1) {
FCGIexit(OS_Errno);
!fcgiWritePending &&
fromWS.next == &fromWS.buff[0]) {
if(OS_AsyncReadStdin(fromWS.next + sizeof(FCGI_Header),
- BUFFLEN - sizeof(FCGI_Header),
+ BUFFLEN - sizeof(FCGI_Header),
WebServerReadHandler, STDIN_FILENO)== -1) {
FCGIexit(OS_Errno);
} else {
if((listenFd = OS_CreateLocalIpcFd(bindPath)) == -1) {
exit(OS_Errno);
}
-
+
if(access(appPath, X_OK) == -1) {
fprintf(stderr, "%s is not executable\n", appPath);
exit(1);
This hack lets me test the ability to create a local process listening
to a TCP/IP port for connections and subsequently connect to the app
like we do for Unix domain and named pipes.
-
+
if(*doStartPtr && *doBindPtr) {
fprintf(stderr,
"<connName> of form hostName:portNumber "
} else {
bytesToRead = 0;
}
-
+
if(doBind) {
appServerSock = OS_FcgiConnect(bindPath);
}