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