* See the file "LICENSE.TERMS" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * $Id: fcgiapp.h,v 1.4 1999/08/05 21:25:52 roberts Exp $
+ * $Id: fcgiapp.h,v 1.5 2000/11/05 17:09:36 robs Exp $
*/
#ifndef _FCGIAPP_H
/*
*----------------------------------------------------------------------
*
+ * FCGX_Free --
+ *
+ * Free the memory and IPC FD associated with the request (multi-thread safe).
+ *
+ *----------------------------------------------------------------------
+ */
+DLLAPI void FCGX_Free(FCGX_Request * request);
+
+/*
+ *----------------------------------------------------------------------
+ *
* FCGX_Accept --
*
* Accept a new request (NOT multi-thread safe).
*
*/
#ifndef lint
-static const char rcsid[] = "$Id: fcgiapp.c,v 1.15 2000/10/02 12:43:13 robs Exp $";
+static const char rcsid[] = "$Id: fcgiapp.c,v 1.16 2000/11/05 17:09:35 robs Exp $";
#endif /* not lint */
#include "fcgi_config.h"
int errStatus = FCGX_FClose(reqDataPtr->err);
int outStatus = FCGX_FClose(reqDataPtr->out);
- if (errStatus || outStatus
- || FCGX_GetError(reqDataPtr->in)
- || !reqDataPtr->keepConnection)
+ if (errStatus || outStatus || FCGX_GetError(reqDataPtr->in))
{
OS_IpcClose(reqDataPtr->ipcFd);
}
+ }
- ASSERT(reqDataPtr->nWriters == 0);
-
- FreeStream(&reqDataPtr->in);
- reqDataPtr->in = NULL;
-
- FreeStream(&reqDataPtr->out);
- reqDataPtr->out = NULL;
+ FCGX_Free(reqDataPtr);
+}
- FreeStream(&reqDataPtr->err);
- reqDataPtr->err = NULL;
+void FCGX_Free(FCGX_Request * request)
+{
+ if (request == NULL)
+ return;
- FreeParams(&reqDataPtr->paramsPtr);
- reqDataPtr->paramsPtr = NULL;
- }
+ FreeStream(&request->in);
+ FreeStream(&request->out);
+ FreeStream(&request->err);
+ FreeParams(&request->paramsPtr);
- if (!reqDataPtr->keepConnection) {
- reqDataPtr->ipcFd = -1;
+ if (!request->keepConnection)
+ {
+ OS_IpcClose(request->ipcFd);
+ request->ipcFd = -1;
}
}
* Close the connection and try again.
*/
TryAgain:
- FreeParams(&reqDataPtr->paramsPtr);
- reqDataPtr->paramsPtr = NULL;
-
- FreeStream(&reqDataPtr->in);
- reqDataPtr->in = NULL;
+ FCGX_Free(reqDataPtr);
- OS_Close(reqDataPtr->ipcFd);
- reqDataPtr->ipcFd = -1;
} /* for (;;) */
/*
* Build the remaining data structures representing the new
* significantly more enjoyable.)
*/
#ifndef lint
-static const char rcsid[] = "$Id: os_win32.c,v 1.7 2000/08/26 02:43:49 robs Exp $";
+static const char rcsid[] = "$Id: os_win32.c,v 1.8 2000/11/05 17:09:35 robs Exp $";
#endif /* not lint */
#include "fcgi_config.h"
*/
int OS_IpcClose(int ipcFd)
{
+ if (ipcFd == -1)
+ return 0;
+
/*
* Catch it if fd is a bogus value
*/