------------------------------
Version 2.0b2, 04 April 1997
- $Id: README,v 1.3 1999/06/07 05:39:02 roberts Exp $
+ $Id: README,v 1.4 1999/06/10 21:20:33 roberts Exp $
Copyright (c) 1996 Open Market, Inc.
See the file "LICENSE.TERMS" for information on usage and redistribution
of this file, and for a DISCLAIMER OF ALL WARRANTIES.
----
The following is a small list of what should be available in the final
release of the FDK.
- 1. Fix all compilation problems on all Unixes and NT.
+ 1. Fix all compilation problems on all Unixes and NT.
2. Provide perl.c for perl5.003 (replace run() with runops())
3. Provide latest Tcl patches (NT requires Tcl7.5+)
4. Provide FCGI_VERSION directive for automatic version recognition.
5. Provide new Java interface to conform to JDK1.1.1 (due to final
System.in)
6. Provide samples of Perl on NT.
-
+
Changes with devkit 2.1.1
-------------------------
+ *) Remove the printf() and #include of stdio.h from examples/echo2.c.
+
*) Remove the static initialization of _fcgi_sF[] because on glibc 2.x based
- systems stdin/stdout/stderr are no longer static.
-
+ systems stdin/stdout/stderr are no longer static.
+
*) Flush FastCGI buffers at application exit. <eichin@fastengines.com>
-
+
<< INSERT OTHER STUFF HERE >>
-
+
What's New: Version 2.0b2, 04 April 1997
--------------------------------------
1. Updated build_no_shell.bat to create a FcgiBin directory under the
top level of the FastCGI kit and copy all executables and the
FastCGI dll there. This makes it easier to use.
- 2. Corrected the Unix version of OS_SpawnChild so that it didn't close
+ 2. Corrected the Unix version of OS_SpawnChild so that it didn't close
the listenFd when forking off child processes. This code would
affect the cgi-fcgi application on Unix. The problem is that it
could only start one fastcgi process. Any other processes would not
the Windows NT port. The problem was not clearing a bit indicating
that a read had completed. This caused the application to stall.
4. Corrected OS_DoIo, the function used for scheduling I/O for cgi-fcgi.
- It had a bug where it wasn't creating a copy of the file descriptors
- used for I/O. This would cause the master list of FDs to watch to be
+ It had a bug where it wasn't creating a copy of the file descriptors
+ used for I/O. This would cause the master list of FDs to watch to be
reset and thus would hang the application because we would no longer
watch for I/O on those file descriptors. (This problem was specific to
Unix and only happened with the cgi-fcgi application.)
5. Cleaned up several compilation warnings present on OSF.
-
+
What's New: Version 2.0b1, 24 March 1997
--------------------------------------
This "beta" release adds the functionality of "cgi-fcgi" to the
Windows NT platform and allows for creation of FastCGI applications
-running in Win32 environment. There is almost no new documentation
+running in Win32 environment. There is almost no new documentation
provided, but will become part of this kit in the official release.
1. Added FastCGI libraries running on Windows NT 3.51+
2. Rename errno to FCGI_errno in the FCGX_Stream, which was causing
--------------------------------------
This release introduces mostly bug fixes, without any additional
-functionality to the kit.
+functionality to the kit.
1. Conditional compilation for the hp-ux compiler.
2. Loop around the accept() call to eliminate "OS Error: Interrupted
System Call" message from appearing in the error logs.
- 3. Casting of the FCGI_Header to (char *), which eliminates the
+ 3. Casting of the FCGI_Header to (char *), which eliminates the
assertion failure "bufPtr->size>0".
-
+
What's New: Version 1.5, 12 June 1996
--------------------------------------
Changed cgi-fcgi.c to use SO_REUSEADDR when creating the listening socket;
this avoids the need to wait through the TIME_WAIT state on all the TCP
connections made by the previous instance of an external application
-you are restarting.
+you are restarting.
-/*
+/*
* echo2.c --
*
- * Produce a page containing all the inputs (fcgiapp version)
+ * Produce a page containing all the inputs (fcgiapp version)
*
*
* Copyright (c) 1996 Open Market, Inc.
*/
#ifndef lint
-static const char rcsid[] = "$Id: echo2.c,v 1.2 1999/01/30 22:27:32 roberts Exp $";
+static const char rcsid[] = "$Id: echo2.c,v 1.3 1999/06/10 21:20:35 roberts Exp $";
#endif /* not lint */
#if defined HAVE_UNISTD_H || __linux__
#include <unistd.h>
#endif
-#include <stdio.h>
#include <stdlib.h>
#include "fcgiapp.h"
#ifdef _WIN32
#include <process.h>
+#else
+extern char **environ;
#endif
static void PrintEnv(FCGX_Stream *out, char *label, char **envp)
{
- printf("%s:<br>\n<pre>\n", label);
FCGX_FPrintF(out, "%s:<br>\n<pre>\n", label);
- for(; *envp != NULL; envp++) {
+ for( ; *envp != NULL; envp++) {
FCGX_FPrintF(out, "%s\n", *envp);
}
FCGX_FPrintF(out, "</pre><p>\n");
}
-#ifndef _WIN32
-extern char **environ;
-#endif
-
void main ()
{
FCGX_Stream *in, *out, *err;
FCGX_ParamArray envp;
int count = 0;
+
while (FCGX_Accept(&in, &out, &err, &envp) >= 0) {
char *contentLength = FCGX_GetParam("CONTENT_LENGTH", envp);
- int len;
+ int len = 0;
+
FCGX_FPrintF(out,
- "Content-type: text/html\r\n"
- "\r\n"
- "<title>FastCGI echo (fcgiapp version)</title>"
- "<h1>FastCGI echo (fcgiapp version)</h1>\n"
- "Request number %d, Process ID: %d<p>\n", ++count,
- getpid());
- if(contentLength != NULL) {
+ "Content-type: text/html\r\n"
+ "\r\n"
+ "<title>FastCGI echo (fcgiapp version)</title>"
+ "<h1>FastCGI echo (fcgiapp version)</h1>\n"
+ "Request number %d, Process ID: %d<p>\n", ++count, getpid());
+
+ if (contentLength != NULL)
len = strtol(contentLength, NULL, 10);
- } else {
- len = 0;
+
+ if (len <= 0) {
+ FCGX_FPrintF(out, "No data from standard input.<p>\n");
}
- if(len <= 0) {
- FCGX_FPrintF(out, "No data from standard input.<p>\n");
- } else {
+ else {
int i, ch;
- FCGX_FPrintF(out, "Standard input:<br>\n<pre>\n");
- for(i = 0; i < len; i++) {
- if((ch = FCGX_GetChar(in)) < 0) {
- FCGX_FPrintF(out, "Error: Not enough bytes received "
- "on standard input<p>\n");
+
+ FCGX_FPrintF(out, "Standard input:<br>\n<pre>\n");
+ for (i = 0; i < len; i++) {
+ if ((ch = FCGX_GetChar(in)) < 0) {
+ FCGX_FPrintF(out,
+ "Error: Not enough bytes received on standard input<p>\n");
break;
- }
+ }
FCGX_PutChar(ch, out);
}
FCGX_FPrintF(out, "\n</pre><p>\n");
}
+
PrintEnv(out, "Request environment", envp);
PrintEnv(out, "Initial environment", environ);
} /* while */