shutdown() the send side and then read() from client until EOF
[catagits/fcgi2.git] / README
1 FastCGI Developer's Kit README
2 ------------------------------
3
4     $Id: README,v 1.20 2002/03/05 18:15:17 robs Exp $
5     Copyright (c) 1996 Open Market, Inc.
6     See the file "LICENSE.TERMS" for information on usage and redistribution
7     of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8
9 Basic Directions
10 ----------------
11
12 Unix:
13
14     ./configure
15     make
16     make install
17
18 Win32:
19
20     nmake -f Makefile.nt
21
22     (or use the MSVC++ project files in the Win32 directory)
23
24
25 CHANGES
26 -------
27
28 For more detail regarding changes, please consult the cvs log available 
29 on http://fastcgi.com/.
30
31
32 2.2.3
33 -----
34
35  *) When closing connections, shutdown() the send side of TCP sockets to 
36     prevent a TCP RST from trashing the reciept of data on the client (when
37     the client continues to send data to the application).
38
39  *) [WIN32] force an exit from the ShutdownRequestThread when a shutdown is
40     signaled and NamedPipes are in use.
41
42  *) Use streamsize and char_type in the C++ API.
43
44  *) [WIN32] Eliminate the (partial and broken) use of OverlappedIO - this 
45     was causing a loose spin in acceptNamedPipe().
46
47  *) Fix a bug that caused an assert to pop when an async file descriptor was
48     numbered greater than 16. Kevin Eye [eye@buffalo.edu]
49
50  *) Update the echo-cpp example to show the restoral of the original
51     streambufs.  Trub, Vladimir [vtrub@purolator.com]
52
53  *) Fix a bug a that caused the lib to crash under certain circumstances
54     when an error occured on a read
55
56  *) Test for iostreams that support a streambuf assigment operator
57
58  *) (WIN32) Fixed initialization of the accept mutex when OpenSocket() was used.
59     Niklas Bergh [niklas.bergh@tific.com]
60
61
62 2.2.2  
63 -----
64
65  *) Added support for shared libraries.
66
67  *) Added support for a graceful shutdown via an event under Win32.
68
69  *) Added default signal handlers for PIPE, USR1, and TERM.
70
71  *) Fix some minor bugs in the 0S_ layer.
72
73  *) Fixed the C++ streambuf implementation.
74
75
76 Changes with devkit 2.1.1 
77 -------------------------
78
79  *) Fixed an unintentional sign extension during promotion  in Java's
80     FCGIInputStream.read(). Takayuki Tachikawa <tachi@po.ntts.co.jp>
81
82  *) Cleaned up warnings in examples (mostly main() complaints).
83
84  *) Removed examples/tiny-cgi.c (it wasn't a FastCGI application?!).
85
86  *) Remove some debugging code and clean up some gcc warnings in cgi-fcgi.c.
87
88  *) Add multithread support to the fcgiapp lib and an example multithreaded
89     application, threaded.c.  Based on work by Dennis Payne
90     <dpayne@softscape.com> and Gene Sokolov <hook@aktrad.ru>.
91
92  *) Remove the printf() and #include of stdio.h from examples/echo2.c.
93
94  *) Remove the static initialization of _fcgi_sF[] because on glibc 2.x based
95     systems stdin/stdout/stderr are no longer static.
96
97  *) Flush FastCGI buffers at application exit.  <eichin@fastengines.com>
98
99  << INSERT OTHER STUFF HERE >>
100
101
102 What's New: Version 2.0b2, 04 April 1997
103 --------------------------------------
104
105 Some additional bug fixes, mostly on NT port.  The following list
106 of the bugs that have been and fixed:
107   1. Updated build_no_shell.bat to create a FcgiBin directory under the
108      top level of the FastCGI kit and copy all executables and the
109      FastCGI dll there.  This makes it easier to use.
110   2. Corrected the Unix version of OS_SpawnChild so that it didn't close
111      the listenFd when forking off child processes.  This code would
112      affect the cgi-fcgi application on Unix.  The problem is that it
113      could only start one fastcgi process.  Any other processes would not
114      get the listen file descriptor and they would die.
115   3. Corrected cgi-fcgi.c so that it properly handled large posts.  The
116      bug was introduced with the asynchronous I/O model implemented for
117      the Windows NT port.  The problem was not clearing a bit indicating
118      that a read had completed.  This caused the application to stall.
119   4. Corrected OS_DoIo, the function used for scheduling I/O for cgi-fcgi.
120      It had a bug where it wasn't creating a copy of the file descriptors
121      used for I/O.  This would cause the master list of FDs to watch to be
122      reset and thus would hang the application because we would no longer
123      watch for I/O on those file descriptors. (This problem was specific to
124      Unix and only happened with the cgi-fcgi application.)
125   5. Cleaned up several compilation warnings present on OSF.
126
127
128 What's New: Version 2.0b1, 24 March 1997
129 --------------------------------------
130
131 This "beta" release adds the functionality of "cgi-fcgi" to the
132 Windows NT platform and allows for creation of FastCGI applications
133 running in Win32 environment.  There is almost no new documentation
134 provided, but will become part of this kit in the official release.
135   1. Added FastCGI libraries running on Windows NT 3.51+
136   2. Rename errno to FCGI_errno in the FCGX_Stream, which was causing
137      problems on some Linux platforms and NT.
138   3. Fixed a parenthesis problem in FCGI_gets
139
140
141 What's New: Version 1.5.1, 12 December 1996
142 --------------------------------------
143
144 This release introduces mostly bug fixes, without any additional
145 functionality to the kit.
146   1. Conditional compilation for the hp-ux compiler.
147   2. Loop around the accept() call to eliminate "OS Error: Interrupted
148      System Call" message from appearing in the error logs.
149   3. Casting of the FCGI_Header to (char *), which eliminates the
150      assertion failure "bufPtr->size>0".
151
152
153 What's New: Version 1.5, 12 June 1996
154 --------------------------------------
155
156 General:
157
158   Added a white paper on FastCGI application performance to the
159   doc directory.  Generally brought the other docs up to date.
160
161   Rearranged the kit to put more emphasis on running FastCGI-capable
162   servers and less on running cgi-fcgi.  Added
163   examples/conf/om-httpd.config, a config file that demonstrates all
164   of the example apps.  (Would like to have similar configs for NCSA
165   and Apache.)
166
167   Added the tiny-authorizer and sample-store applications to
168   the examples.  These are explained in the index.html.
169
170     In addition to everything else it does, sample-store demonstrates
171     a bug in the Open Market WebServer 2.0: When an Authorizer
172     application denies access, the server tacks some extra junk onto
173     the end of the page the application returns.  A little ugly but
174     not fatal.
175
176 C libraries:
177
178   Added the functions FCGX_Finish and FCGI_Finish.  These functions
179   finish the current request from the HTTP server but do not begin a
180   new request.  These functions make it possible for applications to
181   perform other processing between requests.  An application must not
182   use its stdin, stdout, stderr, or environ between calling
183   FCGI_Finish and calling FCGI_Accept.  See doc/FCGI_Finish.3 for
184   more information.  The application examples/sample-store.c demonstrates
185   the use of FCGI_Finish.
186
187   Added conditional 'extern "C"' stuff to the .h files fcgi_stdio.h,
188   fcgiapp.h, and fcgiappmisc.h for the benefit of C++ applications
189   (suggested by Jim McCarthy).
190
191   Fixed two bugs in FCGX_VFPrintF (reported by Ben Laurie).  These
192   bugs affected processing of %f format specifiers and of all format
193   specifiers containing a precision spec (e.g "%12.4g").
194
195   Fixed a bug in FCGX_Accept in which the environment variable
196   FCGI_WEBSERVER_ADDRS was being read rather than the specified
197   FCGI_WEB_SERVER_ADDRS.  Fixed a bug in FCGX_Accept in which the
198   wrong storage was freed when FCGI_WEB_SERVER_ADDRS contained more
199   than one address or if the address check failed.
200
201   Changed FCGX_Accept to avoid depending upon accept(2) returning the
202   correct value of sin_family in the socketaddr structure for an
203   AF_UNIX connection (SCO returns the wrong value, as reported by Paul
204   Mahoney).
205
206   Changed the error retry logic in FCGX_Accept.  FCGX_Accept now
207   returns -1 only in case of operating system errors that occur while
208   accepting a connection (e.g. out of file descriptors).  Other errors
209   cause the current connection to be dropped and a new connection to
210   be attempted.
211
212 Perl:
213
214   Changed FCGI.xs to make it insensitive to Perl's treatment of
215   environ (we hope).  Changed FCGI::accept so the initial environment
216   variables are not unset on the first call to FCGI::accept (or on
217   subsequent calls either).  Added the echo-perl example
218   program.  Added a workaround for the "empty initial environment bug"
219   to tiny-perl-fcgi.  Changed the example Perl scripts to use a new
220   symbolic link ./perl, avoiding the HP-UX 32 character limit on the
221   first line of a command interpreter file.
222
223   Because the FastCGI-enabled Perl interpreter uses the C fcgi_stdio
224   library, it picks up all the changes listed above for C.  There's
225   a new Perl subroutine FCGI::finish.
226
227 Tcl:
228
229   Fixed a bug in tclFCGI.c that caused the request environment
230   variables to be lost.  Changed FCGI_Accept so the initial
231   environment variables are not unset on the first call to FCGI_Accept
232   (or on subsequent calls either).  Added the echo-tcl example
233   program.  Fixed another bug that caused Tcl to become confused by
234   file opens; as a side effect of this change, writes to stdout/stderr
235   that occur in an app running as FastCGI before FCGI_Accept is called
236   are no-ops rather than crashing Tcl.  Changed the example Tcl
237   scripts to use a new symbolic link ./tclsh, avoiding the HP-UX 32
238   character limit on the first line of a command interpreter file.
239
240   Because the FastCGI-enabled Tcl interpreter uses the C fcgi_stdio
241   library, it picks up all the changes listed above for C; there's
242   a new Tcl command FCGI_Finish.
243
244 Java:
245
246   Fixed a sign-extension bug in FCGIMessage.java that caused bad encodings
247   of names and values in name-value pairs for lengths in [128..255].
248   Made small cleanups in the Java example programs to make them more
249   consistent with the other examples.
250
251
252
253 What's New: Version 1.4, 10 May 1996
254 --------------------------------------
255
256 Includes Java classes and Java examples.
257
258
259
260 What's New: Version 1.3.1, 6 May 1996
261 --------------------------------------
262
263 New, simplified, license terms.  Includes an expanded whitepaper that
264 describes FastCGI support in Open Market's Secure WebServer 2.0.
265 Includes Open Market FastCGI 1.0 Programmer's Guide.  Includes
266 "FastCGI: A High-Performance Gateway Interface", a position paper
267 presented at the workshop "Programming the Web - a search for APIs",
268 Fifth International World Wide Web Conference, 6 May 1996, Paris,
269 France.
270
271
272
273 What's New: Version 1.3, 29 April 1996
274 --------------------------------------
275
276 First public release; new license terms on all files.
277
278 Changed cgi-fcgi.c to use SO_REUSEADDR when creating the listening socket;
279 this avoids the need to wait through the TIME_WAIT state on all the TCP
280 connections made by the previous instance of an external application
281 you are restarting.
282
283
284
285 What's New: Version 1.2.2, 15 April 1996
286 ----------------------------------------
287
288 Partially fixed a bug in Perl's FCGI::accept (source file FCGI.xs).
289 The per-request environment variables were being lost.  Now the
290 per-request environment variables show up correctly, except that if
291 the Perl application has an empty initial environment, the environment
292 variables associated with the *first* request are lost.  Therefore,
293 when starting Perl, always set some environment variable using the
294 AppClass -initial-env option, or by running cgi-fcgi in a non-empty
295 environment.
296
297
298
299 What's New: Version 1.2.1, 22 March 1996
300 ----------------------------------------
301
302 Fixed a bug in FCGI_Accept.  If your application running as FastCGI
303 opened a file before calling FCGI_Accept, it would decide that it
304 was really running as CGI.  Things went downhill quickly after that!
305
306 Also added advisory locking to serialize calls to accept on shared
307 listening sockets on Solaris and IRIX, to work around problems
308 with concurrent accept calls on these platforms.
309
310
311
312 What's New: Version 1.2, 20 March 1996
313 --------------------------------------
314
315 1. This version of the kit implements the most recent draft
316 of the protocol spec.  Enhancements to the protocol include
317 a BEGIN_REQUEST record that simplifies request ID management
318 and transmits role and keep-alive information, and a simplified
319 end-of-stream indication.
320
321 The protocol spec has been revised to describe exactly what's
322 been implemented, leaving out the features that we hope to
323 introduce in later releases.
324
325 At the application level, the visible change is the FCGI_ROLE
326 variable that's available to applications.  This allows an application
327 to check that it has been invoked in the expected role.  A single
328 application can be written to respond in several roles.  The
329 FCGI_Accept.3 manpage contains more information.
330
331 2.  We introduced the new "module" prefix FCGX in order to simplify
332 the relationship between fcgi_stdio and fcgiapp.
333
334 A growing number of functions are provided in both fcgi_stdio and
335 fcgiapp versions.  Rather than inventing an ad hoc solution for each
336 naming conflict (as we did with FCGI_accept and FCGI_Accept), we've
337 bitten the bullet and systematically renamed *all* the fcgapp
338 primitives with the prefix FCGX_.  In fcgi_stdio, we've renamed
339 FCGI_accept to FCGI_Accept.  So all functions that are common in the
340 two libraries have the same name modulo the different prefixes.
341
342 The Accept function visible in Tcl is now called FCGI_Accept, not
343 FCGI_accept.
344
345 The Accept function visible in Perl is now FCGI::accept.  All
346 lower case names for functions and all upper case names for
347 modules appears to be a Perl convention, so we conform.
348
349 3. The kit now fully supports the Responder, Authorizer,
350 and Filter roles.
351
352 The Filter role required a new function, FCGI_StartFilterData.
353 FCGI_StartFilterData changes the input stream from reading
354 FCGI_STDIN data to reading FCGI_DATA data.  The manpage
355 gives full details.
356
357 Another new function, FCGI_SetExitStatus, is primarily for
358 the Responder role but is available to all.  FCGI_SetExitStatus
359 allows an application to set a nonzero "exit" status
360 before completing a request and calling FCGI_Accept again.
361 The manpage gives full details.
362
363 These two new functions are provided at both the fcgi_stdio interface
364 and the basic fcgiapp interface.  Naturally, the fcgiapp versions are
365 called FCGX_StartFilterData and FCGX_SetExitStatus.
366
367 4. The fcgiapp interface changed slightly in order to treat
368 the streams and environment data more symmetrically.
369
370 FCGX_Accept now returns an environment pointer, rather than requiring
371 a call to FCGX_GetAllParams to retrieve an environment pointer.
372 FCGX_GetParam takes an explicit environment pointer argument.
373 FCGX_GetAllParams is eliminated.  See the documentation in the header
374 file for complete information.
375
376 fcgiapp also added the procedure FCGX_IsCGI, providing a standardized
377 test of whether the app was started as CGI or FastCGI.
378
379 5. We've ported the kits to vendor-supported ANSI C compilers
380 on Sun (Solaris 2.X), HP, and Digital platforms.  GCC can be
381 selected on these platforms by performing SETENV CC gcc before
382 running configure.
383
384
385
386 What's New: Version 1.1, 30 Jan 1996
387 ------------------------------------
388
389 1. More platforms: Digital UNIX, IBM AIX, Silicon Graphics IRIX,
390 Sun SunOS 4.1.4.
391
392 2. Perl and Tcl: Simple recipes for producing Perl and Tcl
393 interpreters that run as FastCGI applications.  No source
394 code changes are needed to Perl and Tcl.  Documented
395 in separate documents, accessible via the index page.
396
397
398
399 Version 1.0, 10 Jan 1996
400 ------------------------