debian/0000775000000000000000000000000012254434670007177 5ustar debian/source/0000775000000000000000000000000012012162751010465 5ustar debian/source/format0000664000000000000000000000001412012151647011675 0ustar 3.0 (quilt) debian/libfcgi-dev.install0000664000000000000000000000007212012151647012731 0ustar usr/include/* usr/lib/lib*.a usr/lib/lib*.so usr/lib/*.la debian/copyright0000664000000000000000000000371612012151647011131 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Source: http://www.fastcgi.com/#TheDevKit Files: * Copyright: 1996 Open Market, Inc. License: FASTCGI Files: debian/* Copyright: Tatsuki Sugiura License: FASTCGI License: FASTCGI 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. debian/compat0000664000000000000000000000000212012151647010365 0ustar 7 debian/shlibs.local0000664000000000000000000000010312012151647011461 0ustar liblibfcgi 0.0.0 libfcgi0c0 (>> 2.4.0-0), libfcgi0c0 (<< 2.4.0-99) debian/libfcgi0ldbl.docs0000664000000000000000000000001512012151647012352 0ustar README doc/* debian/libfcgi0ldbl.manpages0000664000000000000000000000002212012151647013213 0ustar debian/cgi-fcgi.1 debian/changelog0000664000000000000000000000714212254434667011063 0ustar libfcgi (2.4.0-8.1ubuntu5) trusty; urgency=medium * Build with dh-autoreconf for new libtool. * debian/patches/automake-foreign: Fix AM_INIT_AUTOMAKE to not assume existence of GNU docs. * debian/patches/re-libtoolize: Drop. Superseded by autoreconf. -- William Grant Wed, 18 Dec 2013 23:50:10 +0000 libfcgi (2.4.0-8.1ubuntu4) saucy; urgency=low * Use dh_autotools-dev to update config.{sub,guess} for AArch64. -- Matthias Klose Thu, 10 Oct 2013 14:05:17 +0200 libfcgi (2.4.0-8.1ubuntu3) quantal; urgency=low * d/patches/re-libtoolize: Updated acinclude.m4 to correctly detect features in if header is present, regenerated tooling. * d/patches/fix_compiler_warnings.patch: Fixup misc complier warnings in the codebase. -- James Page Mon, 13 Aug 2012 12:30:49 +0100 libfcgi (2.4.0-8.1ubuntu2) quantal; urgency=low * d/rules,control: Remove dependency_libs from .la files inline with recommendation from Ubuntu MIR review, specify debhelper (>= 7.0.50~) for override usage. * d/libfcgi0ldbl.manpages,rules: Don't install manpage using rules file. * d/libfcgi0ldbl.docs: Rationalized to prevent duplicate install of docs. * d/dirs: Dropped - not actually required and generates linitan warning. * d/control,rules: Drop use of quilt dh addon as this is provided by debhelper. * d/control: Bumped Standards-Version to 3.9.3: - d/copyright: Converted to machine readable format. -- James Page Fri, 20 Jul 2012 10:44:55 +0100 libfcgi (2.4.0-8.1ubuntu1) quantal; urgency=low * Applying patch to use poll instead of select which helps handle more than 1024 connections. (LP: #933417). Thanks Anton Kortunov! -- Clint Byrum Sat, 14 Jul 2012 08:20:42 -0700 libfcgi (2.4.0-8.1) unstable; urgency=low * Non-maintainer upload. * Apply patch from Stefan Potyra to fix indirect linking with recent binutils version. Closes: #555178. -- Aurelien Jarno Sat, 20 Aug 2011 23:39:54 +0200 libfcgi (2.4.0-8) unstable; urgency=low * Switch to dpkg-source 3.0 (quilt) format * Add section on source package (Closes: #568227) -- Tatsuki Sugiura Sat, 23 Jan 2010 19:06:39 +0900 libfcgi (2.4.0-7.1) unstable; urgency=low * Non-maintainer upload. * Fix FTBFS with GCC 4.4, thanks to Martin Michlmayr (Closes: #504963) -- David Paleino Mon, 21 Dec 2009 15:45:39 +0100 libfcgi (2.4.0-7) unstable; urgency=low * rebuild for long double 128bit transition. (Closes: #430250) * update autotools scripts -- Tatsuki Sugiura Tue, 5 Sep 2006 18:11:06 +0900 libfcgi (2.4.0-6) unstable; urgency=low * rebuild for new libstdc++ -- Tatsuki Sugiura Tue, 5 Sep 2006 08:19:25 +0900 libfcgi (2.4.0-5) unstable; urgency=low * fixed: package description (Closes: #226030) -- Tatsuki Sugiura Mon, 5 Jan 2004 18:40:30 +0900 libfcgi (2.4.0-4) unstable; urgency=low * re-libtoolize for mips and mipsel (Closes: #213951) -- Tatsuki Sugiura Tue, 18 Nov 2003 05:39:33 +0900 libfcgi (2.4.0-3) unstable; urgency=low * upload official debian archive agein (Closes: #203590) -- Tatsuki Sugiura Sun, 21 Sep 2003 04:45:12 +0900 libfcgi (2.4.0-2) unstable; urgency=low * upload official debian archive (Closes: #203590) -- Tatsuki Sugiura Mon, 8 Sep 2003 16:11:52 +0900 libfcgi (2.4.0-1) unstable; urgency=low * Initial Release. -- Tatsuki Sugiura Tue, 8 Jul 2003 13:58:36 +0900 debian/libfcgi0ldbl.install0000664000000000000000000000003412012151647013071 0ustar usr/bin/* usr/lib/lib*.so.* debian/cgi-fcgi.10000664000000000000000000001131212012151647010717 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH cgi-fcgi 1 1997-09-17 .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME cgi-fcgi \- bridge from CGI to FastCGI .SH SYNOPSIS .B cgi-fcgi -f cmdPath .br .B cgi-fcgi -bind -connect connName .br .B cgi-fcgi -start -connect connName appPath [nServers] .br .B cgi-fcgi -connect connName appPath [nServers] .SH DESCRIPTION .PP cgi-fcgi is a CGI/1.1 program that communicates with an already-running FastCGI application in order to respond to an HTTP request. cgi-fcgi is also capable of starting a FastCGI application. .PP When you invoke cgi-fcgi as .IP .B cgi-fcgi -f cmdPath .PP then cgi-fcgi opens the file at cmdPath and reads its arguments from that file. cgi-fcgi will skip lines that begin with the comment character #. The first non-comment line should contain valid arguments in one of the other three forms. .PP The -f form of cgi-fcgi is designed for Unix systems whose exec(2) family of system calls supports the execution of command interpreter files. For instance, if a file with execute permission contains the text .IP #! /bin/cgi-fcgi -f .br -connect /httpd/root/sock/app /httpd/root/bin/app .PP the effect is the same as executing .IP /usr/bin/cgi-fcgi -connect /httpd/root/sock/app /httpd/root/bin/app .PP When you invoke cgi-fcgi as .IP cgi-fcgi -bind -connect connName .PP the connName argument is either the path name of a Unix domain listening socket or a host:port pair. If connName contains a colon, it is assumed to be host:port. cgi-fcgi performs a connect(2) using connName. If the connect succeeds, cgi-fcgi forwards the CGI environment variables and stdin data to the FastCGI application, and forwards the stdout and stderr data from the application to cgi-fcgi's stdout (most likely connected to a Web server). When the FastCGI application signals the end of its response, cgi-fcgi flushes its buffers and exits, and the Web server completes the http response. .PP When you invoke cgi-fcgi as .IP cgi-fcgi -start -connect connName appPath [nServers] .PP then cgi-fcgi performs the function of starting one or more FastCGI application processes. The connName argument specifies either the path name of the Unix domain listening socket that cgi-fcgi will create, or is "localhost:NNN" where NNN is the port number of the TCP/IP listening socket that cgi-fcgi will create on the local machine. (cgi-fcgi will not create processes on remote machines.) After cgi-fcgi creates the listening socket, it forks nServers copies of a process running the executable file appPath. If nServers is omitted, the effect is as if the value "1" had been specified. The processes share the single listening socket. .PP When you invoke cgi-fcgi as .IP cgi-fcgi -connect connName appPath [nServers] .PP cgi-fcgi performs -bind and then, if necssary, performs -start and repeats the -bind. That is, cgi-fcgi first operates as if the command had been .IP cgi-fcgi -bind -connect connName .PP If the connect fails, cgi-fcgi tries .IP cgi-fcgi -start -connect connName appPath [nServers] .PP and finally retries .IP cgi-fcgi -bind -connect connName .PP In this form, cgi-fcgi does not support TCP/IP connections. .SH ENVIRONMENT VARIABLES The usual CGI ones, but they are not interpreted by cgi-fcgi. .SH SEE ALSO .BR FGCI_accept (3). (in Debian, /usr/share/doc/libfcgi?/*) .SH BUGS cgi-fcgi doesn't generate useful HTTP responses in case of error, and it generates no response at all when run as start-fcgi. .PP On Digital UNIX 3.0 systems the implementation of Unix Domain sockets does not work when such sockets are stored on NFS file systems. Symptom: cgi-fcgi may core dump or may exit with status 38. Work-around: store sockets in local file systems (/tmp often works) or use TCP/IP. .PP On AIX systems the implementation of listening sockets does not support socket sharing, and the standard FastCGI application libraries can't synchronize access to AIX listening sockets. Work-around: Don't use the nServers argument on AIX. .SH HISTORY 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: cgi-fcgi.1,v 1.1.1.1 1997/09/16 15:36:26 stanleyg Exp $ debian/control0000664000000000000000000000176612254433124010605 0ustar Source: libfcgi Section: libs Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Tatsuki Sugiura Build-Depends: debhelper (>= 7.0.50~), dh-autoreconf Standards-Version: 3.9.3 Uploaders: Taku YASUI Homepage: http://www.fastcgi.com/drupal/ Package: libfcgi-dev Section: libdevel Architecture: any Depends: libfcgi0ldbl (= ${binary:Version}), ${misc:Depends} Description: Header files of FastCGI FastCGI is a language independent, scalable, open extension to CGI that provides high performance without the limitations of server specific APIs. Package: libfcgi0ldbl Provides: libfcgi Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Conflicts: libfcgi0, libfcgi0c2 Replaces: libfcgi0, libfcgi0c2 Description: Shared library of FastCGI FastCGI is a language independent, scalable, open extension to CGI that provides high performance without the limitations of server specific APIs. debian/watch0000664000000000000000000000042412012151647010220 0ustar # Example watch control file for uscan # Rename this file to "watch" and then you can run the "uscan" command # to check for upstream updates and more. # Site Directory Pattern Version Script version=2 http://www.fastcgi.com/dist/ fcgi-([0-9\.-]*)\.tar\.gz debian uupdate debian/patches/0000775000000000000000000000000012254434203010616 5ustar debian/patches/series0000664000000000000000000000013612254434203012033 0ustar binutils-indirect-linking gcc44-fix-include poll fix_compiler_warnings.patch automake-foreign debian/patches/automake-foreign0000664000000000000000000000101112254434050013767 0ustar Index: libfcgi-2.4.0/configure.in =================================================================== --- libfcgi-2.4.0.orig/configure.in 2003-01-20 04:19:41.000000000 +1100 +++ libfcgi-2.4.0/configure.in 2013-12-19 11:04:53.730490238 +1100 @@ -4,8 +4,8 @@ dnl generate the file "configure", which is run during the build dnl to configure the system for the local environment. -AC_INIT -AM_INIT_AUTOMAKE(fcgi, 2.4.0) +AC_INIT([fcgi], [2.4.0]) +AM_INIT_AUTOMAKE([foreign]) AM_CONFIG_HEADER(fcgi_config.h) debian/patches/poll0000664000000000000000000000524712012151647011517 0ustar Author: Anton Kortunov Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfcgi/+bug/933417 Description: use poll in os_unix.c instead of select to avoid problem with > 1024 connections Forwarded: yes, fastcgi-developers@mailman.fastcgi.com diff --git a/libfcgi/os_unix.c b/libfcgi/os_unix.c index 73e6a7f..af35aee 100755 --- a/libfcgi/os_unix.c +++ b/libfcgi/os_unix.c @@ -42,6 +42,7 @@ static const char rcsid[] = "$Id: os_unix.c,v 1.37 2002/03/05 19:14:49 robs Exp #include #include #include +#include #ifdef HAVE_NETDB_H #include @@ -103,6 +104,9 @@ static int volatile maxFd = -1; static int shutdownPending = FALSE; static int shutdownNow = FALSE; +static int libfcgiOsClosePollTimeout = 2000; +static int libfcgiIsAfUnixKeeperPollTimeout = 2000; + void OS_ShutdownPending() { shutdownPending = TRUE; @@ -168,6 +172,16 @@ int OS_LibInit(int stdioFds[3]) if(libInitialized) return 0; + char *libfcgiOsClosePollTimeoutStr = getenv( "LIBFCGI_OS_CLOSE_POLL_TIMEOUT" ); + if(libfcgiOsClosePollTimeoutStr) { + libfcgiOsClosePollTimeout = atoi(libfcgiOsClosePollTimeoutStr); + } + + char *libfcgiIsAfUnixKeeperPollTimeoutStr = getenv( "LIBFCGI_IS_AF_UNIX_KEEPER_POLL_TIMEOUT" ); + if(libfcgiIsAfUnixKeeperPollTimeoutStr) { + libfcgiIsAfUnixKeeperPollTimeout = atoi(libfcgiIsAfUnixKeeperPollTimeoutStr); + } + asyncIoTable = (AioInfo *)malloc(asyncIoTableSize * sizeof(AioInfo)); if(asyncIoTable == NULL) { errno = ENOMEM; @@ -755,19 +769,16 @@ int OS_Close(int fd) if (shutdown(fd, 1) == 0) { - struct timeval tv; - fd_set rfds; + struct pollfd pfd; int rv; char trash[1024]; - FD_ZERO(&rfds); + pfd.fd = fd; + pfd.events = POLLIN; do { - FD_SET(fd, &rfds); - tv.tv_sec = 2; - tv.tv_usec = 0; - rv = select(fd + 1, &rfds, NULL, NULL, &tv); + rv = poll(&pfd, 1, libfcgiOsClosePollTimeout); } while (rv > 0 && read(fd, trash, sizeof(trash)) > 0); } @@ -1116,13 +1127,11 @@ static int is_reasonable_accept_errno (const int error) */ static int is_af_unix_keeper(const int fd) { - struct timeval tval = { READABLE_UNIX_FD_DROP_DEAD_TIMEVAL }; - fd_set read_fds; - - FD_ZERO(&read_fds); - FD_SET(fd, &read_fds); + struct pollfd pfd; + pfd.fd = fd; + pfd.events = POLLIN; - return select(fd + 1, &read_fds, NULL, NULL, &tval) >= 0 && FD_ISSET(fd, &read_fds); + return poll(&pfd, 1, libfcgiIsAfUnixKeeperPollTimeout) >= 0 && (pfd.revents & POLLIN); } /* debian/patches/fix_compiler_warnings.patch0000664000000000000000000000750112012161144016223 0ustar Description: Fix up compiler warnings in codebase, including: - Unwind complex deferencing of pointers resolving: "warning: dereferencing type-punned pointer will break strict-aliasing rules" - Remove unused variable from the codebase: "warning: variable 'numFDs' set but not used" - Cast parameters properly for formatting in fprintf: "warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t'" - Interim cast to intprt_t when passing FD's as ClientData pointers: "warning: cast to pointer from integer of different size" Author: James Page Bug-Ubuntu: https://bugs.launchpad.net/bugs/1017978 Forwarded: yes, fastcgi-developers@mailman.fastcgi.com --- a/libfcgi/fcgiapp.c +++ b/libfcgi/fcgiapp.c @@ -1486,16 +1486,17 @@ static int ProcessManagementRecord(int t } len = responseP - &response[FCGI_HEADER_LEN]; paddedLen = AlignInt8(len); - *((FCGI_Header *) response) - = MakeHeader(FCGI_GET_VALUES_RESULT, FCGI_NULL_REQUEST_ID, - len, paddedLen - len); + FCGI_Header *header = (FCGI_Header *)response; + *header = MakeHeader(FCGI_GET_VALUES_RESULT, FCGI_NULL_REQUEST_ID, + len, paddedLen - len); FreeParams(¶msPtr); } else { paddedLen = len = sizeof(FCGI_UnknownTypeBody); - ((FCGI_UnknownTypeRecord *) response)->header + FCGI_UnknownTypeRecord *utr = (FCGI_UnknownTypeRecord *) response; + utr->header = MakeHeader(FCGI_UNKNOWN_TYPE, FCGI_NULL_REQUEST_ID, len, 0); - ((FCGI_UnknownTypeRecord *) response)->body + utr->body = MakeUnknownTypeBody(type); } if (write_it_all(data->reqDataPtr->ipcFd, response, FCGI_HEADER_LEN + paddedLen) < 0) { --- a/cgi-fcgi/cgi-fcgi.c +++ b/cgi-fcgi/cgi-fcgi.c @@ -386,8 +386,8 @@ static void WebServerReadHandler(ClientD if(bytesRead < 0) { exit(OS_Errno); } - *((FCGI_Header *) &fromWS.buff[0]) - = MakeHeader(FCGI_STDIN, requestId, bytesRead, 0); + FCGI_Header *header = (FCGI_Header *) &fromWS.buff[0]; + *header = MakeHeader(FCGI_STDIN, requestId, bytesRead, 0); bytesToRead -= bytesRead; fromWS.stop = &fromWS.buff[sizeof(FCGI_Header) + bytesRead]; webServerReadHandlerEOF = (bytesRead == 0); @@ -458,7 +458,7 @@ static void ScheduleIo(void) ((length = fromWS.stop - fromWS.next) != 0)) { if(OS_AsyncWrite(appServerSock, 0, fromWS.next, length, AppServerWriteHandler, - (ClientData)appServerSock) == -1) { + (ClientData)(intptr_t)appServerSock) == -1) { FCGIexit(OS_Errno); } else { fcgiWritePending = TRUE; @@ -474,7 +474,7 @@ static void ScheduleIo(void) if(OS_AsyncRead(appServerSock, 0, fromAS.next, BUFFLEN, AppServerReadHandler, - (ClientData)appServerSock) == -1) { + (ClientData)(intptr_t)appServerSock) == -1) { FCGIexit(OS_Errno); } else { fcgiReadPending = TRUE; @@ -640,7 +640,7 @@ static int ParseArgs(int argc, char *arg } if((av[ac] = (char *)malloc(strlen(tp1)+1)) == NULL) { fprintf(stderr, "Cannot allocate %d bytes\n", - strlen(tp1)+1); + (int)strlen(tp1)+1); exit(-1); } strcpy(av[ac++], tp1); @@ -722,7 +722,6 @@ int main(int argc, char **argv) char **envp = environ; int count; FCGX_Stream *paramsStream; - int numFDs; unsigned char headerBuff[8]; int headerLen, valueLen; char *equalPtr; @@ -821,10 +820,6 @@ int main(int argc, char **argv) */ fromWS.stop = fromWS.next = &fromWS.buff[0]; webServerReadHandlerEOF = FALSE; - /* - * XXX: might want to use numFDs in the os library. - */ - numFDs = max(appServerSock, STDIN_FILENO) + 1; OS_SetFlags(appServerSock, O_NONBLOCK); if (bytesToRead <= 0) debian/patches/gcc44-fix-include0000664000000000000000000000166412012151647013661 0ustar Description: Upstream changes introduced in version 2.4.0-8 This patch has been created by dpkg-source during the package build. Here's the last changelog entry, hopefully it gives details on why those changes were made: . libfcgi (2.4.0-8) unstable; urgency=low . * Switch to dpkg-source 3.0 (quilt) format . The person named in the Author field signed this changelog entry. Author: Tatsuki Sugiura Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504963 Bug-Debian: http://bugs.debian.org/504963 Forwarded: no Last-Update: 2010-02-08 Index: libfcgi/libfcgi/fcgio.cpp =================================================================== --- libfcgi.orig/libfcgi/fcgio.cpp 2010-01-23 19:13:53.000000000 +0900 +++ libfcgi/libfcgi/fcgio.cpp 2010-01-23 19:13:55.000000000 +0900 @@ -22,6 +22,7 @@ #define DLLAPI __declspec(dllexport) #endif +#include #include #include "fcgio.h" debian/patches/binutils-indirect-linking0000664000000000000000000000057012012151647015624 0ustar --- libfcgi-2.4.0.orig/examples/Makefile.am +++ libfcgi-2.4.0/examples/Makefile.am @@ -34,5 +34,5 @@ threaded_CFLAGS = @PTHREAD_CFLAGS@ threaded_LDFLAGS = @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ echo_cpp_SOURCES = $(INCLUDE_FILES) $(INCLUDEDIR)/fcgio.h echo-cpp.cpp -echo_cpp_LDADD = $(LIBDIR)/libfcgi++.la +echo_cpp_LDADD = $(LIBDIR)/libfcgi++.la $(LIBDIR)/libfcgi.la debian/rules0000775000000000000000000000023112254433124010244 0ustar #!/usr/bin/make -f %: dh $@ --with autoreconf override_dh_auto_install: dh_auto_install sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'`