Added scripts to help building the libfcgi.dll and .lib from modified source of libfcgi
Extracted into "libfcgi" only the files needed to compile the Windows .dll and .lib
This commit is contained in:
21
library/server/libfcgi/Clib/README.md
Normal file
21
library/server/libfcgi/Clib/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
== libFCGI for Eiffel libFCGI wrapper library ==
|
||||
|
||||
=== On Windows ===
|
||||
|
||||
The Eiffel libFCGI wrapper needs a modified version of libFCGI (provided by http://www.fastcgi.com/devkit/libfcgi/)
|
||||
|
||||
To get the full source code:
|
||||
rd /q/s libfcgi
|
||||
git clone https://github.com/EiffelSoftware/libfcgi libfcgi
|
||||
|
||||
And then to build the needed .dll and .lib file, use either:
|
||||
build_win32.bat
|
||||
or build_win64.bat
|
||||
|
||||
=== On other platorms ===
|
||||
|
||||
You can use the original version of libfcgi
|
||||
|
||||
For instance, on Ubuntu (or any debian):
|
||||
> sudo apt-get install libfcgi-dev
|
||||
|
||||
18
library/server/libfcgi/Clib/build_win32.bat
Normal file
18
library/server/libfcgi/Clib/build_win32.bat
Normal file
@@ -0,0 +1,18 @@
|
||||
rem This script is to help compiling the Win x86 version of libfcgi
|
||||
setlocal
|
||||
|
||||
set E_libFCGI_OUTDIR=%~dp0_win32
|
||||
|
||||
set CL_FLAGS= /Ilibfcgi\include /nologo /W3 /WX- /O2 /Ob2 /D _SCL_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_WARNINGS /D NDEBUG /D WIN32 /D _CONSOLE /D LIBFCGI_EXPORTS /D WINVER=0x501 /D _WIN32_WINNT=0x501 /D _SECURE_SCL=0 /D _VC80_UPGRADE=0x0600 /D _WINDLL /D _MBCS /GF /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:queue /Fo"%E_libFCGI_OUTDIR%/"
|
||||
|
||||
set LINK_FLAGS= /ERRORREPORT:QUEUE /OUT:"%E_libFCGI_OUTDIR%\libfcgi.dll" /INCREMENTAL:NO /NOLOGO Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /TLBID:1 /DYNAMICBASE:NO /IMPLIB:"%E_libFCGI_OUTDIR%\libfcgi.lib" /MACHINE:X86
|
||||
|
||||
mkdir %E_libFCGI_OUTDIR%
|
||||
copy libfcgi\include\fcgi_config_x86.h libfcgi\include\fcgi_config.h
|
||||
CL.exe /c %CL_FLAGS% /TC libfcgi\libfcgi\fcgi_stdio.c libfcgi\libfcgi\fcgiapp.c libfcgi\libfcgi\os_win32.c
|
||||
CL.exe /c %CL_FLAGS% /TP libfcgi\libfcgi\fcgio.cpp
|
||||
link.exe %LINK_FLAGS% /DLL %E_libFCGI_OUTDIR%\fcgi_stdio.obj %E_libFCGI_OUTDIR%\fcgiapp.obj %E_libFCGI_OUTDIR%\os_win32.obj %E_libFCGI_OUTDIR%\fcgio.obj
|
||||
|
||||
copy %E_libFCGI_OUTDIR%\libfcgi.* %~dp0..\spec\lib\windows\msc
|
||||
|
||||
endlocal
|
||||
18
library/server/libfcgi/Clib/build_win64.bat
Normal file
18
library/server/libfcgi/Clib/build_win64.bat
Normal file
@@ -0,0 +1,18 @@
|
||||
rem This script is to help compiling the Win64 version of libfcgi
|
||||
setlocal
|
||||
|
||||
set E_libFCGI_OUTDIR=%~dp0_win64
|
||||
|
||||
set CL_FLAGS= /Ilibfcgi\include /nologo /W3 /WX- /O2 /Ob2 /D _WIN64 /D _SCL_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_WARNINGS /D NDEBUG /D WIN32 /D _CONSOLE /D LIBFCGI_EXPORTS /D WINVER=0x501 /D _WIN32_WINNT=0x501 /D _SECURE_SCL=0 /D _VC80_UPGRADE=0x0600 /D _WINDLL /D _MBCS /GF /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:queue /Fo"%E_libFCGI_OUTDIR%/"
|
||||
|
||||
set LINK_FLAGS= /ERRORREPORT:QUEUE /OUT:"%E_libFCGI_OUTDIR%\libfcgi.dll" /INCREMENTAL:NO /NOLOGO Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /TLBID:1 /DYNAMICBASE:NO /IMPLIB:"%E_libFCGI_OUTDIR%\libfcgi.lib" /MACHINE:X64
|
||||
|
||||
mkdir %E_libFCGI_OUTDIR%
|
||||
copy libfcgi\include\fcgi_config_x86.h libfcgi\include\fcgi_config.h
|
||||
CL.exe /c %CL_FLAGS% /TC libfcgi\libfcgi\fcgi_stdio.c libfcgi\libfcgi\fcgiapp.c libfcgi\libfcgi\os_win32.c
|
||||
CL.exe /c %CL_FLAGS% /TP libfcgi\libfcgi\fcgio.cpp
|
||||
link.exe %LINK_FLAGS% /DLL %E_libFCGI_OUTDIR%\fcgi_stdio.obj %E_libFCGI_OUTDIR%\fcgiapp.obj %E_libFCGI_OUTDIR%\os_win32.obj %E_libFCGI_OUTDIR%\fcgio.obj
|
||||
|
||||
copy %E_libFCGI_OUTDIR%\libfcgi.* %~dp0..\spec\lib\win64\msc
|
||||
|
||||
endlocal
|
||||
28
library/server/libfcgi/Clib/libfcgi/LICENSE.TERMS
Normal file
28
library/server/libfcgi/Clib/libfcgi/LICENSE.TERMS
Normal file
@@ -0,0 +1,28 @@
|
||||
This FastCGI application library source and object code (the
|
||||
"Software") and its documentation (the "Documentation") are
|
||||
copyrighted by Open Market, Inc ("Open Market"). The following terms
|
||||
apply to all files associated with the Software and Documentation
|
||||
unless explicitly disclaimed in individual files.
|
||||
|
||||
Open Market permits you to use, copy, modify, distribute, and license
|
||||
this Software and the Documentation for any purpose, provided that
|
||||
existing copyright notices are retained in all copies and that this
|
||||
notice is included verbatim in any distributions. No written
|
||||
agreement, license, or royalty fee is required for any of the
|
||||
authorized uses. Modifications to this Software and Documentation may
|
||||
be copyrighted by their authors and need not follow the licensing
|
||||
terms described here. If modifications to this Software and
|
||||
Documentation have new licensing terms, the new terms must be clearly
|
||||
indicated on the first page of each file where they apply.
|
||||
|
||||
OPEN MARKET MAKES NO EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE
|
||||
SOFTWARE OR THE DOCUMENTATION, INCLUDING WITHOUT LIMITATION ANY
|
||||
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN
|
||||
NO EVENT SHALL OPEN MARKET BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY
|
||||
DAMAGES ARISING FROM OR RELATING TO THIS SOFTWARE OR THE
|
||||
DOCUMENTATION, INCLUDING, WITHOUT LIMITATION, ANY INDIRECT, SPECIAL OR
|
||||
CONSEQUENTIAL DAMAGES OR SIMILAR DAMAGES, INCLUDING LOST PROFITS OR
|
||||
LOST DATA, EVEN IF OPEN MARKET HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES. THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS".
|
||||
OPEN MARKET HAS NO LIABILITY IN CONTRACT, TORT, NEGLIGENCE OR
|
||||
OTHERWISE ARISING OUT OF THIS SOFTWARE OR THE DOCUMENTATION.
|
||||
14
library/server/libfcgi/Clib/libfcgi/README.md
Normal file
14
library/server/libfcgi/Clib/libfcgi/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
== libFCGI source code for the libFCGI Eiffel wrapper ==
|
||||
|
||||
This folder contains the source code required to compile the Windows versions of libfcgi
|
||||
|
||||
It is a __modified__ version to enable us to compile libfcgi on __Windows 64bits__
|
||||
|
||||
We used the patch located under doc\fcgi-2.4.0-x64.patch applied against the original version of libFCGI from http://www.fastcgi.com/devkit/libfcgi/
|
||||
|
||||
This folder contains only the files related to libfcgi on Windows.
|
||||
|
||||
You can get the full source code at https://github.com/EiffelSoftware/libfcgi
|
||||
|
||||
|
||||
SEE ALSO in the folder "doc" the original README files
|
||||
400
library/server/libfcgi/Clib/libfcgi/doc/README
Normal file
400
library/server/libfcgi/Clib/libfcgi/doc/README
Normal file
@@ -0,0 +1,400 @@
|
||||
FastCGI Developer's Kit README
|
||||
------------------------------
|
||||
|
||||
$Id: README,v 1.21 2003/01/19 17:19:41 robs 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.
|
||||
|
||||
Basic Directions
|
||||
----------------
|
||||
|
||||
Unix:
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
Win32:
|
||||
|
||||
nmake -f Makefile.nt
|
||||
|
||||
(or use the MSVC++ project files in the Win32 directory)
|
||||
|
||||
|
||||
CHANGES
|
||||
-------
|
||||
|
||||
For more detail regarding changes, please consult the cvs log available
|
||||
on http://fastcgi.com/.
|
||||
|
||||
|
||||
2.4.0
|
||||
-----
|
||||
|
||||
*) When closing connections, shutdown() the send side of TCP sockets to
|
||||
prevent a TCP RST from trashing the reciept of data on the client (when
|
||||
the client continues to send data to the application).
|
||||
|
||||
*) [WIN32] force an exit from the ShutdownRequestThread when a shutdown is
|
||||
signaled and NamedPipes are in use.
|
||||
|
||||
*) Use streamsize and char_type in the C++ API.
|
||||
|
||||
*) [WIN32] Eliminate the (partial and broken) use of OverlappedIO - this
|
||||
was causing a loose spin in acceptNamedPipe().
|
||||
|
||||
*) Fix a bug that caused an assert to pop when an async file descriptor was
|
||||
numbered greater than 16. Kevin Eye [eye@buffalo.edu]
|
||||
|
||||
*) Update the echo-cpp example to show the restoral of the original
|
||||
streambufs. Trub, Vladimir [vtrub@purolator.com]
|
||||
|
||||
*) Fix a bug a that caused the lib to crash under certain circumstances
|
||||
when an error occured on a read
|
||||
|
||||
*) Test for iostreams that support a streambuf assigment operator
|
||||
|
||||
*) (WIN32) Fixed initialization of the accept mutex when OpenSocket() was used.
|
||||
Niklas Bergh [niklas.bergh@tific.com]
|
||||
|
||||
|
||||
2.2.2
|
||||
-----
|
||||
|
||||
*) Added support for shared libraries.
|
||||
|
||||
*) Added support for a graceful shutdown via an event under Win32.
|
||||
|
||||
*) Added default signal handlers for PIPE, USR1, and TERM.
|
||||
|
||||
*) Fix some minor bugs in the 0S_ layer.
|
||||
|
||||
*) Fixed the C++ streambuf implementation.
|
||||
|
||||
|
||||
Changes with devkit 2.1.1
|
||||
-------------------------
|
||||
|
||||
*) Fixed an unintentional sign extension during promotion in Java's
|
||||
FCGIInputStream.read(). Takayuki Tachikawa <tachi@po.ntts.co.jp>
|
||||
|
||||
*) Cleaned up warnings in examples (mostly main() complaints).
|
||||
|
||||
*) Removed examples/tiny-cgi.c (it wasn't a FastCGI application?!).
|
||||
|
||||
*) Remove some debugging code and clean up some gcc warnings in cgi-fcgi.c.
|
||||
|
||||
*) Add multithread support to the fcgiapp lib and an example multithreaded
|
||||
application, threaded.c. Based on work by Dennis Payne
|
||||
<dpayne@softscape.com> and Gene Sokolov <hook@aktrad.ru>.
|
||||
|
||||
*) 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.
|
||||
|
||||
*) Flush FastCGI buffers at application exit. <eichin@fastengines.com>
|
||||
|
||||
<< INSERT OTHER STUFF HERE >>
|
||||
|
||||
|
||||
What's New: Version 2.0b2, 04 April 1997
|
||||
--------------------------------------
|
||||
|
||||
Some additional bug fixes, mostly on NT port. The following list
|
||||
of the bugs that have been and fixed:
|
||||
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
|
||||
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
|
||||
get the listen file descriptor and they would die.
|
||||
3. Corrected cgi-fcgi.c so that it properly handled large posts. The
|
||||
bug was introduced with the asynchronous I/O model implemented for
|
||||
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
|
||||
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
|
||||
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
|
||||
problems on some Linux platforms and NT.
|
||||
3. Fixed a parenthesis problem in FCGI_gets
|
||||
|
||||
|
||||
What's New: Version 1.5.1, 12 December 1996
|
||||
--------------------------------------
|
||||
|
||||
This release introduces mostly bug fixes, without any additional
|
||||
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
|
||||
assertion failure "bufPtr->size>0".
|
||||
|
||||
|
||||
What's New: Version 1.5, 12 June 1996
|
||||
--------------------------------------
|
||||
|
||||
General:
|
||||
|
||||
Added a white paper on FastCGI application performance to the
|
||||
doc directory. Generally brought the other docs up to date.
|
||||
|
||||
Rearranged the kit to put more emphasis on running FastCGI-capable
|
||||
servers and less on running cgi-fcgi. Added
|
||||
examples/conf/om-httpd.config, a config file that demonstrates all
|
||||
of the example apps. (Would like to have similar configs for NCSA
|
||||
and Apache.)
|
||||
|
||||
Added the tiny-authorizer and sample-store applications to
|
||||
the examples. These are explained in the index.html.
|
||||
|
||||
In addition to everything else it does, sample-store demonstrates
|
||||
a bug in the Open Market WebServer 2.0: When an Authorizer
|
||||
application denies access, the server tacks some extra junk onto
|
||||
the end of the page the application returns. A little ugly but
|
||||
not fatal.
|
||||
|
||||
C libraries:
|
||||
|
||||
Added the functions FCGX_Finish and FCGI_Finish. These functions
|
||||
finish the current request from the HTTP server but do not begin a
|
||||
new request. These functions make it possible for applications to
|
||||
perform other processing between requests. An application must not
|
||||
use its stdin, stdout, stderr, or environ between calling
|
||||
FCGI_Finish and calling FCGI_Accept. See doc/FCGI_Finish.3 for
|
||||
more information. The application examples/sample-store.c demonstrates
|
||||
the use of FCGI_Finish.
|
||||
|
||||
Added conditional 'extern "C"' stuff to the .h files fcgi_stdio.h,
|
||||
fcgiapp.h, and fcgiappmisc.h for the benefit of C++ applications
|
||||
(suggested by Jim McCarthy).
|
||||
|
||||
Fixed two bugs in FCGX_VFPrintF (reported by Ben Laurie). These
|
||||
bugs affected processing of %f format specifiers and of all format
|
||||
specifiers containing a precision spec (e.g "%12.4g").
|
||||
|
||||
Fixed a bug in FCGX_Accept in which the environment variable
|
||||
FCGI_WEBSERVER_ADDRS was being read rather than the specified
|
||||
FCGI_WEB_SERVER_ADDRS. Fixed a bug in FCGX_Accept in which the
|
||||
wrong storage was freed when FCGI_WEB_SERVER_ADDRS contained more
|
||||
than one address or if the address check failed.
|
||||
|
||||
Changed FCGX_Accept to avoid depending upon accept(2) returning the
|
||||
correct value of sin_family in the socketaddr structure for an
|
||||
AF_UNIX connection (SCO returns the wrong value, as reported by Paul
|
||||
Mahoney).
|
||||
|
||||
Changed the error retry logic in FCGX_Accept. FCGX_Accept now
|
||||
returns -1 only in case of operating system errors that occur while
|
||||
accepting a connection (e.g. out of file descriptors). Other errors
|
||||
cause the current connection to be dropped and a new connection to
|
||||
be attempted.
|
||||
|
||||
Perl:
|
||||
|
||||
Changed FCGI.xs to make it insensitive to Perl's treatment of
|
||||
environ (we hope). Changed FCGI::accept so the initial environment
|
||||
variables are not unset on the first call to FCGI::accept (or on
|
||||
subsequent calls either). Added the echo-perl example
|
||||
program. Added a workaround for the "empty initial environment bug"
|
||||
to tiny-perl-fcgi. Changed the example Perl scripts to use a new
|
||||
symbolic link ./perl, avoiding the HP-UX 32 character limit on the
|
||||
first line of a command interpreter file.
|
||||
|
||||
Because the FastCGI-enabled Perl interpreter uses the C fcgi_stdio
|
||||
library, it picks up all the changes listed above for C. There's
|
||||
a new Perl subroutine FCGI::finish.
|
||||
|
||||
Tcl:
|
||||
|
||||
Fixed a bug in tclFCGI.c that caused the request environment
|
||||
variables to be lost. Changed FCGI_Accept so the initial
|
||||
environment variables are not unset on the first call to FCGI_Accept
|
||||
(or on subsequent calls either). Added the echo-tcl example
|
||||
program. Fixed another bug that caused Tcl to become confused by
|
||||
file opens; as a side effect of this change, writes to stdout/stderr
|
||||
that occur in an app running as FastCGI before FCGI_Accept is called
|
||||
are no-ops rather than crashing Tcl. Changed the example Tcl
|
||||
scripts to use a new symbolic link ./tclsh, avoiding the HP-UX 32
|
||||
character limit on the first line of a command interpreter file.
|
||||
|
||||
Because the FastCGI-enabled Tcl interpreter uses the C fcgi_stdio
|
||||
library, it picks up all the changes listed above for C; there's
|
||||
a new Tcl command FCGI_Finish.
|
||||
|
||||
Java:
|
||||
|
||||
Fixed a sign-extension bug in FCGIMessage.java that caused bad encodings
|
||||
of names and values in name-value pairs for lengths in [128..255].
|
||||
Made small cleanups in the Java example programs to make them more
|
||||
consistent with the other examples.
|
||||
|
||||
|
||||
|
||||
What's New: Version 1.4, 10 May 1996
|
||||
--------------------------------------
|
||||
|
||||
Includes Java classes and Java examples.
|
||||
|
||||
|
||||
|
||||
What's New: Version 1.3.1, 6 May 1996
|
||||
--------------------------------------
|
||||
|
||||
New, simplified, license terms. Includes an expanded whitepaper that
|
||||
describes FastCGI support in Open Market's Secure WebServer 2.0.
|
||||
Includes Open Market FastCGI 1.0 Programmer's Guide. Includes
|
||||
"FastCGI: A High-Performance Gateway Interface", a position paper
|
||||
presented at the workshop "Programming the Web - a search for APIs",
|
||||
Fifth International World Wide Web Conference, 6 May 1996, Paris,
|
||||
France.
|
||||
|
||||
|
||||
|
||||
What's New: Version 1.3, 29 April 1996
|
||||
--------------------------------------
|
||||
|
||||
First public release; new license terms on all files.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
What's New: Version 1.2.2, 15 April 1996
|
||||
----------------------------------------
|
||||
|
||||
Partially fixed a bug in Perl's FCGI::accept (source file FCGI.xs).
|
||||
The per-request environment variables were being lost. Now the
|
||||
per-request environment variables show up correctly, except that if
|
||||
the Perl application has an empty initial environment, the environment
|
||||
variables associated with the *first* request are lost. Therefore,
|
||||
when starting Perl, always set some environment variable using the
|
||||
AppClass -initial-env option, or by running cgi-fcgi in a non-empty
|
||||
environment.
|
||||
|
||||
|
||||
|
||||
What's New: Version 1.2.1, 22 March 1996
|
||||
----------------------------------------
|
||||
|
||||
Fixed a bug in FCGI_Accept. If your application running as FastCGI
|
||||
opened a file before calling FCGI_Accept, it would decide that it
|
||||
was really running as CGI. Things went downhill quickly after that!
|
||||
|
||||
Also added advisory locking to serialize calls to accept on shared
|
||||
listening sockets on Solaris and IRIX, to work around problems
|
||||
with concurrent accept calls on these platforms.
|
||||
|
||||
|
||||
|
||||
What's New: Version 1.2, 20 March 1996
|
||||
--------------------------------------
|
||||
|
||||
1. This version of the kit implements the most recent draft
|
||||
of the protocol spec. Enhancements to the protocol include
|
||||
a BEGIN_REQUEST record that simplifies request ID management
|
||||
and transmits role and keep-alive information, and a simplified
|
||||
end-of-stream indication.
|
||||
|
||||
The protocol spec has been revised to describe exactly what's
|
||||
been implemented, leaving out the features that we hope to
|
||||
introduce in later releases.
|
||||
|
||||
At the application level, the visible change is the FCGI_ROLE
|
||||
variable that's available to applications. This allows an application
|
||||
to check that it has been invoked in the expected role. A single
|
||||
application can be written to respond in several roles. The
|
||||
FCGI_Accept.3 manpage contains more information.
|
||||
|
||||
2. We introduced the new "module" prefix FCGX in order to simplify
|
||||
the relationship between fcgi_stdio and fcgiapp.
|
||||
|
||||
A growing number of functions are provided in both fcgi_stdio and
|
||||
fcgiapp versions. Rather than inventing an ad hoc solution for each
|
||||
naming conflict (as we did with FCGI_accept and FCGI_Accept), we've
|
||||
bitten the bullet and systematically renamed *all* the fcgapp
|
||||
primitives with the prefix FCGX_. In fcgi_stdio, we've renamed
|
||||
FCGI_accept to FCGI_Accept. So all functions that are common in the
|
||||
two libraries have the same name modulo the different prefixes.
|
||||
|
||||
The Accept function visible in Tcl is now called FCGI_Accept, not
|
||||
FCGI_accept.
|
||||
|
||||
The Accept function visible in Perl is now FCGI::accept. All
|
||||
lower case names for functions and all upper case names for
|
||||
modules appears to be a Perl convention, so we conform.
|
||||
|
||||
3. The kit now fully supports the Responder, Authorizer,
|
||||
and Filter roles.
|
||||
|
||||
The Filter role required a new function, FCGI_StartFilterData.
|
||||
FCGI_StartFilterData changes the input stream from reading
|
||||
FCGI_STDIN data to reading FCGI_DATA data. The manpage
|
||||
gives full details.
|
||||
|
||||
Another new function, FCGI_SetExitStatus, is primarily for
|
||||
the Responder role but is available to all. FCGI_SetExitStatus
|
||||
allows an application to set a nonzero "exit" status
|
||||
before completing a request and calling FCGI_Accept again.
|
||||
The manpage gives full details.
|
||||
|
||||
These two new functions are provided at both the fcgi_stdio interface
|
||||
and the basic fcgiapp interface. Naturally, the fcgiapp versions are
|
||||
called FCGX_StartFilterData and FCGX_SetExitStatus.
|
||||
|
||||
4. The fcgiapp interface changed slightly in order to treat
|
||||
the streams and environment data more symmetrically.
|
||||
|
||||
FCGX_Accept now returns an environment pointer, rather than requiring
|
||||
a call to FCGX_GetAllParams to retrieve an environment pointer.
|
||||
FCGX_GetParam takes an explicit environment pointer argument.
|
||||
FCGX_GetAllParams is eliminated. See the documentation in the header
|
||||
file for complete information.
|
||||
|
||||
fcgiapp also added the procedure FCGX_IsCGI, providing a standardized
|
||||
test of whether the app was started as CGI or FastCGI.
|
||||
|
||||
5. We've ported the kits to vendor-supported ANSI C compilers
|
||||
on Sun (Solaris 2.X), HP, and Digital platforms. GCC can be
|
||||
selected on these platforms by performing SETENV CC gcc before
|
||||
running configure.
|
||||
|
||||
|
||||
|
||||
What's New: Version 1.1, 30 Jan 1996
|
||||
------------------------------------
|
||||
|
||||
1. More platforms: Digital UNIX, IBM AIX, Silicon Graphics IRIX,
|
||||
Sun SunOS 4.1.4.
|
||||
|
||||
2. Perl and Tcl: Simple recipes for producing Perl and Tcl
|
||||
interpreters that run as FastCGI applications. No source
|
||||
code changes are needed to Perl and Tcl. Documented
|
||||
in separate documents, accessible via the index page.
|
||||
|
||||
|
||||
|
||||
Version 1.0, 10 Jan 1996
|
||||
------------------------
|
||||
83
library/server/libfcgi/Clib/libfcgi/doc/README.win64
Normal file
83
library/server/libfcgi/Clib/libfcgi/doc/README.win64
Normal file
@@ -0,0 +1,83 @@
|
||||
ChangeLog from 2.4.0 to 2.4.0-x64:
|
||||
|
||||
* Fixed to support 64bit build of library and sample executables for Windows.
|
||||
* Fixed socklen_t detection failure problem in configure script for Linux.
|
||||
|
||||
|
||||
What we've done to support 64bit build:
|
||||
|
||||
* Converted Win32/*.{dsw,dsp} files to Win32/*.{sln,vcproj} files
|
||||
(Visual Studio 2008 solution/project files).
|
||||
* Added platform "x64" for Visual Studio solution.
|
||||
* Fixed type size problem (pointer, size_t, etc.)
|
||||
to support both 32/64 bit build
|
||||
using intptr_t, uintptr_t, and so on.
|
||||
* Fixed to check range of each numeric variable with ASSERT()
|
||||
before using type cast for demotion(narrowing).
|
||||
* Replaced several standard functions to recommended ones.
|
||||
getpid() --> _getpid(), and so on.
|
||||
* Fixed several functions to support both 32/64 bit build.
|
||||
AlignInt8(), AlignPtr8(), and so on.
|
||||
* Removed almost all build warnings on Visual Studio 2008.
|
||||
with PreprocessorDefinitions:
|
||||
_SCL_SECURE_NO_WARNINGS and _CRT_SECURE_NO_WARNINGS.
|
||||
* Removed almost all build warnings on Linux.
|
||||
|
||||
|
||||
Current status:
|
||||
|
||||
* Tested the patch on Windows Server 2008 SP1 (64bit).
|
||||
with apache httpd 2.2.10 (32bit) and mod_fastcgi-SNAP-0811090952.
|
||||
Both 32/64 bit sample executables are working.
|
||||
We could not build and test two samples: threaded and log-dump.
|
||||
* Tested the patch on CentOS 5.3 (64bit) with gcc-4.3.3.
|
||||
For 32bit build, we used gcc -m32 option.
|
||||
Both 32/64 bit sample executables are working except log-dump.
|
||||
We could not find out the usage of log-dump
|
||||
so that we could not test it.
|
||||
|
||||
|
||||
How to build:
|
||||
|
||||
1. For Windows
|
||||
|
||||
1-1. Extract fastcgi-2.4.0.tar.gz
|
||||
|
||||
> tar xzf fastcgi-2.4.0.tar.gz
|
||||
|
||||
1-2. Apply this fastcgi-2.4.0-x64.patch
|
||||
|
||||
> cd fastcgi-2.4.0
|
||||
> patch -p1 < ../fastcgi-2.4.0-x64.patch
|
||||
|
||||
1-3. Open fastcgi-2.4.0/Win32/FastCGI.sln with Visual Studio 2008 and build.
|
||||
|
||||
Debug and Release build on Win32 and x64 are supported.
|
||||
|
||||
Build with 'nmake' is not supported, since we could not find out
|
||||
suitable project converter and we can use 'devenv' command line instead.
|
||||
|
||||
|
||||
2. For Linux
|
||||
|
||||
2-1. Do the same process as (1-1).
|
||||
2-2. Do the same process as (1-2).
|
||||
|
||||
2-3. Remake configure script.
|
||||
|
||||
> libtoolize -c -f
|
||||
> aclocal
|
||||
> autoheader
|
||||
> automake -a -c -f
|
||||
> autoconf
|
||||
|
||||
2-4. Configure and make
|
||||
|
||||
> ./configure
|
||||
> make
|
||||
> make install
|
||||
|
||||
If you need, NDEBUG preprocessor definition should be specified
|
||||
to eliminate ASSERT check for release build.
|
||||
|
||||
|
||||
5747
library/server/libfcgi/Clib/libfcgi/doc/fcgi-2.4.0-x64.patch
Normal file
5747
library/server/libfcgi/Clib/libfcgi/doc/fcgi-2.4.0-x64.patch
Normal file
File diff suppressed because it is too large
Load Diff
112
library/server/libfcgi/Clib/libfcgi/fcgi_config.h
Normal file
112
library/server/libfcgi/Clib/libfcgi/fcgi_config.h
Normal file
@@ -0,0 +1,112 @@
|
||||
/* fcgi_config.h. Generated automatically by configure. */
|
||||
/* fcgi_config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define if there's a fileno() prototype in stdio.h */
|
||||
#define HAVE_FILENO_PROTO 1
|
||||
|
||||
/* Define if the fpos_t typedef is in stdio.h */
|
||||
#define HAVE_FPOS 1
|
||||
|
||||
/* Define if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define if cin/cout/cerr has a streambuf assignment operator */
|
||||
/* #undef HAVE_IOSTREAM_WITHASSIGN_STREAMBUF */
|
||||
|
||||
/* Define if you have the `nsl' library (-lnsl). */
|
||||
#define HAVE_LIBNSL 1
|
||||
|
||||
/* Define if you have the `socket' library (-lsocket). */
|
||||
#define HAVE_LIBSOCKET 1
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define if you have the <netdb.h> header file. */
|
||||
#define HAVE_NETDB_H 1
|
||||
|
||||
/* Define if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define if you have POSIX threads libraries and header files. */
|
||||
/* #undef HAVE_PTHREAD */
|
||||
|
||||
/* Define if sockaddr_un in sys/un.h contains a sun_len component */
|
||||
/* #undef HAVE_SOCKADDR_UN_SUN_LEN */
|
||||
|
||||
/* Define if the socklen_t typedef is in sys/socket.h */
|
||||
/* #undef HAVE_SOCKLEN */
|
||||
|
||||
/* Define if you have the <stdint.h> header file. */
|
||||
/* #undef HAVE_STDINT_H */
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define if char_type is defined in the context of streambuf */
|
||||
#define HAVE_STREAMBUF_CHAR_TYPE 1
|
||||
|
||||
/* Define if you have the `strerror' function. */
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
|
||||
/* Define if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define if va_arg(arg, long double) crashes the compiler */
|
||||
/* #undef HAVE_VA_ARG_LONG_DOUBLE_BUG */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "fcgi"
|
||||
|
||||
/* Define to the necessary symbol if this constant uses a non-standard name on
|
||||
your system. */
|
||||
/* #undef PTHREAD_CREATE_JOINABLE */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if cross-process locking is required by accept() */
|
||||
#define USE_LOCKING 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "2.4.0"
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
|
||||
if it is not supported. */
|
||||
/* #undef inline */
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
/* #undef ssize_t */
|
||||
8
library/server/libfcgi/Clib/libfcgi/include/Makefile.am
Normal file
8
library/server/libfcgi/Clib/libfcgi/include/Makefile.am
Normal file
@@ -0,0 +1,8 @@
|
||||
# $Id: Makefile.am,v 1.2 2001/09/24 18:03:05 skimo Exp $
|
||||
include_HEADERS = \
|
||||
fastcgi.h \
|
||||
fcgi_stdio.h \
|
||||
fcgiapp.h \
|
||||
fcgimisc.h \
|
||||
fcgio.h \
|
||||
fcgios.h
|
||||
279
library/server/libfcgi/Clib/libfcgi/include/Makefile.in
Normal file
279
library/server/libfcgi/Clib/libfcgi/include/Makefile.in
Normal file
@@ -0,0 +1,279 @@
|
||||
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# $Id: Makefile.am,v 1.2 2001/09/24 18:03:05 skimo Exp $
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = @program_transform_name@
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AMTAR = @AMTAR@
|
||||
AS = @AS@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
CXX = @CXX@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_CPP = @ECHO_CPP@
|
||||
EXEEXT = @EXEEXT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LIBFCGIXX = @LIBFCGIXX@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PTHREAD_CC = @PTHREAD_CC@
|
||||
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
|
||||
PTHREAD_LIBS = @PTHREAD_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
SYSTEM = @SYSTEM@
|
||||
THREADED = @THREADED@
|
||||
VERSION = @VERSION@
|
||||
am__include = @am__include@
|
||||
am__quote = @am__quote@
|
||||
install_sh = @install_sh@
|
||||
|
||||
include_HEADERS = \
|
||||
fastcgi.h \
|
||||
fcgi_stdio.h \
|
||||
fcgiapp.h \
|
||||
fcgimisc.h \
|
||||
fcgio.h \
|
||||
fcgios.h
|
||||
|
||||
subdir = include
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/fcgi_config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_SOURCES =
|
||||
HEADERS = $(include_HEADERS)
|
||||
|
||||
DIST_COMMON = $(include_HEADERS) Makefile.am Makefile.in
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign include/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && \
|
||||
CONFIG_HEADERS= CONFIG_LINKS= \
|
||||
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
|
||||
uninstall-info-am:
|
||||
install-includeHEADERS: $(include_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(includedir)
|
||||
@list='$(include_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " $(INSTALL_HEADER) $$d$$p $(DESTDIR)$(includedir)/$$f"; \
|
||||
$(INSTALL_HEADER) $$d$$p $(DESTDIR)$(includedir)/$$f; \
|
||||
done
|
||||
|
||||
uninstall-includeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(include_HEADERS)'; for p in $$list; do \
|
||||
f="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " rm -f $(DESTDIR)$(includedir)/$$f"; \
|
||||
rm -f $(DESTDIR)$(includedir)/$$f; \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
|
||||
|
||||
GTAGS:
|
||||
here=`CDPATH=: && cd $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = ..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
$(mkinstalldirs) "$(distdir)/$$dir"; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pR $$d/$$file $(distdir) \
|
||||
|| exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(HEADERS)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(includedir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
distclean-am: clean-am distclean-generic distclean-libtool \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-includeHEADERS
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
uninstall-am: uninstall-includeHEADERS uninstall-info-am
|
||||
|
||||
.PHONY: GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool distclean distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am info info-am install \
|
||||
install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-includeHEADERS install-info \
|
||||
install-info-am install-man install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool tags uninstall uninstall-am \
|
||||
uninstall-includeHEADERS uninstall-info-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
136
library/server/libfcgi/Clib/libfcgi/include/fastcgi.h
Normal file
136
library/server/libfcgi/Clib/libfcgi/include/fastcgi.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* fastcgi.h --
|
||||
*
|
||||
* Defines for the FastCGI protocol.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1995-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.
|
||||
*
|
||||
* $Id: fastcgi.h,v 1.1.1.1 1997/09/16 15:36:32 stanleyg Exp $
|
||||
*/
|
||||
|
||||
#ifndef _FASTCGI_H
|
||||
#define _FASTCGI_H
|
||||
|
||||
/*
|
||||
* Listening socket file number
|
||||
*/
|
||||
#define FCGI_LISTENSOCK_FILENO 0
|
||||
|
||||
typedef struct {
|
||||
unsigned char version;
|
||||
unsigned char type;
|
||||
unsigned char requestIdB1;
|
||||
unsigned char requestIdB0;
|
||||
unsigned char contentLengthB1;
|
||||
unsigned char contentLengthB0;
|
||||
unsigned char paddingLength;
|
||||
unsigned char reserved;
|
||||
} FCGI_Header;
|
||||
|
||||
#define FCGI_MAX_LENGTH 0xffff
|
||||
|
||||
/*
|
||||
* Number of bytes in a FCGI_Header. Future versions of the protocol
|
||||
* will not reduce this number.
|
||||
*/
|
||||
#define FCGI_HEADER_LEN 8
|
||||
|
||||
/*
|
||||
* Value for version component of FCGI_Header
|
||||
*/
|
||||
#define FCGI_VERSION_1 1
|
||||
|
||||
/*
|
||||
* Values for type component of FCGI_Header
|
||||
*/
|
||||
#define FCGI_BEGIN_REQUEST 1
|
||||
#define FCGI_ABORT_REQUEST 2
|
||||
#define FCGI_END_REQUEST 3
|
||||
#define FCGI_PARAMS 4
|
||||
#define FCGI_STDIN 5
|
||||
#define FCGI_STDOUT 6
|
||||
#define FCGI_STDERR 7
|
||||
#define FCGI_DATA 8
|
||||
#define FCGI_GET_VALUES 9
|
||||
#define FCGI_GET_VALUES_RESULT 10
|
||||
#define FCGI_UNKNOWN_TYPE 11
|
||||
#define FCGI_MAXTYPE (FCGI_UNKNOWN_TYPE)
|
||||
|
||||
/*
|
||||
* Value for requestId component of FCGI_Header
|
||||
*/
|
||||
#define FCGI_NULL_REQUEST_ID 0
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned char roleB1;
|
||||
unsigned char roleB0;
|
||||
unsigned char flags;
|
||||
unsigned char reserved[5];
|
||||
} FCGI_BeginRequestBody;
|
||||
|
||||
typedef struct {
|
||||
FCGI_Header header;
|
||||
FCGI_BeginRequestBody body;
|
||||
} FCGI_BeginRequestRecord;
|
||||
|
||||
/*
|
||||
* Mask for flags component of FCGI_BeginRequestBody
|
||||
*/
|
||||
#define FCGI_KEEP_CONN 1
|
||||
|
||||
/*
|
||||
* Values for role component of FCGI_BeginRequestBody
|
||||
*/
|
||||
#define FCGI_RESPONDER 1
|
||||
#define FCGI_AUTHORIZER 2
|
||||
#define FCGI_FILTER 3
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned char appStatusB3;
|
||||
unsigned char appStatusB2;
|
||||
unsigned char appStatusB1;
|
||||
unsigned char appStatusB0;
|
||||
unsigned char protocolStatus;
|
||||
unsigned char reserved[3];
|
||||
} FCGI_EndRequestBody;
|
||||
|
||||
typedef struct {
|
||||
FCGI_Header header;
|
||||
FCGI_EndRequestBody body;
|
||||
} FCGI_EndRequestRecord;
|
||||
|
||||
/*
|
||||
* Values for protocolStatus component of FCGI_EndRequestBody
|
||||
*/
|
||||
#define FCGI_REQUEST_COMPLETE 0
|
||||
#define FCGI_CANT_MPX_CONN 1
|
||||
#define FCGI_OVERLOADED 2
|
||||
#define FCGI_UNKNOWN_ROLE 3
|
||||
|
||||
|
||||
/*
|
||||
* Variable names for FCGI_GET_VALUES / FCGI_GET_VALUES_RESULT records
|
||||
*/
|
||||
#define FCGI_MAX_CONNS "FCGI_MAX_CONNS"
|
||||
#define FCGI_MAX_REQS "FCGI_MAX_REQS"
|
||||
#define FCGI_MPXS_CONNS "FCGI_MPXS_CONNS"
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned char type;
|
||||
unsigned char reserved[7];
|
||||
} FCGI_UnknownTypeBody;
|
||||
|
||||
typedef struct {
|
||||
FCGI_Header header;
|
||||
FCGI_UnknownTypeBody body;
|
||||
} FCGI_UnknownTypeRecord;
|
||||
|
||||
#endif /* _FASTCGI_H */
|
||||
|
||||
39
library/server/libfcgi/Clib/libfcgi/include/fcgi_config.h
Normal file
39
library/server/libfcgi/Clib/libfcgi/include/fcgi_config.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copied to fcgi_config.h when building on WinNT without cygwin,
|
||||
* i.e. configure is not run. See fcgi_config.h.in for details.
|
||||
*/
|
||||
|
||||
#define HAVE_FPOS 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_STREAMBUF_CHAR_TYPE 1
|
||||
#define HAVE_STRERROR 1
|
||||
#undef HAVE_ARPA_INET_H
|
||||
#undef HAVE_DLFCN_H
|
||||
#undef HAVE_FILENO_PROTO
|
||||
#undef HAVE_INTTYPES_H
|
||||
#undef HAVE_IOSTREAM_WITHASSIGN_STREAMBUF
|
||||
#undef HAVE_LIBNSL
|
||||
#undef HAVE_LIBSOCKET
|
||||
#undef HAVE_MEMORY_H
|
||||
#undef HAVE_NETDB_H
|
||||
#undef HAVE_NETINET_IN_H
|
||||
#undef HAVE_PTHREAD
|
||||
#undef HAVE_SOCKADDR_UN_SUN_LEN
|
||||
#undef HAVE_SOCKLEN
|
||||
#undef HAVE_STDINT_H
|
||||
#undef HAVE_STDLIB_H
|
||||
#undef HAVE_STRING_H
|
||||
#undef HAVE_STRINGS_H
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
#undef HAVE_SYS_SOCKET_H
|
||||
#undef HAVE_SYS_STAT_H
|
||||
#undef HAVE_SYS_TIME_H
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
#undef HAVE_UNISTD_H
|
||||
#undef HAVE_VA_ARG_LONG_DOUBLE_BUG
|
||||
#undef PTHREAD_CREATE_JOINABLE
|
||||
#undef STDC_HEADERS
|
||||
#undef USE_LOCKING
|
||||
#undef const
|
||||
#undef inline
|
||||
#undef ssize_t
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copied to fcgi_config.h when building on WinNT without cygwin,
|
||||
* i.e. configure is not run. See fcgi_config.h.in for details.
|
||||
*/
|
||||
|
||||
#define HAVE_FPOS 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_STREAMBUF_CHAR_TYPE 1
|
||||
#define HAVE_STRERROR 1
|
||||
#undef HAVE_ARPA_INET_H
|
||||
#undef HAVE_DLFCN_H
|
||||
#undef HAVE_FILENO_PROTO
|
||||
#undef HAVE_INTTYPES_H
|
||||
#undef HAVE_IOSTREAM_WITHASSIGN_STREAMBUF
|
||||
#undef HAVE_LIBNSL
|
||||
#undef HAVE_LIBSOCKET
|
||||
#undef HAVE_MEMORY_H
|
||||
#undef HAVE_NETDB_H
|
||||
#undef HAVE_NETINET_IN_H
|
||||
#undef HAVE_PTHREAD
|
||||
#undef HAVE_SOCKADDR_UN_SUN_LEN
|
||||
#undef HAVE_SOCKLEN
|
||||
#undef HAVE_STDINT_H
|
||||
#undef HAVE_STDLIB_H
|
||||
#undef HAVE_STRING_H
|
||||
#undef HAVE_STRINGS_H
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
#undef HAVE_SYS_SOCKET_H
|
||||
#undef HAVE_SYS_STAT_H
|
||||
#undef HAVE_SYS_TIME_H
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
#undef HAVE_UNISTD_H
|
||||
#undef HAVE_VA_ARG_LONG_DOUBLE_BUG
|
||||
#undef PTHREAD_CREATE_JOINABLE
|
||||
#undef STDC_HEADERS
|
||||
#undef USE_LOCKING
|
||||
#undef const
|
||||
#undef inline
|
||||
#undef ssize_t
|
||||
246
library/server/libfcgi/Clib/libfcgi/include/fcgi_stdio.h
Normal file
246
library/server/libfcgi/Clib/libfcgi/include/fcgi_stdio.h
Normal file
@@ -0,0 +1,246 @@
|
||||
/*
|
||||
* fcgi_stdio.h --
|
||||
*
|
||||
* FastCGI-stdio compatibility package
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* $Id: fcgi_stdio.h,v 1.5 2001/06/22 13:21:15 robs Exp $
|
||||
*/
|
||||
|
||||
#ifndef _FCGI_STDIO
|
||||
#define _FCGI_STDIO 1
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include "fcgiapp.h"
|
||||
|
||||
#if defined (c_plusplus) || defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef DLLAPI
|
||||
#ifdef _WIN32
|
||||
#define DLLAPI __declspec(dllimport)
|
||||
#else
|
||||
#define DLLAPI
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Wrapper type for FILE
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
FILE *stdio_stream;
|
||||
FCGX_Stream *fcgx_stream;
|
||||
} FCGI_FILE;
|
||||
|
||||
/*
|
||||
* The four new functions and two new macros
|
||||
*/
|
||||
|
||||
DLLAPI int FCGI_Accept(void);
|
||||
DLLAPI char** FCGI_Environ(void);
|
||||
DLLAPI void FCGI_Finish(void);
|
||||
DLLAPI int FCGI_StartFilterData(void);
|
||||
DLLAPI void FCGI_SetExitStatus(int status);
|
||||
|
||||
#define FCGI_ToFILE(fcgi_file) (fcgi_file->stdio_stream)
|
||||
#define FCGI_ToFcgiStream(fcgi_file) (fcgi_file->fcgx_stream)
|
||||
|
||||
/*
|
||||
* Wrapper stdin, stdout, and stderr variables, set up by FCGI_Accept()
|
||||
*/
|
||||
|
||||
DLLAPI extern FCGI_FILE _fcgi_sF[];
|
||||
#define FCGI_stdin (&_fcgi_sF[0])
|
||||
#define FCGI_stdout (&_fcgi_sF[1])
|
||||
#define FCGI_stderr (&_fcgi_sF[2])
|
||||
|
||||
/*
|
||||
* Wrapper function prototypes, grouped according to sections
|
||||
* of Harbison & Steele, "C: A Reference Manual," fourth edition,
|
||||
* Prentice-Hall, 1995.
|
||||
*/
|
||||
|
||||
DLLAPI void FCGI_perror(const char *str);
|
||||
|
||||
DLLAPI FCGI_FILE *FCGI_fopen(const char *path, const char *mode);
|
||||
DLLAPI int FCGI_fclose(FCGI_FILE *fp);
|
||||
DLLAPI int FCGI_fflush(FCGI_FILE *fp);
|
||||
DLLAPI FCGI_FILE *FCGI_freopen(const char *path, const char *mode, FCGI_FILE *fp);
|
||||
|
||||
DLLAPI int FCGI_setvbuf(FCGI_FILE *fp, char *buf, int bufmode, size_t size);
|
||||
DLLAPI void FCGI_setbuf(FCGI_FILE *fp, char *buf);
|
||||
|
||||
DLLAPI int FCGI_fseek(FCGI_FILE *fp, long offset, int whence);
|
||||
DLLAPI int FCGI_ftell(FCGI_FILE *fp);
|
||||
DLLAPI void FCGI_rewind(FCGI_FILE *fp);
|
||||
#ifdef HAVE_FPOS
|
||||
DLLAPI int FCGI_fgetpos(FCGI_FILE *fp, fpos_t *pos);
|
||||
DLLAPI int FCGI_fsetpos(FCGI_FILE *fp, const fpos_t *pos);
|
||||
#endif
|
||||
DLLAPI int FCGI_fgetc(FCGI_FILE *fp);
|
||||
DLLAPI int FCGI_getchar(void);
|
||||
DLLAPI int FCGI_ungetc(int c, FCGI_FILE *fp);
|
||||
|
||||
DLLAPI char *FCGI_fgets(char *str, int size, FCGI_FILE *fp);
|
||||
DLLAPI char *FCGI_gets(char *str);
|
||||
|
||||
/*
|
||||
* Not yet implemented
|
||||
*
|
||||
* int FCGI_fscanf(FCGI_FILE *fp, const char *format, ...);
|
||||
* int FCGI_scanf(const char *format, ...);
|
||||
*
|
||||
*/
|
||||
|
||||
DLLAPI int FCGI_fputc(int c, FCGI_FILE *fp);
|
||||
DLLAPI int FCGI_putchar(int c);
|
||||
|
||||
DLLAPI int FCGI_fputs(const char *str, FCGI_FILE *fp);
|
||||
DLLAPI int FCGI_puts(const char *str);
|
||||
|
||||
DLLAPI int FCGI_fprintf(FCGI_FILE *fp, const char *format, ...);
|
||||
DLLAPI int FCGI_printf(const char *format, ...);
|
||||
|
||||
DLLAPI int FCGI_vfprintf(FCGI_FILE *fp, const char *format, va_list ap);
|
||||
DLLAPI int FCGI_vprintf(const char *format, va_list ap);
|
||||
|
||||
DLLAPI size_t FCGI_fread(void *ptr, size_t size, size_t nmemb, FCGI_FILE *fp);
|
||||
DLLAPI size_t FCGI_fwrite(void *ptr, size_t size, size_t nmemb, FCGI_FILE *fp);
|
||||
|
||||
DLLAPI int FCGI_feof(FCGI_FILE *fp);
|
||||
DLLAPI int FCGI_ferror(FCGI_FILE *fp);
|
||||
DLLAPI void FCGI_clearerr(FCGI_FILE *fp);
|
||||
|
||||
DLLAPI FCGI_FILE *FCGI_tmpfile(void);
|
||||
|
||||
DLLAPI int FCGI_fileno(FCGI_FILE *fp);
|
||||
DLLAPI FCGI_FILE *FCGI_fdopen(int fd, const char *mode);
|
||||
DLLAPI FCGI_FILE *FCGI_popen(const char *cmd, const char *type);
|
||||
DLLAPI int FCGI_pclose(FCGI_FILE *);
|
||||
|
||||
/*
|
||||
* The remaining definitions are for application programs,
|
||||
* not for fcgi_stdio.c
|
||||
*/
|
||||
|
||||
#ifndef NO_FCGI_DEFINES
|
||||
|
||||
/*
|
||||
* Replace standard types, variables, and functions with FastCGI wrappers.
|
||||
* Use undef in case a macro is already defined.
|
||||
*/
|
||||
|
||||
#undef FILE
|
||||
#define FILE FCGI_FILE
|
||||
|
||||
#undef stdin
|
||||
#define stdin FCGI_stdin
|
||||
#undef stdout
|
||||
#define stdout FCGI_stdout
|
||||
#undef stderr
|
||||
#define stderr FCGI_stderr
|
||||
|
||||
#undef perror
|
||||
#define perror FCGI_perror
|
||||
|
||||
#undef fopen
|
||||
#define fopen FCGI_fopen
|
||||
#undef fclose
|
||||
#define fclose FCGI_fclose
|
||||
#undef fflush
|
||||
#define fflush FCGI_fflush
|
||||
#undef freopen
|
||||
#define freopen FCGI_freopen
|
||||
|
||||
#undef setvbuf
|
||||
#define setvbuf FCGI_setvbuf
|
||||
#undef setbuf
|
||||
#define setbuf FCGI_setbuf
|
||||
|
||||
#undef fseek
|
||||
#define fseek FCGI_fseek
|
||||
#undef ftell
|
||||
#define ftell FCGI_ftell
|
||||
#undef rewind
|
||||
#define rewind FCGI_rewind
|
||||
#undef fgetpos
|
||||
#define fgetpos FCGI_fgetpos
|
||||
#undef fsetpos
|
||||
#define fsetpos FCGI_fsetpos
|
||||
|
||||
#undef fgetc
|
||||
#define fgetc FCGI_fgetc
|
||||
#undef getc
|
||||
#define getc FCGI_fgetc
|
||||
#undef getchar
|
||||
#define getchar FCGI_getchar
|
||||
#undef ungetc
|
||||
#define ungetc FCGI_ungetc
|
||||
|
||||
#undef fgets
|
||||
#define fgets FCGI_fgets
|
||||
#undef gets
|
||||
#define gets FCGI_gets
|
||||
|
||||
#undef fputc
|
||||
#define fputc FCGI_fputc
|
||||
#undef putc
|
||||
#define putc FCGI_fputc
|
||||
#undef putchar
|
||||
#define putchar FCGI_putchar
|
||||
|
||||
#undef fputs
|
||||
#define fputs FCGI_fputs
|
||||
#undef puts
|
||||
#define puts FCGI_puts
|
||||
|
||||
#undef fprintf
|
||||
#define fprintf FCGI_fprintf
|
||||
#undef printf
|
||||
#define printf FCGI_printf
|
||||
|
||||
#undef vfprintf
|
||||
#define vfprintf FCGI_vfprintf
|
||||
#undef vprintf
|
||||
#define vprintf FCGI_vprintf
|
||||
|
||||
#undef fread
|
||||
#define fread FCGI_fread
|
||||
#undef fwrite
|
||||
#define fwrite FCGI_fwrite
|
||||
|
||||
#undef feof
|
||||
#define feof FCGI_feof
|
||||
#undef ferror
|
||||
#define ferror FCGI_ferror
|
||||
#undef clearerr
|
||||
#define clearerr FCGI_clearerr
|
||||
|
||||
#undef tmpfile
|
||||
#define tmpfile FCGI_tmpfile
|
||||
|
||||
#undef fileno
|
||||
#define fileno FCGI_fileno
|
||||
#undef fdopen
|
||||
#define fdopen FCGI_fdopen
|
||||
#undef popen
|
||||
#define popen FCGI_popen
|
||||
#undef pclose
|
||||
#define pclose FCGI_pclose
|
||||
|
||||
#endif /* NO_FCGI_DEFINES */
|
||||
|
||||
#if defined (__cplusplus) || defined (c_plusplus)
|
||||
} /* terminate extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* _FCGI_STDIO */
|
||||
|
||||
622
library/server/libfcgi/Clib/libfcgi/include/fcgiapp.h
Normal file
622
library/server/libfcgi/Clib/libfcgi/include/fcgiapp.h
Normal file
@@ -0,0 +1,622 @@
|
||||
/*
|
||||
* fcgiapp.h --
|
||||
*
|
||||
* Definitions for FastCGI application server programs
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* $Id: fcgiapp.h,v 1.12 2001/11/21 21:10:11 robs Exp $
|
||||
*/
|
||||
|
||||
#ifndef _FCGIAPP_H
|
||||
#define _FCGIAPP_H
|
||||
|
||||
/* Hack to see if we are building TCL - TCL needs varargs not stdarg */
|
||||
#ifndef TCL_LIBRARY
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
|
||||
#ifndef DLLAPI
|
||||
#ifdef _WIN32
|
||||
#define DLLAPI __declspec(dllimport)
|
||||
#else
|
||||
#define DLLAPI
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (c_plusplus) || defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Error codes. Assigned to avoid conflict with EOF and errno(2).
|
||||
*/
|
||||
#define FCGX_UNSUPPORTED_VERSION -2
|
||||
#define FCGX_PROTOCOL_ERROR -3
|
||||
#define FCGX_PARAMS_ERROR -4
|
||||
#define FCGX_CALL_SEQ_ERROR -5
|
||||
|
||||
/*
|
||||
* This structure defines the state of a FastCGI stream.
|
||||
* Streams are modeled after the FILE type defined in stdio.h.
|
||||
* (We wouldn't need our own if platform vendors provided a
|
||||
* standard way to subclass theirs.)
|
||||
* The state of a stream is private and should only be accessed
|
||||
* by the procedures defined below.
|
||||
*/
|
||||
typedef struct FCGX_Stream {
|
||||
unsigned char *rdNext; /* reader: first valid byte
|
||||
* writer: equals stop */
|
||||
unsigned char *wrNext; /* writer: first free byte
|
||||
* reader: equals stop */
|
||||
unsigned char *stop; /* reader: last valid byte + 1
|
||||
* writer: last free byte + 1 */
|
||||
unsigned char *stopUnget; /* reader: first byte of current buffer
|
||||
* fragment, for ungetc
|
||||
* writer: undefined */
|
||||
int isReader;
|
||||
int isClosed;
|
||||
int wasFCloseCalled;
|
||||
int FCGI_errno; /* error status */
|
||||
void (*fillBuffProc) (struct FCGX_Stream *stream);
|
||||
void (*emptyBuffProc) (struct FCGX_Stream *stream, int doClose);
|
||||
void *data;
|
||||
} FCGX_Stream;
|
||||
|
||||
/*
|
||||
* An environment (as defined by environ(7)): A NULL-terminated array
|
||||
* of strings, each string having the form name=value.
|
||||
*/
|
||||
typedef char **FCGX_ParamArray;
|
||||
|
||||
/*
|
||||
* FCGX_Request Flags
|
||||
*
|
||||
* Setting FCGI_FAIL_ACCEPT_ON_INTR prevents FCGX_Accept() from
|
||||
* restarting upon being interrupted.
|
||||
*/
|
||||
#define FCGI_FAIL_ACCEPT_ON_INTR 1
|
||||
|
||||
/*
|
||||
* FCGX_Request -- State associated with a request.
|
||||
*
|
||||
* Its exposed for API simplicity, I expect parts of it to change!
|
||||
*/
|
||||
typedef struct FCGX_Request {
|
||||
int requestId; /* valid if isBeginProcessed */
|
||||
int role;
|
||||
FCGX_Stream *in;
|
||||
FCGX_Stream *out;
|
||||
FCGX_Stream *err;
|
||||
char **envp;
|
||||
|
||||
/* Don't use anything below here */
|
||||
|
||||
struct Params *paramsPtr;
|
||||
int ipcFd; /* < 0 means no connection */
|
||||
int isBeginProcessed; /* FCGI_BEGIN_REQUEST seen */
|
||||
int keepConnection; /* don't close ipcFd at end of request */
|
||||
int appStatus;
|
||||
int nWriters; /* number of open writers (0..2) */
|
||||
int flags;
|
||||
int listen_sock;
|
||||
} FCGX_Request;
|
||||
|
||||
|
||||
/*
|
||||
*======================================================================
|
||||
* Control
|
||||
*======================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_IsCGI --
|
||||
*
|
||||
* Returns TRUE iff this process appears to be a CGI process
|
||||
* rather than a FastCGI process.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_IsCGI(void);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_Init --
|
||||
*
|
||||
* Initialize the FCGX library. Call in multi-threaded apps
|
||||
* before calling FCGX_Accept_r().
|
||||
*
|
||||
* Returns 0 upon success.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_Init(void);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_OpenSocket --
|
||||
*
|
||||
* Create a FastCGI listen socket.
|
||||
*
|
||||
* path is the Unix domain socket (named pipe for WinNT), or a colon
|
||||
* followed by a port number. e.g. "/tmp/fastcgi/mysocket", ":5000"
|
||||
*
|
||||
* backlog is the listen queue depth used in the listen() call.
|
||||
*
|
||||
* Returns the socket's file descriptor or -1 on error.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_OpenSocket(const char *path, int backlog);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_InitRequest --
|
||||
*
|
||||
* Initialize a FCGX_Request for use with FCGX_Accept_r().
|
||||
*
|
||||
* sock is a file descriptor returned by FCGX_OpenSocket() or 0 (default).
|
||||
* The only supported flag at this time is FCGI_FAIL_ON_INTR.
|
||||
*
|
||||
* Returns 0 upon success.
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_InitRequest(FCGX_Request *request, int sock, int flags);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_Accept_r --
|
||||
*
|
||||
* Accept a new request (multi-thread safe). Be sure to call
|
||||
* FCGX_Init() first.
|
||||
*
|
||||
* Results:
|
||||
* 0 for successful call, -1 for error.
|
||||
*
|
||||
* Side effects:
|
||||
*
|
||||
* Finishes the request accepted by (and frees any
|
||||
* storage allocated by) the previous call to FCGX_Accept.
|
||||
* Creates input, output, and error streams and
|
||||
* assigns them to *in, *out, and *err respectively.
|
||||
* Creates a parameters data structure to be accessed
|
||||
* via getenv(3) (if assigned to environ) or by FCGX_GetParam
|
||||
* and assigns it to *envp.
|
||||
*
|
||||
* DO NOT retain pointers to the envp array or any strings
|
||||
* contained in it (e.g. to the result of calling FCGX_GetParam),
|
||||
* since these will be freed by the next call to FCGX_Finish
|
||||
* or FCGX_Accept.
|
||||
*
|
||||
* DON'T use the FCGX_Request, its structure WILL change.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_Accept_r(FCGX_Request *request);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_Finish_r --
|
||||
*
|
||||
* Finish the request (multi-thread safe).
|
||||
*
|
||||
* Side effects:
|
||||
*
|
||||
* Finishes the request accepted by (and frees any
|
||||
* storage allocated by) the previous call to FCGX_Accept.
|
||||
*
|
||||
* DO NOT retain pointers to the envp array or any strings
|
||||
* contained in it (e.g. to the result of calling FCGX_GetParam),
|
||||
* since these will be freed by the next call to FCGX_Finish
|
||||
* or FCGX_Accept.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI void FCGX_Finish_r(FCGX_Request *request);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_Free --
|
||||
*
|
||||
* Free the memory and, if close is true,
|
||||
* IPC FD associated with the request (multi-thread safe).
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI void FCGX_Free(FCGX_Request * request, int close);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_Accept --
|
||||
*
|
||||
* Accept a new request (NOT multi-thread safe).
|
||||
*
|
||||
* Results:
|
||||
* 0 for successful call, -1 for error.
|
||||
*
|
||||
* Side effects:
|
||||
*
|
||||
* Finishes the request accepted by (and frees any
|
||||
* storage allocated by) the previous call to FCGX_Accept.
|
||||
* Creates input, output, and error streams and
|
||||
* assigns them to *in, *out, and *err respectively.
|
||||
* Creates a parameters data structure to be accessed
|
||||
* via getenv(3) (if assigned to environ) or by FCGX_GetParam
|
||||
* and assigns it to *envp.
|
||||
*
|
||||
* DO NOT retain pointers to the envp array or any strings
|
||||
* contained in it (e.g. to the result of calling FCGX_GetParam),
|
||||
* since these will be freed by the next call to FCGX_Finish
|
||||
* or FCGX_Accept.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_Accept(
|
||||
FCGX_Stream **in,
|
||||
FCGX_Stream **out,
|
||||
FCGX_Stream **err,
|
||||
FCGX_ParamArray *envp);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_Finish --
|
||||
*
|
||||
* Finish the current request (NOT multi-thread safe).
|
||||
*
|
||||
* Side effects:
|
||||
*
|
||||
* Finishes the request accepted by (and frees any
|
||||
* storage allocated by) the previous call to FCGX_Accept.
|
||||
*
|
||||
* DO NOT retain pointers to the envp array or any strings
|
||||
* contained in it (e.g. to the result of calling FCGX_GetParam),
|
||||
* since these will be freed by the next call to FCGX_Finish
|
||||
* or FCGX_Accept.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI void FCGX_Finish(void);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_StartFilterData --
|
||||
*
|
||||
* stream is an input stream for a FCGI_FILTER request.
|
||||
* stream is positioned at EOF on FCGI_STDIN.
|
||||
* Repositions stream to the start of FCGI_DATA.
|
||||
* If the preconditions are not met (e.g. FCGI_STDIN has not
|
||||
* been read to EOF) sets the stream error code to
|
||||
* FCGX_CALL_SEQ_ERROR.
|
||||
*
|
||||
* Results:
|
||||
* 0 for a normal return, < 0 for error
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_StartFilterData(FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_SetExitStatus --
|
||||
*
|
||||
* Sets the exit status for stream's request. The exit status
|
||||
* is the status code the request would have exited with, had
|
||||
* the request been run as a CGI program. You can call
|
||||
* SetExitStatus several times during a request; the last call
|
||||
* before the request ends determines the value.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI void FCGX_SetExitStatus(int status, FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*======================================================================
|
||||
* Parameters
|
||||
*======================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_GetParam -- obtain value of FCGI parameter in environment
|
||||
*
|
||||
*
|
||||
* Results:
|
||||
* Value bound to name, NULL if name not present in the
|
||||
* environment envp. Caller must not mutate the result
|
||||
* or retain it past the end of this request.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI char *FCGX_GetParam(const char *name, FCGX_ParamArray envp);
|
||||
|
||||
/*
|
||||
*======================================================================
|
||||
* Readers
|
||||
*======================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_GetChar --
|
||||
*
|
||||
* Reads a byte from the input stream and returns it.
|
||||
*
|
||||
* Results:
|
||||
* The byte, or EOF (-1) if the end of input has been reached.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_GetChar(FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_UnGetChar --
|
||||
*
|
||||
* Pushes back the character c onto the input stream. One
|
||||
* character of pushback is guaranteed once a character
|
||||
* has been read. No pushback is possible for EOF.
|
||||
*
|
||||
* Results:
|
||||
* Returns c if the pushback succeeded, EOF if not.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_UnGetChar(int c, FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_GetStr --
|
||||
*
|
||||
* Reads up to n consecutive bytes from the input stream
|
||||
* into the character array str. Performs no interpretation
|
||||
* of the input bytes.
|
||||
*
|
||||
* Results:
|
||||
* Number of bytes read. If result is smaller than n,
|
||||
* the end of input has been reached.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_GetStr(char *str, int n, FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_GetLine --
|
||||
*
|
||||
* Reads up to n-1 consecutive bytes from the input stream
|
||||
* into the character array str. Stops before n-1 bytes
|
||||
* have been read if '\n' or EOF is read. The terminating '\n'
|
||||
* is copied to str. After copying the last byte into str,
|
||||
* stores a '\0' terminator.
|
||||
*
|
||||
* Results:
|
||||
* NULL if EOF is the first thing read from the input stream,
|
||||
* str otherwise.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI char *FCGX_GetLine(char *str, int n, FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_HasSeenEOF --
|
||||
*
|
||||
* Returns EOF if end-of-file has been detected while reading
|
||||
* from stream; otherwise returns 0.
|
||||
*
|
||||
* Note that FCGX_HasSeenEOF(s) may return 0, yet an immediately
|
||||
* following FCGX_GetChar(s) may return EOF. This function, like
|
||||
* the standard C stdio function feof, does not provide the
|
||||
* ability to peek ahead.
|
||||
*
|
||||
* Results:
|
||||
* EOF if end-of-file has been detected, 0 if not.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
DLLAPI int FCGX_HasSeenEOF(FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*======================================================================
|
||||
* Writers
|
||||
*======================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_PutChar --
|
||||
*
|
||||
* Writes a byte to the output stream.
|
||||
*
|
||||
* Results:
|
||||
* The byte, or EOF (-1) if an error occurred.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_PutChar(int c, FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_PutStr --
|
||||
*
|
||||
* Writes n consecutive bytes from the character array str
|
||||
* into the output stream. Performs no interpretation
|
||||
* of the output bytes.
|
||||
*
|
||||
* Results:
|
||||
* Number of bytes written (n) for normal return,
|
||||
* EOF (-1) if an error occurred.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_PutStr(const char *str, int n, FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_PutS --
|
||||
*
|
||||
* Writes a null-terminated character string to the output stream.
|
||||
*
|
||||
* Results:
|
||||
* number of bytes written for normal return,
|
||||
* EOF (-1) if an error occurred.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_PutS(const char *str, FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_FPrintF, FCGX_VFPrintF --
|
||||
*
|
||||
* Performs printf-style output formatting and writes the results
|
||||
* to the output stream.
|
||||
*
|
||||
* Results:
|
||||
* number of bytes written for normal return,
|
||||
* EOF (-1) if an error occurred.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_FPrintF(FCGX_Stream *stream, const char *format, ...);
|
||||
|
||||
DLLAPI int FCGX_VFPrintF(FCGX_Stream *stream, const char *format, va_list arg);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_FFlush --
|
||||
*
|
||||
* Flushes any buffered output.
|
||||
*
|
||||
* Server-push is a legitimate application of FCGX_FFlush.
|
||||
* Otherwise, FCGX_FFlush is not very useful, since FCGX_Accept
|
||||
* does it implicitly. Calling FCGX_FFlush in non-push applications
|
||||
* results in extra writes and therefore reduces performance.
|
||||
*
|
||||
* Results:
|
||||
* EOF (-1) if an error occurred.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_FFlush(FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*======================================================================
|
||||
* Both Readers and Writers
|
||||
*======================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_FClose --
|
||||
*
|
||||
* Closes the stream. For writers, flushes any buffered
|
||||
* output.
|
||||
*
|
||||
* Close is not a very useful operation since FCGX_Accept
|
||||
* does it implicitly. Closing the out stream before the
|
||||
* err stream results in an extra write if there's nothing
|
||||
* in the err stream, and therefore reduces performance.
|
||||
*
|
||||
* Results:
|
||||
* EOF (-1) if an error occurred.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_FClose(FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_GetError --
|
||||
*
|
||||
* Return the stream error code. 0 means no error, > 0
|
||||
* is an errno(2) error, < 0 is an FastCGI error.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI int FCGX_GetError(FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_ClearError --
|
||||
*
|
||||
* Clear the stream error code and end-of-file indication.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI void FCGX_ClearError(FCGX_Stream *stream);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_CreateWriter --
|
||||
*
|
||||
* Create a FCGX_Stream (used by cgi-fcgi). This shouldn't
|
||||
* be needed by a FastCGI applictaion.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI FCGX_Stream *FCGX_CreateWriter(
|
||||
int socket,
|
||||
int requestId,
|
||||
int bufflen,
|
||||
int streamType);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGX_FreeStream --
|
||||
*
|
||||
* Free a FCGX_Stream (used by cgi-fcgi). This shouldn't
|
||||
* be needed by a FastCGI applictaion.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI void FCGX_FreeStream(FCGX_Stream **stream);
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
*
|
||||
* Prevent the lib from accepting any new requests. Signal handler safe.
|
||||
*
|
||||
* ----------------------------------------------------------------------
|
||||
*/
|
||||
DLLAPI void FCGX_ShutdownPending(void);
|
||||
|
||||
#if defined (__cplusplus) || defined (c_plusplus)
|
||||
} /* terminate extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* _FCGIAPP_H */
|
||||
38
library/server/libfcgi/Clib/libfcgi/include/fcgimisc.h
Normal file
38
library/server/libfcgi/Clib/libfcgi/include/fcgimisc.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* fcgimisc.h --
|
||||
*
|
||||
* Miscellaneous definitions
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* $Id: fcgimisc.h,v 1.3 2001/06/18 14:25:47 robs Exp $
|
||||
*/
|
||||
|
||||
#ifndef _FCGIMISC_H
|
||||
#define _FCGIMISC_H
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE (1)
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef max
|
||||
#define max(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef ASSERT
|
||||
#define ASSERT(assertion) assert(assertion)
|
||||
#endif
|
||||
|
||||
#endif /* _FCGIMISC_H */
|
||||
151
library/server/libfcgi/Clib/libfcgi/include/fcgio.h
Normal file
151
library/server/libfcgi/Clib/libfcgi/include/fcgio.h
Normal file
@@ -0,0 +1,151 @@
|
||||
//
|
||||
// Provides support for FastCGI via C++ iostreams.
|
||||
//
|
||||
// $Id: fcgio.h,v 1.15 2002/02/25 13:16:11 robs Exp $
|
||||
//
|
||||
// This work is based on routines written by George Feinberg. They
|
||||
// have been mostly re-written and extensively changed by
|
||||
// Michael Richards.
|
||||
//
|
||||
// Rewritten again with bug fixes and numerous enhancements by
|
||||
// Michael Shell.
|
||||
//
|
||||
// And rewritten again by Rob Saccoccio.
|
||||
//
|
||||
// Special Thanks to Dietmar Kuehl for his help and the numerous custom
|
||||
// streambuf examples on his web site.
|
||||
//
|
||||
// Copyright (c) 2000 Tux the Linux Penguin
|
||||
// Copyright (c) 2001 Rob Saccoccio and Chelsea Networks
|
||||
//
|
||||
// You are free to use this software without charge or royalty
|
||||
// as long as this notice is not removed or altered, and recognition
|
||||
// is given to the author(s)
|
||||
//
|
||||
// This code is offered as-is without any warranty either expressed or
|
||||
// implied; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE. If it breaks, you get to keep
|
||||
// both halves.
|
||||
|
||||
#ifndef FCGIO_H
|
||||
#define FCGIO_H
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "fcgiapp.h"
|
||||
|
||||
#ifndef DLLAPI
|
||||
#ifdef _WIN32
|
||||
#define DLLAPI __declspec(dllimport)
|
||||
#else
|
||||
#define DLLAPI
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ! HAVE_STREAMBUF_CHAR_TYPE
|
||||
typedef char char_type;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* fcgi_streambuf
|
||||
*/
|
||||
class DLLAPI fcgi_streambuf : public std::streambuf
|
||||
{
|
||||
public:
|
||||
|
||||
// Note that if no buf is assigned (the default), iostream methods
|
||||
// such as peek(), unget() and putback() will fail. If a buf is
|
||||
// assigned, I/O is a bit less effecient and output streams will
|
||||
// have to be flushed (or the streambuf destroyed) before the next
|
||||
// call to "accept".
|
||||
fcgi_streambuf(FCGX_Stream * fcgx, char * buf, int len);
|
||||
|
||||
fcgi_streambuf(char_type * buf, std::streamsize len);
|
||||
|
||||
fcgi_streambuf(FCGX_Stream * fcgx = 0);
|
||||
|
||||
~fcgi_streambuf(void);
|
||||
|
||||
int attach(FCGX_Stream * fcgx);
|
||||
|
||||
protected:
|
||||
|
||||
// Consume the put area (if buffered) and c (if c is not EOF).
|
||||
virtual int overflow(int);
|
||||
|
||||
// Flush the put area (if buffered) and the FCGX buffer to the client.
|
||||
virtual int sync();
|
||||
|
||||
// Remove and return the current character.
|
||||
virtual int uflow();
|
||||
|
||||
// Fill the get area (if buffered) and return the current character.
|
||||
virtual int underflow();
|
||||
|
||||
// Use a buffer. The only reasons that a buffer would be useful is
|
||||
// to support the use of the unget()/putback() or seek() methods. Using
|
||||
// a buffer will result in less efficient I/O. Note: the underlying
|
||||
// FastCGI library (FCGX) maintains its own input and output buffers.
|
||||
virtual std::streambuf * setbuf(char_type * buf, std::streamsize len);
|
||||
|
||||
virtual std::streamsize xsgetn(char_type * s, std::streamsize n);
|
||||
virtual std::streamsize xsputn(const char_type * s, std::streamsize n);
|
||||
|
||||
private:
|
||||
|
||||
FCGX_Stream * fcgx;
|
||||
|
||||
// buf is just handy to have around
|
||||
char_type * buf;
|
||||
|
||||
// this isn't kept by the base class
|
||||
std::streamsize bufsize;
|
||||
|
||||
void init(FCGX_Stream * fcgx, char_type * buf, std::streamsize bufsize);
|
||||
|
||||
void reset(void);
|
||||
};
|
||||
|
||||
/*
|
||||
* fcgi_istream - deprecated
|
||||
*/
|
||||
class DLLAPI fcgi_istream : public std::istream
|
||||
{
|
||||
public:
|
||||
|
||||
// deprecated
|
||||
fcgi_istream(FCGX_Stream * fcgx = 0);
|
||||
|
||||
// deprecated
|
||||
~fcgi_istream(void) {}
|
||||
|
||||
// deprecated
|
||||
virtual void attach(FCGX_Stream * fcgx);
|
||||
|
||||
private:
|
||||
|
||||
fcgi_streambuf fcgi_strmbuf;
|
||||
};
|
||||
|
||||
/*
|
||||
* fcgi_ostream - deprecated
|
||||
*/
|
||||
class DLLAPI fcgi_ostream : public std::ostream
|
||||
{
|
||||
public:
|
||||
|
||||
// deprecated
|
||||
fcgi_ostream(FCGX_Stream * fcgx = 0);
|
||||
|
||||
// deprecated
|
||||
~fcgi_ostream(void) {}
|
||||
|
||||
// deprecated
|
||||
virtual void attach(FCGX_Stream *fcgx);
|
||||
|
||||
private:
|
||||
|
||||
fcgi_streambuf fcgi_strmbuf;
|
||||
};
|
||||
|
||||
#endif /* FCGIO_H */
|
||||
130
library/server/libfcgi/Clib/libfcgi/include/fcgios.h
Normal file
130
library/server/libfcgi/Clib/libfcgi/include/fcgios.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* fcgios.h --
|
||||
*
|
||||
* Description of file.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1996 Open Market, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This file contains proprietary and confidential information and
|
||||
* remains the unpublished property of Open Market, Inc. Use,
|
||||
* disclosure, or reproduction is prohibited except as permitted by
|
||||
* express written license agreement with Open Market, Inc.
|
||||
*
|
||||
* Bill Snapper
|
||||
* snapper@openmarket.com
|
||||
*/
|
||||
#ifndef _FCGIOS_H
|
||||
#define _FCGIOS_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
#include "fcgi_config.h"
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if defined (c_plusplus) || defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define OS_Errno GetLastError()
|
||||
#define OS_SetErrno(err) SetLastError(err)
|
||||
#ifndef O_NONBLOCK
|
||||
#define O_NONBLOCK 0x0004 /* no delay */
|
||||
#endif
|
||||
#else /* !_WIN32 */
|
||||
#define OS_Errno errno
|
||||
#define OS_SetErrno(err) errno = (err)
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
#ifndef DLLAPI
|
||||
#ifdef _WIN32
|
||||
#define DLLAPI __declspec(dllimport)
|
||||
#else
|
||||
#define DLLAPI
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* This is the initializer for a "struct timeval" used in a select() call
|
||||
* right after a new request is accept()ed to determine readablity. Its
|
||||
* a drop-dead timer. Its only used for AF_UNIX sockets (not TCP sockets).
|
||||
* Its a workaround for a kernel bug in Linux 2.0.x and SCO Unixware.
|
||||
* Making this as small as possible, yet remain reliable would be best.
|
||||
* 2 seconds is very conservative. 0,0 is not reliable. The shorter the
|
||||
* timeout, the faster request processing will recover. The longer the
|
||||
* timeout, the more likely this application being "busy" will cause other
|
||||
* requests to abort and cause more dead sockets that need this timeout. */
|
||||
#define READABLE_UNIX_FD_DROP_DEAD_TIMEVAL 2,0
|
||||
|
||||
#ifndef STDIN_FILENO
|
||||
#define STDIN_FILENO 0
|
||||
#endif
|
||||
|
||||
#ifndef STDOUT_FILENO
|
||||
#define STDOUT_FILENO 1
|
||||
#endif
|
||||
|
||||
#ifndef STDERR_FILENO
|
||||
#define STDERR_FILENO 2
|
||||
#endif
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
#define MAXPATHLEN 1024
|
||||
#endif
|
||||
|
||||
#ifndef X_OK
|
||||
#define X_OK 0x01
|
||||
#endif
|
||||
|
||||
#ifndef _CLIENTDATA
|
||||
# if defined(__STDC__) || defined(__cplusplus)
|
||||
typedef void *ClientData;
|
||||
# else
|
||||
typedef int *ClientData;
|
||||
# endif /* __STDC__ */
|
||||
#define _CLIENTDATA
|
||||
#endif
|
||||
|
||||
typedef void (*OS_AsyncProc) (ClientData clientData, int len);
|
||||
|
||||
DLLAPI int OS_LibInit(int stdioFds[3]);
|
||||
DLLAPI void OS_LibShutdown(void);
|
||||
DLLAPI int OS_CreateLocalIpcFd(const char *bindPath, int backlog);
|
||||
DLLAPI int OS_FcgiConnect(char *bindPath);
|
||||
DLLAPI int OS_Read(int fd, char * buf, size_t len);
|
||||
DLLAPI int OS_Write(int fd, char * buf, size_t len);
|
||||
DLLAPI int OS_SpawnChild(char *execPath, int listenFd);
|
||||
DLLAPI int OS_AsyncReadStdin(void *buf, int len, OS_AsyncProc procPtr,
|
||||
ClientData clientData);
|
||||
DLLAPI int OS_AsyncRead(int fd, int offset, void *buf, int len,
|
||||
OS_AsyncProc procPtr, ClientData clientData);
|
||||
DLLAPI int OS_AsyncWrite(int fd, int offset, void *buf, int len,
|
||||
OS_AsyncProc procPtr, ClientData clientData);
|
||||
DLLAPI int OS_Close(int fd);
|
||||
DLLAPI int OS_CloseRead(int fd);
|
||||
DLLAPI int OS_DoIo(struct timeval *tmo);
|
||||
DLLAPI int OS_Accept(int listen_sock, int fail_on_intr, const char *webServerAddrs);
|
||||
DLLAPI int OS_IpcClose(int ipcFd);
|
||||
DLLAPI int OS_IsFcgi(int sock);
|
||||
DLLAPI void OS_SetFlags(int fd, int flags);
|
||||
|
||||
DLLAPI void OS_ShutdownPending(void);
|
||||
|
||||
#if defined (__cplusplus) || defined (c_plusplus)
|
||||
} /* terminate extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* _FCGIOS_H */
|
||||
27
library/server/libfcgi/Clib/libfcgi/libfcgi/Makefile.am
Normal file
27
library/server/libfcgi/Clib/libfcgi/libfcgi/Makefile.am
Normal file
@@ -0,0 +1,27 @@
|
||||
# $Id: Makefile.am,v 1.9 2001/12/22 03:16:20 robs Exp $
|
||||
|
||||
INCLUDEDIR = ../include
|
||||
CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/include
|
||||
|
||||
INCLUDE_FILES = $(INCLUDEDIR)/fastcgi.h \
|
||||
$(INCLUDEDIR)/fcgiapp.h \
|
||||
$(INCLUDEDIR)/fcgimisc.h \
|
||||
$(INCLUDEDIR)/fcgi_stdio.h \
|
||||
$(INCLUDEDIR)/fcgios.h
|
||||
|
||||
lib_LTLIBRARIES = libfcgi.la @LIBFCGIXX@
|
||||
EXTRA_LTLIBRARIES = libfcgi++.la
|
||||
|
||||
libfcgi_la_SOURCES = $(INCLUDE_FILES) \
|
||||
fcgiapp.c \
|
||||
fcgi_stdio.c \
|
||||
os_@SYSTEM@.c
|
||||
libfcgi_la_CC = @PTHREAD_CC@
|
||||
libfcgi_la_CFLAGS = @PTHREAD_CFLAGS@
|
||||
|
||||
libfcgi___la_SOURCES = $(INCLUDE_FILES) \
|
||||
$(INCLUDEDIR)/fcgio.h \
|
||||
fcgio.cpp
|
||||
libfcgi___la_CFLAGS = @PTHREAD_CFLAGS@
|
||||
libfcgi___la_LDFLAGS = -lfcgi -rpath @libdir@
|
||||
|
||||
454
library/server/libfcgi/Clib/libfcgi/libfcgi/Makefile.in
Normal file
454
library/server/libfcgi/Clib/libfcgi/libfcgi/Makefile.in
Normal file
@@ -0,0 +1,454 @@
|
||||
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# $Id: Makefile.am,v 1.9 2001/12/22 03:16:20 robs Exp $
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = @program_transform_name@
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AMTAR = @AMTAR@
|
||||
AS = @AS@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
CXX = @CXX@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_CPP = @ECHO_CPP@
|
||||
EXEEXT = @EXEEXT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LIBFCGIXX = @LIBFCGIXX@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PTHREAD_CC = @PTHREAD_CC@
|
||||
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
|
||||
PTHREAD_LIBS = @PTHREAD_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
SYSTEM = @SYSTEM@
|
||||
THREADED = @THREADED@
|
||||
VERSION = @VERSION@
|
||||
am__include = @am__include@
|
||||
am__quote = @am__quote@
|
||||
install_sh = @install_sh@
|
||||
|
||||
INCLUDEDIR = ../include
|
||||
CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/include
|
||||
|
||||
INCLUDE_FILES = $(INCLUDEDIR)/fastcgi.h \
|
||||
$(INCLUDEDIR)/fcgiapp.h \
|
||||
$(INCLUDEDIR)/fcgimisc.h \
|
||||
$(INCLUDEDIR)/fcgi_stdio.h \
|
||||
$(INCLUDEDIR)/fcgios.h
|
||||
|
||||
|
||||
lib_LTLIBRARIES = libfcgi.la @LIBFCGIXX@
|
||||
EXTRA_LTLIBRARIES = libfcgi++.la
|
||||
|
||||
libfcgi_la_SOURCES = $(INCLUDE_FILES) \
|
||||
fcgiapp.c \
|
||||
fcgi_stdio.c \
|
||||
os_@SYSTEM@.c
|
||||
|
||||
libfcgi_la_CC = @PTHREAD_CC@
|
||||
libfcgi_la_CFLAGS = @PTHREAD_CFLAGS@
|
||||
|
||||
libfcgi___la_SOURCES = $(INCLUDE_FILES) \
|
||||
$(INCLUDEDIR)/fcgio.h \
|
||||
fcgio.cpp
|
||||
|
||||
libfcgi___la_CFLAGS = @PTHREAD_CFLAGS@
|
||||
libfcgi___la_LDFLAGS = -lfcgi -rpath @libdir@
|
||||
subdir = libfcgi
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/fcgi_config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
|
||||
libfcgi___la_LIBADD =
|
||||
am_libfcgi___la_OBJECTS = fcgio.lo
|
||||
libfcgi___la_OBJECTS = $(am_libfcgi___la_OBJECTS)
|
||||
libfcgi_la_LDFLAGS =
|
||||
libfcgi_la_LIBADD =
|
||||
am_libfcgi_la_OBJECTS = libfcgi_la-fcgiapp.lo libfcgi_la-fcgi_stdio.lo \
|
||||
libfcgi_la-os_@SYSTEM@.lo
|
||||
libfcgi_la_OBJECTS = $(am_libfcgi_la_OBJECTS)
|
||||
|
||||
DEFS = @DEFS@
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/fcgio.Plo \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/libfcgi_la-fcgi_stdio.Plo \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/libfcgi_la-fcgiapp.Plo \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/libfcgi_la-os_@SYSTEM@.Plo
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
|
||||
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
CFLAGS = @CFLAGS@
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
DIST_SOURCES = $(libfcgi___la_SOURCES) $(libfcgi_la_SOURCES)
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
SOURCES = $(libfcgi___la_SOURCES) $(libfcgi_la_SOURCES)
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .cpp .lo .o .obj
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign libfcgi/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && \
|
||||
CONFIG_HEADERS= CONFIG_LINKS= \
|
||||
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p"; \
|
||||
$(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
libfcgi++.la: $(libfcgi___la_OBJECTS) $(libfcgi___la_DEPENDENCIES)
|
||||
$(CXXLINK) $(libfcgi___la_LDFLAGS) $(libfcgi___la_OBJECTS) $(libfcgi___la_LIBADD) $(LIBS)
|
||||
libfcgi_la-fcgiapp.lo: fcgiapp.c
|
||||
libfcgi_la-fcgi_stdio.lo: fcgi_stdio.c
|
||||
libfcgi_la-os_@SYSTEM@.lo: os_@SYSTEM@.c
|
||||
libfcgi.la: $(libfcgi_la_OBJECTS) $(libfcgi_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(libdir) $(libfcgi_la_LDFLAGS) $(libfcgi_la_OBJECTS) $(libfcgi_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT) core *.core
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fcgio.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libfcgi_la-fcgi_stdio.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libfcgi_la-fcgiapp.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libfcgi_la-os_@SYSTEM@.Plo@am__quote@
|
||||
|
||||
distclean-depend:
|
||||
-rm -rf $(DEPDIR)
|
||||
|
||||
.c.o:
|
||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
|
||||
|
||||
.c.obj:
|
||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(COMPILE) -c `cygpath -w $<`
|
||||
|
||||
.c.lo:
|
||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
|
||||
|
||||
libfcgi_la-fcgiapp.o: fcgiapp.c
|
||||
@AMDEP_TRUE@ source='fcgiapp.c' object='libfcgi_la-fcgiapp.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/libfcgi_la-fcgiapp.Po' tmpdepfile='$(DEPDIR)/libfcgi_la-fcgiapp.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfcgi_la_CFLAGS) $(CFLAGS) -c -o libfcgi_la-fcgiapp.o `test -f fcgiapp.c || echo '$(srcdir)/'`fcgiapp.c
|
||||
|
||||
libfcgi_la-fcgiapp.obj: fcgiapp.c
|
||||
@AMDEP_TRUE@ source='fcgiapp.c' object='libfcgi_la-fcgiapp.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/libfcgi_la-fcgiapp.Po' tmpdepfile='$(DEPDIR)/libfcgi_la-fcgiapp.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfcgi_la_CFLAGS) $(CFLAGS) -c -o libfcgi_la-fcgiapp.obj `cygpath -w fcgiapp.c`
|
||||
|
||||
libfcgi_la-fcgiapp.lo: fcgiapp.c
|
||||
@AMDEP_TRUE@ source='fcgiapp.c' object='libfcgi_la-fcgiapp.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/libfcgi_la-fcgiapp.Plo' tmpdepfile='$(DEPDIR)/libfcgi_la-fcgiapp.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfcgi_la_CFLAGS) $(CFLAGS) -c -o libfcgi_la-fcgiapp.lo `test -f fcgiapp.c || echo '$(srcdir)/'`fcgiapp.c
|
||||
|
||||
libfcgi_la-fcgi_stdio.o: fcgi_stdio.c
|
||||
@AMDEP_TRUE@ source='fcgi_stdio.c' object='libfcgi_la-fcgi_stdio.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/libfcgi_la-fcgi_stdio.Po' tmpdepfile='$(DEPDIR)/libfcgi_la-fcgi_stdio.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfcgi_la_CFLAGS) $(CFLAGS) -c -o libfcgi_la-fcgi_stdio.o `test -f fcgi_stdio.c || echo '$(srcdir)/'`fcgi_stdio.c
|
||||
|
||||
libfcgi_la-fcgi_stdio.obj: fcgi_stdio.c
|
||||
@AMDEP_TRUE@ source='fcgi_stdio.c' object='libfcgi_la-fcgi_stdio.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/libfcgi_la-fcgi_stdio.Po' tmpdepfile='$(DEPDIR)/libfcgi_la-fcgi_stdio.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfcgi_la_CFLAGS) $(CFLAGS) -c -o libfcgi_la-fcgi_stdio.obj `cygpath -w fcgi_stdio.c`
|
||||
|
||||
libfcgi_la-fcgi_stdio.lo: fcgi_stdio.c
|
||||
@AMDEP_TRUE@ source='fcgi_stdio.c' object='libfcgi_la-fcgi_stdio.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/libfcgi_la-fcgi_stdio.Plo' tmpdepfile='$(DEPDIR)/libfcgi_la-fcgi_stdio.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfcgi_la_CFLAGS) $(CFLAGS) -c -o libfcgi_la-fcgi_stdio.lo `test -f fcgi_stdio.c || echo '$(srcdir)/'`fcgi_stdio.c
|
||||
|
||||
libfcgi_la-os_@SYSTEM@.o: os_@SYSTEM@.c
|
||||
@AMDEP_TRUE@ source='os_@SYSTEM@.c' object='libfcgi_la-os_@SYSTEM@.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/libfcgi_la-os_@SYSTEM@.Po' tmpdepfile='$(DEPDIR)/libfcgi_la-os_@SYSTEM@.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfcgi_la_CFLAGS) $(CFLAGS) -c -o libfcgi_la-os_@SYSTEM@.o `test -f os_@SYSTEM@.c || echo '$(srcdir)/'`os_@SYSTEM@.c
|
||||
|
||||
libfcgi_la-os_@SYSTEM@.obj: os_@SYSTEM@.c
|
||||
@AMDEP_TRUE@ source='os_@SYSTEM@.c' object='libfcgi_la-os_@SYSTEM@.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/libfcgi_la-os_@SYSTEM@.Po' tmpdepfile='$(DEPDIR)/libfcgi_la-os_@SYSTEM@.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfcgi_la_CFLAGS) $(CFLAGS) -c -o libfcgi_la-os_@SYSTEM@.obj `cygpath -w os_@SYSTEM@.c`
|
||||
|
||||
libfcgi_la-os_@SYSTEM@.lo: os_@SYSTEM@.c
|
||||
@AMDEP_TRUE@ source='os_@SYSTEM@.c' object='libfcgi_la-os_@SYSTEM@.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/libfcgi_la-os_@SYSTEM@.Plo' tmpdepfile='$(DEPDIR)/libfcgi_la-os_@SYSTEM@.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfcgi_la_CFLAGS) $(CFLAGS) -c -o libfcgi_la-os_@SYSTEM@.lo `test -f os_@SYSTEM@.c || echo '$(srcdir)/'`os_@SYSTEM@.c
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
|
||||
.cpp.o:
|
||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(CXXCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
|
||||
|
||||
.cpp.obj:
|
||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(CXXCOMPILE) -c -o $@ `cygpath -w $<`
|
||||
|
||||
.cpp.lo:
|
||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(LTCXXCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
uninstall-info-am:
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
|
||||
|
||||
GTAGS:
|
||||
here=`CDPATH=: && cd $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = ..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
$(mkinstalldirs) "$(distdir)/$$dir"; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pR $$d/$$file $(distdir) \
|
||||
|| exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
distclean-am: clean-am distclean-compile distclean-depend \
|
||||
distclean-generic distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
|
||||
|
||||
.PHONY: GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool distclean distclean-compile \
|
||||
distclean-depend distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am info info-am install \
|
||||
install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am \
|
||||
install-libLTLIBRARIES install-man install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool tags uninstall \
|
||||
uninstall-am uninstall-info-am uninstall-libLTLIBRARIES
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
825
library/server/libfcgi/Clib/libfcgi/libfcgi/fcgi_stdio.c
Normal file
825
library/server/libfcgi/Clib/libfcgi/libfcgi/fcgi_stdio.c
Normal file
@@ -0,0 +1,825 @@
|
||||
/*
|
||||
* fcgi_stdio.c --
|
||||
*
|
||||
* FastCGI-stdio compatibility package
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "$Id: fcgi_stdio.c,v 1.14 2001/09/01 01:09:30 robs Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <errno.h> /* for errno */
|
||||
#include <stdarg.h> /* for va_arg */
|
||||
#include <stdlib.h> /* for malloc */
|
||||
#include <string.h> /* for strerror */
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "fcgi_config.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define DLLAPI __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "fcgiapp.h"
|
||||
#include "fcgios.h"
|
||||
#include "fcgimisc.h"
|
||||
|
||||
#define NO_FCGI_DEFINES
|
||||
#include "fcgi_stdio.h"
|
||||
#undef NO_FCGI_DEFINES
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
extern char **environ;
|
||||
|
||||
#ifdef HAVE_FILENO_PROTO
|
||||
#include <stdio.h>
|
||||
#else
|
||||
extern int fileno(FILE *stream);
|
||||
#endif
|
||||
|
||||
extern FILE *fdopen(int fildes, const char *type);
|
||||
extern FILE *popen(const char *command, const char *type);
|
||||
extern int pclose(FILE *stream);
|
||||
|
||||
#else /* _WIN32 */
|
||||
|
||||
#define popen _popen
|
||||
#define pclose _pclose
|
||||
#define fdopen _fdopen
|
||||
#define fileno _fileno
|
||||
|
||||
#endif /* _WIN32 */
|
||||
|
||||
FCGI_FILE _fcgi_sF[3];
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_Accept --
|
||||
*
|
||||
* Accepts a new request from the HTTP server and creates
|
||||
* a conventional execution environment for the request.
|
||||
*
|
||||
* If the application was invoked as a FastCGI server,
|
||||
* the first call to FCGI_Accept indicates that the application
|
||||
* has completed its initialization and is ready to accept
|
||||
* a request. Subsequent calls to FCGI_Accept indicate that
|
||||
* the application has completed its processing of the
|
||||
* current request and is ready to accept a new request.
|
||||
*
|
||||
* If the application was invoked as a CGI program, the first
|
||||
* call to FCGI_Accept is essentially a no-op and the second
|
||||
* call returns EOF (-1).
|
||||
*
|
||||
* Results:
|
||||
* 0 for successful call, -1 for error (application should exit).
|
||||
*
|
||||
* Side effects:
|
||||
* If the application was invoked as a FastCGI server,
|
||||
* and this is not the first call to this procedure,
|
||||
* FCGI_Accept first performs the equivalent of FCGI_Finish.
|
||||
*
|
||||
* On every call, FCGI_Accept accepts the new request and
|
||||
* reads the FCGI_PARAMS stream into an environment array,
|
||||
* i.e. a NULL-terminated array of strings of the form
|
||||
* ``name=value''. It assigns a pointer to this array
|
||||
* to the global variable environ, used by the standard
|
||||
* library function getenv. It creates new FCGI_FILE *s
|
||||
* representing input from the HTTP server, output to the HTTP
|
||||
* server, and error output to the HTTP server, and assigns these
|
||||
* new files to stdin, stdout, and stderr respectively.
|
||||
*
|
||||
* DO NOT mutate or retain pointers to environ or any values
|
||||
* contained in it (e.g. to the result of calling getenv(3)),
|
||||
* since these are freed by the next call to FCGI_Finish or
|
||||
* FCGI_Accept. In particular do not use setenv(3) or putenv(3)
|
||||
* in conjunction with FCGI_Accept.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
static int acceptCalled = FALSE;
|
||||
static int isCGI = FALSE;
|
||||
|
||||
int FCGI_Accept(void)
|
||||
{
|
||||
if(!acceptCalled) {
|
||||
/*
|
||||
* First call to FCGI_Accept. Is application running
|
||||
* as FastCGI or as CGI?
|
||||
*/
|
||||
isCGI = FCGX_IsCGI();
|
||||
acceptCalled = TRUE;
|
||||
atexit(&FCGI_Finish);
|
||||
} else if(isCGI) {
|
||||
/*
|
||||
* Not first call to FCGI_Accept and running as CGI means
|
||||
* application is done.
|
||||
*/
|
||||
return(EOF);
|
||||
}
|
||||
if(isCGI) {
|
||||
FCGI_stdin->stdio_stream = stdin;
|
||||
FCGI_stdin->fcgx_stream = NULL;
|
||||
FCGI_stdout->stdio_stream = stdout;
|
||||
FCGI_stdout->fcgx_stream = NULL;
|
||||
FCGI_stderr->stdio_stream = stderr;
|
||||
FCGI_stderr->fcgx_stream = NULL;
|
||||
} else {
|
||||
FCGX_Stream *in, *out, *error;
|
||||
FCGX_ParamArray envp;
|
||||
int acceptResult = FCGX_Accept(&in, &out, &error, &envp);
|
||||
if(acceptResult < 0) {
|
||||
return acceptResult;
|
||||
}
|
||||
FCGI_stdin->stdio_stream = NULL;
|
||||
FCGI_stdin->fcgx_stream = in;
|
||||
FCGI_stdout->stdio_stream = NULL;
|
||||
FCGI_stdout->fcgx_stream = out;
|
||||
FCGI_stderr->stdio_stream = NULL;
|
||||
FCGI_stderr->fcgx_stream = error;
|
||||
environ = envp;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_Environ --
|
||||
*
|
||||
* Return the (char**) environ variable
|
||||
* since there are issue related to UNICODE ...
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char** FCGI_Environ(void)
|
||||
{
|
||||
return (char**) environ;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_Finish --
|
||||
*
|
||||
* Finishes the current request from the HTTP server.
|
||||
*
|
||||
* Side effects:
|
||||
*
|
||||
* Flushes any buffered output to the HTTP server. Then frees
|
||||
* all storage allocated by the previous call, including all
|
||||
* storage reachable from the value of environ set by the previous
|
||||
* call to FCGI_Accept.
|
||||
*
|
||||
* DO NOT use stdin, stdout, stderr, or environ between calling
|
||||
* FCGI_Finish and calling FCGI_Accept.
|
||||
*
|
||||
* DO NOT mutate or retain pointers to environ or any values
|
||||
* contained in it (e.g. to the result of calling getenv(3)),
|
||||
* since these are freed by the next call to FCGI_Finish or
|
||||
* FCGI_Accept. In particular do not use setenv(3) or putenv(3)
|
||||
* in conjunction with FCGI_Accept.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
void FCGI_Finish(void)
|
||||
{
|
||||
if(!acceptCalled || isCGI) {
|
||||
return;
|
||||
}
|
||||
FCGX_Finish();
|
||||
FCGI_stdin->fcgx_stream = NULL;
|
||||
FCGI_stdout->fcgx_stream = NULL;
|
||||
FCGI_stderr->fcgx_stream = NULL;
|
||||
environ = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_StartFilterData --
|
||||
*
|
||||
*
|
||||
* The current request is for the filter role, and stdin is
|
||||
* positioned at EOF of FCGI_STDIN. The call repositions
|
||||
* stdin to the start of FCGI_DATA.
|
||||
* If the preconditions are not met (e.g. FCGI_STDIN has not
|
||||
* been read to EOF), the call sets the stream error code to
|
||||
* FCGX_CALL_SEQ_ERROR.
|
||||
*
|
||||
* Results:
|
||||
* 0 for a normal return, < 0 for error
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
int FCGI_StartFilterData(void)
|
||||
{
|
||||
if(FCGI_stdin->stdio_stream) {
|
||||
return -1;
|
||||
} else {
|
||||
return FCGX_StartFilterData(FCGI_stdin->fcgx_stream);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_SetExitStatus --
|
||||
*
|
||||
* Sets the exit status for the current request. The exit status
|
||||
* is the status code the request would have exited with, had
|
||||
* the request been run as a CGI program. You can call
|
||||
* FCGI_SetExitStatus several times during a request; the last call
|
||||
* before the request ends (by calling FCGI_Accept) determines the
|
||||
* value.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
void FCGI_SetExitStatus(int status)
|
||||
{
|
||||
if(FCGI_stdin->fcgx_stream) {
|
||||
FCGX_SetExitStatus(status, FCGI_stdin->fcgx_stream);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_perror --
|
||||
*
|
||||
* Wrapper for function defined in H&S Section 11.2
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
void FCGI_perror(const char *str)
|
||||
{
|
||||
FCGI_fputs(str, FCGI_stderr);
|
||||
FCGI_fputs(": ", FCGI_stderr);
|
||||
FCGI_fputs(strerror(OS_Errno), FCGI_stderr);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_OpenFromFILE --
|
||||
*
|
||||
* Constructs a new FCGI_FILE * from the FILE *stream.
|
||||
*
|
||||
* Results:
|
||||
* NULL if stream == NULL or storage could not be allocated,
|
||||
* otherwise the new FCGI_FILE *.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
static FCGI_FILE *FCGI_OpenFromFILE(FILE *stream)
|
||||
{
|
||||
FCGI_FILE *fp;
|
||||
|
||||
if (stream == NULL)
|
||||
return NULL;
|
||||
|
||||
fp = (FCGI_FILE *) malloc(sizeof(FCGI_FILE));
|
||||
if (fp != NULL)
|
||||
{
|
||||
fp->stdio_stream = stream;
|
||||
fp->fcgx_stream = NULL;
|
||||
}
|
||||
|
||||
return fp;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_fopen, FCGI_fclose, FCGI_fflush, FCGI_freopen --
|
||||
*
|
||||
* Wrappers for functions defined in H&S Section 15.2
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
FCGI_FILE *FCGI_fopen(const char *path, const char *mode)
|
||||
{
|
||||
FILE * file = fopen(path, mode);
|
||||
FCGI_FILE * fcgi_file = FCGI_OpenFromFILE(file);
|
||||
|
||||
if (file && !fcgi_file)
|
||||
fclose(file);
|
||||
|
||||
return fcgi_file;
|
||||
}
|
||||
|
||||
int FCGI_fclose(FCGI_FILE *fp)
|
||||
{
|
||||
int n = EOF;
|
||||
if(fp->stdio_stream) {
|
||||
n = fclose(fp->stdio_stream);
|
||||
fp->stdio_stream = NULL;
|
||||
} else if(fp->fcgx_stream) {
|
||||
n = FCGX_FClose(fp->fcgx_stream);
|
||||
fp->fcgx_stream = NULL;
|
||||
}
|
||||
if((fp != FCGI_stdin) && (fp != FCGI_stdout) && (fp != FCGI_stderr)) {
|
||||
free(fp);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
int FCGI_fflush(FCGI_FILE *fp)
|
||||
{
|
||||
if(fp == NULL)
|
||||
return fflush(NULL);
|
||||
if(fp->stdio_stream)
|
||||
return fflush(fp->stdio_stream);
|
||||
else if(fp->fcgx_stream)
|
||||
return FCGX_FFlush(fp->fcgx_stream);
|
||||
return EOF;
|
||||
}
|
||||
|
||||
FCGI_FILE *FCGI_freopen(const char *path, const char *mode,
|
||||
FCGI_FILE *fp)
|
||||
{
|
||||
if(fp->stdio_stream) {
|
||||
if(freopen(path, mode, fp->stdio_stream) == NULL)
|
||||
return NULL;
|
||||
else
|
||||
return fp;
|
||||
} else if(fp->fcgx_stream) {
|
||||
(void) FCGX_FClose(fp->fcgx_stream);
|
||||
fp->stdio_stream = fopen(path, mode);
|
||||
if(fp->stdio_stream == NULL)
|
||||
return NULL;
|
||||
else {
|
||||
fp->fcgx_stream = NULL;
|
||||
return fp;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_setvbuf, FCGI_setbuf --
|
||||
*
|
||||
* Wrappers for functions defined in H&S Section 15.3
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
int FCGI_setvbuf(FCGI_FILE *fp, char *buf, int bufmode, size_t size)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
return setvbuf(fp->stdio_stream, buf, bufmode, size);
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void FCGI_setbuf(FCGI_FILE *fp, char *buf)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
setbuf(fp->stdio_stream, buf);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_fseek, FCGI_ftell, FCGI_rewind, FCGI_fgetpos, FCGI_fsetpos --
|
||||
*
|
||||
* Wrappers for functions defined in H&S Section 15.5
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
int FCGI_fseek(FCGI_FILE *fp, long offset, int whence)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
return fseek(fp->stdio_stream, offset, whence);
|
||||
else {
|
||||
OS_SetErrno(ESPIPE);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int FCGI_ftell(FCGI_FILE *fp)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
return ftell(fp->stdio_stream);
|
||||
else {
|
||||
OS_SetErrno(ESPIPE);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void FCGI_rewind(FCGI_FILE *fp)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
rewind(fp->stdio_stream);
|
||||
else
|
||||
OS_SetErrno(ESPIPE);
|
||||
}
|
||||
|
||||
#ifdef HAVE_FPOS
|
||||
int FCGI_fgetpos(FCGI_FILE *fp, fpos_t *pos)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
return fgetpos(fp->stdio_stream, pos);
|
||||
else {
|
||||
OS_SetErrno(ESPIPE);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int FCGI_fsetpos(FCGI_FILE *fp, const fpos_t *pos)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
return fsetpos(fp->stdio_stream, pos);
|
||||
else {
|
||||
OS_SetErrno(ESPIPE);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_fgetc, FCGI_getchar, FCGI_ungetc --
|
||||
*
|
||||
* Wrappers for functions defined in H&S Section 15.6
|
||||
*
|
||||
* XXX: getc and getchar are generally defined as macros
|
||||
* for performance reasons
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
int FCGI_fgetc(FCGI_FILE *fp)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
return fgetc(fp->stdio_stream);
|
||||
else if(fp->fcgx_stream)
|
||||
return FCGX_GetChar(fp->fcgx_stream);
|
||||
return EOF;
|
||||
}
|
||||
|
||||
int FCGI_getchar(void)
|
||||
{
|
||||
return FCGI_fgetc(FCGI_stdin);
|
||||
}
|
||||
|
||||
int FCGI_ungetc(int c, FCGI_FILE *fp)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
return ungetc(c, fp->stdio_stream);
|
||||
else if(fp->fcgx_stream)
|
||||
return FCGX_UnGetChar(c, fp->fcgx_stream);
|
||||
return EOF;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_fgets, FCGI_gets --
|
||||
*
|
||||
* Wrappers for functions defined in H&S Section 15.7
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
char *FCGI_fgets(char *str, int size, FCGI_FILE *fp)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
return fgets(str, size, fp->stdio_stream);
|
||||
else if(fp->fcgx_stream)
|
||||
return FCGX_GetLine(str, size, fp->fcgx_stream);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* The gets() function reads characters from the standard input stream
|
||||
* into the array pointed to by str until a newline character is read
|
||||
* or an end-of-file condition is encountered. The newline character
|
||||
* is discarded and the string is terminated with a null character.
|
||||
*/
|
||||
char *FCGI_gets(char *str)
|
||||
{
|
||||
char *s;
|
||||
int c;
|
||||
|
||||
for (s = str; ((c = FCGI_getchar()) != '\n');) {
|
||||
if(c == EOF) {
|
||||
if(s == str)
|
||||
return NULL;
|
||||
else
|
||||
break;
|
||||
} else
|
||||
*s++ = (char) c;
|
||||
}
|
||||
*s = 0;
|
||||
return str;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Wrappers for functions defined in H&S Section 15.8
|
||||
*
|
||||
* XXX: missing: fscanf, scanf
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_fputc, FCGI_putchar --
|
||||
*
|
||||
* Wrappers for functions defined in H&S Section 15.9
|
||||
*
|
||||
* XXX: putc and putchar are generally defined as macros
|
||||
* for performance reasons
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
int FCGI_fputc(int c, FCGI_FILE *fp)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
return fputc(c, fp->stdio_stream);
|
||||
else if(fp->fcgx_stream)
|
||||
return FCGX_PutChar(c, fp->fcgx_stream);
|
||||
else return EOF;
|
||||
}
|
||||
|
||||
int FCGI_putchar(int c)
|
||||
{
|
||||
return FCGI_fputc(c, FCGI_stdout);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_fputs, FCGI_puts
|
||||
*
|
||||
* Wrappers for functions defined in H&S Section 15.10
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
int FCGI_fputs(const char *str, FCGI_FILE *fp)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
return fputs(str, fp->stdio_stream);
|
||||
else if(fp->fcgx_stream)
|
||||
return FCGX_PutS(str, fp->fcgx_stream);
|
||||
return EOF;
|
||||
}
|
||||
|
||||
int FCGI_puts(const char *str)
|
||||
{
|
||||
int n;
|
||||
if(FCGI_stdout->stdio_stream) {
|
||||
n = fputs(str, FCGI_stdout->stdio_stream);
|
||||
if(n < 0)
|
||||
return n;
|
||||
else
|
||||
return fputc('\n', FCGI_stdout->stdio_stream);
|
||||
} else if(FCGI_stdout->fcgx_stream) {
|
||||
n = FCGX_PutS(str, FCGI_stdout->fcgx_stream);
|
||||
if(n < 0)
|
||||
return n;
|
||||
else
|
||||
return FCGX_PutChar('\n', FCGI_stdout->fcgx_stream);
|
||||
}
|
||||
return EOF;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_fprintf, FCGI_printf --
|
||||
*
|
||||
* Wrappers for functions defined in H&S Section 15.11
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
int FCGI_fprintf(FCGI_FILE *fp, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int n = 0;
|
||||
va_start(ap, format);
|
||||
if(fp->stdio_stream)
|
||||
n = vfprintf(fp->stdio_stream, format, ap);
|
||||
else if(fp->fcgx_stream)
|
||||
n = FCGX_VFPrintF(fp->fcgx_stream, format, ap);
|
||||
va_end(ap);
|
||||
return n;
|
||||
}
|
||||
|
||||
int FCGI_printf(const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int n;
|
||||
va_start(ap, format);
|
||||
n = FCGI_vfprintf(FCGI_stdout, format, ap);
|
||||
va_end(ap);
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_vfprintf, FCGI_vprintf --
|
||||
*
|
||||
* Wrappers for functions defined in H&S Section 15.12
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
int FCGI_vfprintf(FCGI_FILE *fp, const char *format, va_list ap)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
return vfprintf(fp->stdio_stream, format, ap);
|
||||
else if(fp->fcgx_stream)
|
||||
return FCGX_VFPrintF(fp->fcgx_stream, format, ap);
|
||||
return EOF;
|
||||
}
|
||||
|
||||
int FCGI_vprintf(const char *format, va_list ap)
|
||||
{
|
||||
if(FCGI_stdout->stdio_stream)
|
||||
return vfprintf(FCGI_stdout->stdio_stream, format, ap);
|
||||
else if(FCGI_stdout->fcgx_stream)
|
||||
return FCGX_VFPrintF(FCGI_stdout->fcgx_stream, format, ap);
|
||||
return EOF;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_fread, FCGI_fwrite --
|
||||
*
|
||||
* Wrappers for functions defined in H&S Section 15.13
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
size_t FCGI_fread(void *ptr, size_t size, size_t nmemb, FCGI_FILE *fp)
|
||||
{
|
||||
int n;
|
||||
if(fp->stdio_stream)
|
||||
return fread(ptr, size, nmemb, fp->stdio_stream);
|
||||
else if(fp->fcgx_stream) {
|
||||
if((size * nmemb) == 0) {
|
||||
return 0;
|
||||
}
|
||||
ASSERT(size * nmemb < (size_t)INT_MAX);
|
||||
n = FCGX_GetStr((char *) ptr, (int)(size * nmemb), fp->fcgx_stream);
|
||||
ASSERT(n >= 0);
|
||||
return ((size_t)n/size);
|
||||
}
|
||||
return (size_t)EOF;
|
||||
}
|
||||
|
||||
size_t FCGI_fwrite(void *ptr, size_t size, size_t nmemb, FCGI_FILE *fp)
|
||||
{
|
||||
int n;
|
||||
if(fp->stdio_stream)
|
||||
return fwrite(ptr, size, nmemb, fp->stdio_stream);
|
||||
else if(fp->fcgx_stream) {
|
||||
if((size * nmemb) == 0) {
|
||||
return 0;
|
||||
}
|
||||
ASSERT(size * nmemb < (size_t)INT_MAX);
|
||||
n = (size_t)FCGX_PutStr((char *) ptr, (int)(size * nmemb), fp->fcgx_stream);
|
||||
ASSERT(n >= 0);
|
||||
return ((size_t)n/size);
|
||||
}
|
||||
return (size_t)EOF;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_feof, FCGI_ferror, FCGI_clearerr --
|
||||
*
|
||||
* Wrappers for functions defined in H&S Section 15.14
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
int FCGI_feof(FCGI_FILE *fp)
|
||||
{
|
||||
if(fp->stdio_stream) {
|
||||
return feof(fp->stdio_stream);
|
||||
} else if (fp->fcgx_stream){
|
||||
return FCGX_HasSeenEOF(fp->fcgx_stream);
|
||||
}
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
int FCGI_ferror(FCGI_FILE *fp)
|
||||
{
|
||||
if(fp->stdio_stream) {
|
||||
return ferror(fp->stdio_stream);
|
||||
} else if(fp->fcgx_stream) {
|
||||
return FCGX_GetError(fp->fcgx_stream);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void FCGI_clearerr(FCGI_FILE *fp)
|
||||
{
|
||||
if(fp->stdio_stream) {
|
||||
clearerr(fp->stdio_stream);
|
||||
} else if(fp->fcgx_stream) {
|
||||
FCGX_ClearError(fp->fcgx_stream);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_tmpfile --
|
||||
*
|
||||
* Wrappers for function defined in H&S Section 15.16
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
FCGI_FILE *FCGI_tmpfile(void)
|
||||
{
|
||||
FILE * file = tmpfile();
|
||||
FCGI_FILE * fcgi_file = FCGI_OpenFromFILE(file);
|
||||
|
||||
if (file && !fcgi_file)
|
||||
fclose(file);
|
||||
|
||||
return fcgi_file;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FCGI_fileno, FCGI_fdopen, FCGI_popen, FCGI_pclose --
|
||||
*
|
||||
* Wrappers for POSIX, X/OPEN functions not in ISO C
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
int FCGI_fileno(FCGI_FILE *fp)
|
||||
{
|
||||
if(fp->stdio_stream)
|
||||
return fileno(fp->stdio_stream);
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
FCGI_FILE *FCGI_fdopen(int fd, const char *mode)
|
||||
{
|
||||
FILE * file = fdopen(fd, mode);
|
||||
FCGI_FILE * fcgi_file = FCGI_OpenFromFILE(file);
|
||||
|
||||
if (file && !fcgi_file)
|
||||
fclose(file);
|
||||
|
||||
return fcgi_file;
|
||||
}
|
||||
|
||||
FCGI_FILE *FCGI_popen(const char *cmd, const char *type)
|
||||
{
|
||||
FILE * file = popen(cmd, type);
|
||||
FCGI_FILE * fcgi_file = FCGI_OpenFromFILE(file);
|
||||
|
||||
if (file && !fcgi_file)
|
||||
pclose(file);
|
||||
|
||||
return fcgi_file;
|
||||
}
|
||||
|
||||
int FCGI_pclose(FCGI_FILE *fp)
|
||||
{
|
||||
int n = EOF;
|
||||
if (fp->stdio_stream) {
|
||||
n = pclose(fp->stdio_stream);
|
||||
fp->stdio_stream = NULL;
|
||||
} else if(fp->fcgx_stream) {
|
||||
/*
|
||||
* The caller is deeply confused; don't free the storage.
|
||||
*/
|
||||
return EOF;
|
||||
}
|
||||
if((fp != FCGI_stdin) && (fp != FCGI_stdout) && (fp != FCGI_stderr)) {
|
||||
free(fp);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
2349
library/server/libfcgi/Clib/libfcgi/libfcgi/fcgiapp.c
Normal file
2349
library/server/libfcgi/Clib/libfcgi/libfcgi/fcgiapp.c
Normal file
File diff suppressed because it is too large
Load Diff
203
library/server/libfcgi/Clib/libfcgi/libfcgi/fcgio.cpp
Normal file
203
library/server/libfcgi/Clib/libfcgi/libfcgi/fcgio.cpp
Normal file
@@ -0,0 +1,203 @@
|
||||
//
|
||||
// $Id: fcgio.cpp,v 1.13 2002/02/24 20:12:22 robs Exp $
|
||||
//
|
||||
// Allows you communicate with FastCGI streams using C++ iostreams
|
||||
//
|
||||
// ORIGINAL AUTHOR: George Feinberg
|
||||
// REWRITTEN BY: Michael Richards 06/20/1999
|
||||
// REWRITTEN AGAIN BY: Michael Shell 02/23/2000
|
||||
// REWRITTEN AGAIN BY: Rob Saccoccio 11 Nov 2001
|
||||
//
|
||||
// Copyright (c) 2000 Tux the Linux Penguin
|
||||
//
|
||||
// You are free to use this software without charge or royalty
|
||||
// as long as this notice is not removed or altered, and recognition
|
||||
// is given to the author(s)
|
||||
//
|
||||
// This code is offered as-is without any warranty either expressed or
|
||||
// implied; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
#ifdef _WIN32
|
||||
#define DLLAPI __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <stdint.h>
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include "fcgio.h"
|
||||
#include "fcgimisc.h"
|
||||
|
||||
using std::streambuf;
|
||||
using std::istream;
|
||||
using std::ostream;
|
||||
using std::streamsize;
|
||||
|
||||
fcgi_streambuf::fcgi_streambuf(FCGX_Stream * fs, char * b, int bs)
|
||||
{
|
||||
init(fs, b, bs);
|
||||
}
|
||||
|
||||
fcgi_streambuf::fcgi_streambuf(char_type * b, streamsize bs)
|
||||
{
|
||||
init(0, b, bs);
|
||||
}
|
||||
|
||||
fcgi_streambuf::fcgi_streambuf(FCGX_Stream * fs)
|
||||
{
|
||||
init(fs, 0, 0);
|
||||
}
|
||||
|
||||
fcgi_streambuf::~fcgi_streambuf(void)
|
||||
{
|
||||
overflow(EOF);
|
||||
// FCGX_Finish()/FCGX_Accept() will flush and close
|
||||
}
|
||||
|
||||
void fcgi_streambuf::init(FCGX_Stream * fs, char_type * b, streamsize bs)
|
||||
{
|
||||
this->fcgx = fs;
|
||||
this->buf = 0;
|
||||
this->bufsize = 0;
|
||||
setbuf(b, bs);
|
||||
}
|
||||
|
||||
int fcgi_streambuf::overflow(int c)
|
||||
{
|
||||
if (this->bufsize)
|
||||
{
|
||||
intptr_t plen = pptr() - pbase();
|
||||
|
||||
if (plen)
|
||||
{
|
||||
ASSERT(0 <= plen && plen <= INT_MAX);
|
||||
if (FCGX_PutStr(pbase(), (int)plen, this->fcgx) != plen) return EOF;
|
||||
pbump((int)(-plen));
|
||||
}
|
||||
}
|
||||
|
||||
if (c != EOF)
|
||||
{
|
||||
if (FCGX_PutChar(c, this->fcgx) != c) return EOF;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// default base class behaviour seems to be inconsistent
|
||||
int fcgi_streambuf::sync()
|
||||
{
|
||||
if (overflow(EOF)) return EOF;
|
||||
if (FCGX_FFlush(this->fcgx)) return EOF;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// uflow() removes the char, underflow() doesn't
|
||||
int fcgi_streambuf::uflow()
|
||||
{
|
||||
int rv = underflow();
|
||||
if (this->bufsize) gbump(1);
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Note that the expected behaviour when there is no buffer varies
|
||||
int fcgi_streambuf::underflow()
|
||||
{
|
||||
if (this->bufsize)
|
||||
{
|
||||
if (in_avail() == 0)
|
||||
{
|
||||
ASSERT(0 <= this->bufsize && this->bufsize <= INT_MAX);
|
||||
int glen = FCGX_GetStr(eback(), (int)(this->bufsize), this->fcgx);
|
||||
if (glen <= 0) return EOF;
|
||||
|
||||
setg(eback(), eback(), eback() + glen);
|
||||
}
|
||||
|
||||
return (unsigned char) *gptr();
|
||||
}
|
||||
else
|
||||
{
|
||||
return FCGX_GetChar(this->fcgx);
|
||||
}
|
||||
}
|
||||
|
||||
void fcgi_streambuf::reset(void)
|
||||
{
|
||||
// it should be ok to set up both the get and put areas
|
||||
setg(this->buf, this->buf, this->buf);
|
||||
setp(this->buf, this->buf + this->bufsize);
|
||||
}
|
||||
|
||||
std::streambuf * fcgi_streambuf::setbuf(char_type * b, streamsize bs)
|
||||
{
|
||||
// XXX support moving data from an old buffer
|
||||
if (this->bufsize) return 0;
|
||||
|
||||
this->buf = b;
|
||||
this->bufsize = bs;
|
||||
|
||||
// the base setbuf() *has* to be called
|
||||
streambuf::setbuf(b, bs);
|
||||
|
||||
reset();
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
int fcgi_streambuf::attach(FCGX_Stream * fs)
|
||||
{
|
||||
this->fcgx = fs;
|
||||
|
||||
if (this->bufsize)
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
streamsize fcgi_streambuf::xsgetn(char_type * s, streamsize n)
|
||||
{
|
||||
if (n > INT_MAX) return 0;
|
||||
return (this->bufsize)
|
||||
? streambuf::xsgetn(s, n)
|
||||
: (streamsize) FCGX_GetStr((char *) s, (int) n, this->fcgx);
|
||||
}
|
||||
|
||||
streamsize fcgi_streambuf::xsputn(const char_type * s, streamsize n)
|
||||
{
|
||||
if (n > INT_MAX) return 0;
|
||||
return (this->bufsize)
|
||||
? streambuf::xsputn(s, n)
|
||||
: (streamsize) FCGX_PutStr((char *) s, (int) n, this->fcgx);
|
||||
}
|
||||
|
||||
// deprecated
|
||||
fcgi_istream::fcgi_istream(FCGX_Stream * fs) :
|
||||
istream(&fcgi_strmbuf)
|
||||
{
|
||||
fcgi_strmbuf.attach(fs);
|
||||
}
|
||||
|
||||
// deprecated
|
||||
void fcgi_istream::attach(FCGX_Stream * fs)
|
||||
{
|
||||
fcgi_strmbuf.attach(fs);
|
||||
}
|
||||
|
||||
// deprecated
|
||||
fcgi_ostream::fcgi_ostream(FCGX_Stream * fs) :
|
||||
ostream(&fcgi_strmbuf)
|
||||
{
|
||||
fcgi_strmbuf.attach(fs);
|
||||
}
|
||||
|
||||
// deprecated
|
||||
void fcgi_ostream::attach(FCGX_Stream * fs)
|
||||
{
|
||||
fcgi_strmbuf.attach(fs);
|
||||
}
|
||||
311
library/server/libfcgi/Clib/libfcgi/libfcgi/libfcgi.mak
Normal file
311
library/server/libfcgi/Clib/libfcgi/libfcgi/libfcgi.mak
Normal file
@@ -0,0 +1,311 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on libfcgi.dsp
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=release
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "release" && "$(CFG)" != "debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "libfcgi.mak" CFG="debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "release"
|
||||
|
||||
OUTDIR=.\..\libfcgi\Release
|
||||
INTDIR=.\..\libfcgi\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\..\libfcgi\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\libfcgi.dll"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\fcgi_stdio.obj"
|
||||
-@erase "$(INTDIR)\fcgiapp.obj"
|
||||
-@erase "$(INTDIR)\fcgio.obj"
|
||||
-@erase "$(INTDIR)\os_win32.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\libfcgi.dll"
|
||||
-@erase "$(OUTDIR)\libfcgi.exp"
|
||||
-@erase "$(OUTDIR)\libfcgi.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MD /W3 /O2 /Ob2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\libfcgi.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\libfcgi.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=Ws2_32.lib /nologo /dll /pdb:none /machine:I386 /out:"$(OUTDIR)\libfcgi.dll" /implib:"$(OUTDIR)\libfcgi.lib"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\fcgi_stdio.obj" \
|
||||
"$(INTDIR)\fcgiapp.obj" \
|
||||
"$(INTDIR)\fcgio.obj" \
|
||||
"$(INTDIR)\os_win32.obj"
|
||||
|
||||
"$(OUTDIR)\libfcgi.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "debug"
|
||||
|
||||
OUTDIR=.\..\libfcgi\Debug
|
||||
INTDIR=.\..\libfcgi\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\..\libfcgi\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\libfcgi.dll" "$(OUTDIR)\libfcgi.bsc"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\fcgi_stdio.obj"
|
||||
-@erase "$(INTDIR)\fcgi_stdio.sbr"
|
||||
-@erase "$(INTDIR)\fcgiapp.obj"
|
||||
-@erase "$(INTDIR)\fcgiapp.sbr"
|
||||
-@erase "$(INTDIR)\fcgio.obj"
|
||||
-@erase "$(INTDIR)\fcgio.sbr"
|
||||
-@erase "$(INTDIR)\os_win32.obj"
|
||||
-@erase "$(INTDIR)\os_win32.sbr"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\libfcgi.bsc"
|
||||
-@erase "$(OUTDIR)\libfcgi.dll"
|
||||
-@erase "$(OUTDIR)\libfcgi.exp"
|
||||
-@erase "$(OUTDIR)\libfcgi.lib"
|
||||
-@erase "$(OUTDIR)\libfcgi.map"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MDd /W4 /Gm /Gi /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\libfcgi.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\libfcgi.bsc"
|
||||
BSC32_SBRS= \
|
||||
"$(INTDIR)\fcgi_stdio.sbr" \
|
||||
"$(INTDIR)\fcgiapp.sbr" \
|
||||
"$(INTDIR)\fcgio.sbr" \
|
||||
"$(INTDIR)\os_win32.sbr"
|
||||
|
||||
"$(OUTDIR)\libfcgi.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
|
||||
$(BSC32) @<<
|
||||
$(BSC32_FLAGS) $(BSC32_SBRS)
|
||||
<<
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=Ws2_32.lib /nologo /dll /profile /map:"$(INTDIR)\libfcgi.map" /debug /machine:I386 /out:"$(OUTDIR)\libfcgi.dll" /implib:"$(OUTDIR)\libfcgi.lib"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\fcgi_stdio.obj" \
|
||||
"$(INTDIR)\fcgiapp.obj" \
|
||||
"$(INTDIR)\fcgio.obj" \
|
||||
"$(INTDIR)\os_win32.obj"
|
||||
|
||||
"$(OUTDIR)\libfcgi.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
..\libfcgi\fcgi_stdio.c : \
|
||||
"..\include\fcgi_config.h"\
|
||||
"..\include\fcgi_stdio.h"\
|
||||
"..\include\fcgiapp.h"\
|
||||
"..\include\fcgimisc.h"\
|
||||
"..\include\fcgios.h"\
|
||||
|
||||
|
||||
..\libfcgi\fcgiapp.c : \
|
||||
"..\include\fastcgi.h"\
|
||||
"..\include\fcgi_config.h"\
|
||||
"..\include\fcgiapp.h"\
|
||||
"..\include\fcgimisc.h"\
|
||||
"..\include\fcgios.h"\
|
||||
|
||||
|
||||
..\libfcgi\fcgio.cpp : \
|
||||
"..\include\fcgiapp.h"\
|
||||
"..\include\fcgio.h"\
|
||||
|
||||
|
||||
..\libfcgi\os_win32.c : \
|
||||
"..\include\fcgi_config.h"\
|
||||
"..\include\fcgimisc.h"\
|
||||
"..\include\fcgios.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "release" || "$(CFG)" == "debug"
|
||||
SOURCE=..\libfcgi\fcgi_stdio.c
|
||||
|
||||
!IF "$(CFG)" == "release"
|
||||
|
||||
|
||||
"$(INTDIR)\fcgi_stdio.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "debug"
|
||||
|
||||
|
||||
"$(INTDIR)\fcgi_stdio.obj" "$(INTDIR)\fcgi_stdio.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=..\libfcgi\fcgiapp.c
|
||||
|
||||
!IF "$(CFG)" == "release"
|
||||
|
||||
|
||||
"$(INTDIR)\fcgiapp.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "debug"
|
||||
|
||||
|
||||
"$(INTDIR)\fcgiapp.obj" "$(INTDIR)\fcgiapp.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=..\libfcgi\fcgio.cpp
|
||||
|
||||
!IF "$(CFG)" == "release"
|
||||
|
||||
CPP_SWITCHES=/nologo /MD /W3 /GX /O2 /Ob2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\libfcgi.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
"$(INTDIR)\fcgio.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) @<<
|
||||
$(CPP_SWITCHES) $(SOURCE)
|
||||
<<
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "debug"
|
||||
|
||||
CPP_SWITCHES=/nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\libfcgi.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
"$(INTDIR)\fcgio.obj" "$(INTDIR)\fcgio.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) @<<
|
||||
$(CPP_SWITCHES) $(SOURCE)
|
||||
<<
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=..\libfcgi\os_unix.c
|
||||
SOURCE=..\libfcgi\os_win32.c
|
||||
|
||||
!IF "$(CFG)" == "release"
|
||||
|
||||
|
||||
"$(INTDIR)\os_win32.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "debug"
|
||||
|
||||
|
||||
"$(INTDIR)\os_win32.obj" "$(INTDIR)\os_win32.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=..\libfcgi\strerror.c
|
||||
|
||||
!ENDIF
|
||||
|
||||
1293
library/server/libfcgi/Clib/libfcgi/libfcgi/os_unix.c
Normal file
1293
library/server/libfcgi/Clib/libfcgi/libfcgi/os_unix.c
Normal file
File diff suppressed because it is too large
Load Diff
1918
library/server/libfcgi/Clib/libfcgi/libfcgi/os_win32.c
Normal file
1918
library/server/libfcgi/Clib/libfcgi/libfcgi/os_win32.c
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user