--- speedy-cgi-perl-2.22.orig/debian/changelog +++ speedy-cgi-perl-2.22/debian/changelog @@ -0,0 +1,315 @@ +speedy-cgi-perl (2.22-13build2) precise; urgency=low + + * Rebuild for Perl 5.14. + + -- Colin Watson Wed, 16 Nov 2011 00:28:43 +0000 + +speedy-cgi-perl (2.22-13build1) oneiric; urgency=low + + * Rebuild for Perl 5.12. + + -- Colin Watson Mon, 09 May 2011 00:09:40 +0100 + +speedy-cgi-perl (2.22-13) unstable; urgency=low + + * Amend the detach.t fix to dynamically adapt to the system socket + buffer size, fixing build failures on smaller platforms. (Closes: #584344) + + -- Niko Tyni Tue, 24 Aug 2010 21:35:03 +0300 + +speedy-cgi-perl (2.22-12) unstable; urgency=medium + + * Fix detach.t failure on systems with a large socket write buffer size. + Thanks to Lucas Nussbaum. (Closes: #584344) + * Set myself as Maintainer and remove Jose Carlos Garcia Sogo. + * Urgency set to 'medium' because of an RC bug fix. + + -- Niko Tyni Thu, 19 Aug 2010 22:14:17 +0300 + +speedy-cgi-perl (2.22-11) unstable; urgency=low + + * debian/patches/97uninit-crash.patch: Work around #539220 (segfault + calling SvIV() after perl_run()) in Perl 5.10.0. Thanks to Tomaž Šolc. + (Closes: #537996) + * Switch from dpatch to quilt, thanks to the pkg-perl script authors. + * Update to Standards-Version 3.8.2. + + support 'nocheck' in DEB_BUILD_OPTIONS. + + move libapache2-mod-speedycgi to the new httpd section. + + add README.source describing the patch system. + * Work around a race condition in the build system by first minimizing + its chances with a nap after running the test suite and then ignoring + the failure if it happens anyway. (Closes: #489101) + + -- Niko Tyni Thu, 30 Jul 2009 01:26:51 +0300 + +speedy-cgi-perl (2.22-10) unstable; urgency=medium + + * debian/patches/96perl_sys_init.dpatch: Properly call PERL_SYS_INIT3() + to fix lockups on hppa with perl 5.10.0. (Closes: #486070) + * Invoke dh_makeshlibs before dh_shlibdeps and dh_installdeb. + Thanks, lintian. + * Add Vcs-* control fields pointing to the collab-maint git repository. + * Add Homepage information and debian/watch. + * Fix download location in debian/copyright. (Closes: #482544) + * Update the long description to mention the other upstream project + name, PersistentPerl. (Closes: #482546) + * README.Debian: mention that we don't support suid scripts (-DIAMSUID). + (See #428830) + * Change the doc-base section to Programming/Perl. Thanks, lintian. + * Urgency set to medium because of an RC bugfix. + + -- Niko Tyni Tue, 17 Jun 2008 16:06:58 +0300 + +speedy-cgi-perl (2.22-9) unstable; urgency=low + + * debian/patches/95perl5.10.dpatch: Fix FTBFS with Perl 5.10. + (Closes: #462927) + * Change my email address in the Uploaders field. + * Make the nostrip and noopt DEB_BUILD_OPTIONS actually work. + * Explicitly link the Apache2 module against libapr1 and libaprutil1, + as it uses symbols from them. + * Upgrade to Standards-Version 3.7.3. No changes needed. + * Convert some hyphens to minus signs in speedy.1p. Thanks, lintian. + * Make the libapache2-mod-speedycgi package depend on the exact same + version of the speedy-cgi-perl package + + -- Niko Tyni Mon, 28 Jan 2008 20:04:18 +0200 + +speedy-cgi-perl (2.22-8) unstable; urgency=low + + * Remove support for Apache 1, recently removed from Debian. + (Closes: #429082) + + -- Niko Tyni Fri, 15 Jun 2007 23:10:00 +0300 + +speedy-cgi-perl (2.22-7) unstable; urgency=low + + * Kill lingering speedy backends after running the tests. (Closes: #424241) + + needs a build-dependency on procps for pgrep. + + -- Niko Tyni Sat, 19 May 2007 21:40:25 +0300 + +speedy-cgi-perl (2.22-6) unstable; urgency=low + + * debian/patches/85test-timeout.dpatch: + increase test timeout to fix FTBFS on slow buildds. (Closes: #418717) + * Properly 'realclean' the mod_speedycgi2 directory too. + + -- Niko Tyni Wed, 11 Apr 2007 16:39:07 +0300 + +speedy-cgi-perl (2.22-5) unstable; urgency=low + + * Add an alternative dependency on apache2-mpm-itk. (Closes: #412722) + * Adjust the libapache2-mod-speedycgi long description accordingly. + * debian/rules: + + Use $(MAKE) instead of plain 'make'. + + Run the non-Apache tests in the 'install' target. + + Make sure 'clean' undos the results of 'build'. + * debian/patches/90speedy_unsafe_putenv.dpatch: + fix memory leak due to a change in Perl 5.8.6. (Closes: #418447) + Thanks to for the patch. + + -- Niko Tyni Tue, 10 Apr 2007 19:12:40 +0300 + +speedy-cgi-perl (2.22-4) unstable; urgency=medium + + * Medium urgency because of an RC bug fix. + * debian/patches/apache2.2: fixes for Apache 2.2 compatibility + + fix FTBFS due to APR_BRIGADE_FOREACH macro usage. (Closes: #393017) + + change apr_filename_of_pathname() calls to apr_filepath_name_get() + * debian/patches/80strip-backend-libs.dpatch: remove unnecessary linking + + don't link speedy_backend against -lm, -lcrypt and -lpthread + * Fix groff syntax in speedy.1 + * Change package sections to 'perl' and 'net', as in the override file. + * Install the speedy and speedy_backend manpages with extension '.1p', + as per the Perl policy. + * Build-depend on apache2-prefork-dev (>= 2.2) and depend on + apache2.2-common in addition to apache2-mpm-prefork, to get a + consistent set of packages for the new apache2 module ABI. + (Closes: #394446). + + -- Niko Tyni Sat, 21 Oct 2006 20:57:55 +0300 + +speedy-cgi-perl (2.22-3) unstable; urgency=low + + * New comaintainer. + * Upgrade to debhelper compatibility level 5. + * Version the build-dependency on dpatch, for /usr/share/dpatch/dpatch-run. + * Upgrade to Standards-Version 3.7.2. No changes needed. + * Depend on ${misc:Depends}, as per debhelper(7). + * Fixed FSF address in debian/copyright. + * Migrate the patch for non-interactive builds to dpatch. + * Add support for apache2 (libapache2-mod-speedycgi). Thanks to Charles Fry. + (Closes: #301681) + * Add support for apache-perl, for completeness. + * Add manpages for speedy and speedy_backend. + + documents command line usage more explicitly. (Closes: #370585) + * debian/patches: + + 30empty-param.dpatch: don't ignore empty command line parameters. + (Closes: #332494) + + 40strerror.dpatch: don't segfault on invalid command line options. + (Closes: #292071) + * Actually enable and disable the apache module in libapache-mod-speedycgi + maintainer scripts. Move the disabling functionality from postrm to prerm. + * Document that all the speedy options are global when the apache modules + are used. (#204461) + * Add perl to Build-Depends. + * Add a lintian override for usage of /usr/lib/perl5 without arch-dependent + files. Splitting the perl module into a separate package would be overkill. + * Add README.Debian files to both Apache module packages. + + -- Niko Tyni Wed, 21 Jun 2006 22:21:46 +0300 + +speedy-cgi-perl (2.22-2) unstable; urgency=low + + * libapache-mod-speedycgi.post{inst,rm}: Install module using apache-modconf + util and don't ask for restarting Apache webserver (Closes: #247866, #325763) + * debian/rules: convert to allow dpatch use. + * debian/control: build-depend on dpatch. + * Applied patch to avoid error messages in die() being lost. Thanks to Niko + Tyni for it (Closes: #326442) + + -- Jose Carlos Garcia Sogo Sun, 4 Sep 2005 16:28:41 +0200 + +speedy-cgi-perl (2.22-1) unstable; urgency=low + + * ACK of previous NMU. Thanks. (Closes: #213823, #215040) + * Fixed short description. (Closes: #174467) + * Added a "|| true" statement to the function removing config at httpd.conf + so it does not fail though the module is still commented. (Closes: #213601) + * Bumped Standars-Version. No changes needed. + + -- Jose Carlos Garcia Sogo Tue, 6 Jan 2004 17:41:39 +0100 + +speedy-cgi-perl (2.22-0) unstable; urgency=low + + * NMU + * New upstream version to solve segmentation violation. + fixes:#213823 + + -- Paul Slootman Sun, 26 Oct 2003 18:43:47 +0100 + +speedy-cgi-perl (2.21-2) unstable; urgency=low + + * Added support for both apache and apache-ssl packages. (Closes: #166672) + + -- Jose Carlos Garcia Sogo Sat, 30 Nov 2002 16:02:51 +0100 + +speedy-cgi-perl (2.21-1) unstable; urgency=low + + * New upstream release. + * Changed the way DEB_BUILD_OPTIONS var is hanndled to comply with policy. + + -- Jose Carlos Garcia Sogo Sat, 12 Oct 2002 11:52:07 +0200 + +speedy-cgi-perl (2.11+2.20pre2-1) unstable; urgency=low + + * New mantainer (Closes: #158335) + * New upstream version (Closes: #128203) + * Accepted NMUs (Closes: #104037, #104624, #113202) + * Fixed FTBS (Closes: #158325) + * Rebuilt with libdb2 2:2.7.7.0-7. That package 'per se' should fix + the problem of libdb.so.2 not being found in the apache module + (Closes: #156576) + * The CGI::SpeedyCGI.3pm man page does no longer exist. + (Closes: #124092, #119569) + * This new version of the apache module should build on alpha + (Closes: #147658) + + -- Jose Carlos Garcia Sogo Mon, 9 Sep 2002 23:47:30 +0200 + +speedy-cgi-perl (1.82-10.3) unstable; urgency=low + + * NMU + * Change libapache-mod-speedycgi from 'interpreters' to 'web'. + + -- Wolfgang Sourdeau Wed, 3 Apr 2002 17:09:38 -0500 + +speedy-cgi-perl (1.82-10.2) unstable; urgency=low + + * NMU + * Use 'dh_perl -V' in debian/control to depend on current version of + perl. (Closes: #113212) + * Standard updated to 3.5.6. + * Misc. arrangements. + * Build-Depends on debhelper >> 3. + * Build-Depends on libdb2-dev since apache-dev depends on it and + libdb3-dev conflicts with libdb2-dev. + * Added "#DEBHELPER" token in libapache-mod-speedycgi.postrm. + * libapache-mod-speedycgi does not conflict with libspeedy-cgi-perl + anymore. (Closes: #119569, #124092) + + -- Wolfgang Sourdeau Wed, 3 Apr 2002 16:13:37 -0500 + +speedy-cgi-perl (1.82-10.1) unstable; urgency=low + + * Add Build-depends: debhelper. Closes: #104037, #104624 + + -- LaMont Jones Sat, 14 Jul 2001 18:41:33 -0600 + +speedy-cgi-perl (1.82-10) unstable; urgency=low + + * re-compiled against apache-dev 1.3.20-1 + * added libdb3-dev to Build-Depends. closes: #92422 + * changed INSTALLDIRS to vendor. closes: #95534 + + -- Craig Sanders Sun, 8 Jul 2001 18:21:40 +1000 + +speedy-cgi-perl (1.82-9) unstable; urgency=low + + * re-compiled against apache 1.3.19-1 + * removed hard-coded dependency on libc6. closes: #90858 + * previous version fixed perl dependency. closes: #80709 + + -- Craig Sanders Sat, 31 Mar 2001 11:07:15 +1000 + +speedy-cgi-perl (1.82-8) unstable; urgency=low + + * re-compiled against apache 1.3.14-2.1, latest libc6 and libperl5.6 + * added Build-Depends on apache-dev and libperl-dev + + -- Craig Sanders Thu, 1 Mar 2001 14:36:51 +1100 + +speedy-cgi-perl (1.82-7) unstable; urgency=low + + * re-compiled against apache 1.3.14. + * now linked against shared library libperl5.6 + + -- Craig Sanders Tue, 12 Dec 2000 11:48:22 +1100 + +speedy-cgi-perl (1.82-6) unstable; urgency=low + + * compiled against apache 1.3.12. Closes: #66366 + + -- Craig Sanders Mon, 3 Jul 2000 12:38:22 +1000 + +speedy-cgi-perl (1.82-5) unstable; urgency=low + + * now builds the mod_speedycgi.so apache module + * previous version should have had: Closes: #43377 + + -- Craig Sanders Sat, 1 Apr 2000 18:16:20 +1000 + +speedy-cgi-perl (1.82-4) unstable; urgency=low + + * changed Architecture to 'any'. closes #43377 + + -- Craig Sanders Tue, 24 Aug 1999 07:49:27 +1000 + +speedy-cgi-perl (1.82-3) unstable; urgency=low + + * recompiled for perl-5.005 + + -- Craig Sanders Mon, 26 Jul 1999 11:53:03 +1000 + +speedy-cgi-perl (1.82-2) unstable; urgency=low + + * fix "make pure_install bug" - install speedy into usr/bin + + -- Craig Sanders Fri, 23 Jul 1999 10:56:10 +1000 + +speedy-cgi-perl (1.82-1) unstable; urgency=low + + * Initial Release + + -- Craig Sanders Thu, 15 Jul 1999 18:50:44 +1000 --- speedy-cgi-perl-2.22.orig/debian/rules +++ speedy-cgi-perl-2.22/debian/rules @@ -0,0 +1,139 @@ +#!/usr/bin/make -f +# Made with the aid of dh_make, by Craig Small +# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. +# Some lines taken from debmake, by Cristoph Lameter. +# Completely reworked for 2.x packages, by Jose Carlos Garcia Sogo. + +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + +include /usr/share/quilt/quilt.make + +ifndef PERL +PERL = /usr/bin/perl +endif + +# C compiler information +CC = gcc +CFLAGS = -Wall -g + +INSTALL = install + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +# apxs2 needs CFLAGS as -Wc,-g -Wc,-O2 +# the comma needs special 'escaping' due to $(patsubst X,Y,STR) syntax +comma:= , +APXS_CFLAGS=$(patsubst %,-Wc$(comma)%,$(CFLAGS)) + +SPEEDY=speedy-cgi-perl +MOD_SPEEDY2=libapache2-mod-speedycgi + +TMP_SCP = $(CURDIR)/debian/$(SPEEDY) +TMP_MOD_SCP2 = $(CURDIR)/debian/$(MOD_SPEEDY2) + +build: $(QUILT_STAMPFN) build-stamp kill-backends-stamp +build-stamp: + dh_testdir + + echo no | $(PERL) Makefile.PL + + # rebuild these because the source is patched + $(MAKE) README README.html lib/CGI/SpeedyCGI.pm + + # hack: rerun so it picks up lib/CGI/SpeedyCGI.pm again + echo no | $(PERL) Makefile.PL + + cd mod_speedycgi2 && $(PERL) Makefile.PL + + $(MAKE) OPTIMIZE="$(CFLAGS)" + $(MAKE) -C mod_speedycgi2 APXS=apxs2 DEBUG="$(APXS_CFLAGS)" \ + LIB="$$(apr-config --link-ld) $$(apu-config --link-ld)" + +ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) + $(MAKE) -C speedy test + sleep 2 +endif + + touch build-stamp + +kill-backends: kill-backends-stamp +kill-backends-stamp: + # kill any leftover speedy_backend processes + perl debian/list-backends "$(CURDIR)/speedy_backend/speedy_backend" | \ + xargs --no-run-if-empty --verbose kill || true + touch kill-backends-stamp + +clean: unpatch + dh_testdir + dh_testroot + + $(RM) build-stamp install-speedy-stamp install-modspeedy2-stamp kill-backends-stamp + + ifeq (Makefile,$(wildcard Makefile)) + # the Makefile dpatch causes a timestamp issue + touch Makefile + $(MAKE) realclean + endif + + [ ! -f mod_speedycgi2/Makefile ] || $(MAKE) -C mod_speedycgi2 realclean + + dh_clean + +install: install-speedy-stamp install-modspeedy2-stamp +install-speedy-stamp: build-stamp + dh_testdir --package=$(SPEEDY) + dh_testroot --package=$(SPEEDY) + dh_clean -k -d --package=$(SPEEDY) + + dh_installdirs --package=$(SPEEDY) + + $(INSTALL) -m 755 blib/script/* $(TMP_SCP)/usr/bin/ + install -m 644 blib/lib/CGI/SpeedyCGI.pm $(TMP_SCP)/usr/lib/perl5/CGI/ + install -m 644 blib/man3/CGI::SpeedyCGI.3pm $(TMP_SCP)/usr/share/man/man3 + install -m 644 docs/*.html $(TMP_SCP)/usr/share/doc/$(SPEEDY)/internals/ + install -m 644 docs/file* $(TMP_SCP)/usr/share/doc/$(SPEEDY)/internals/ + install -m 644 docs/*txt $(TMP_SCP)/usr/share/doc/$(SPEEDY)/internals/ + install -m 644 docs/backend_parent $(TMP_SCP)/usr/share/doc/$(SPEEDY)/internals/ + install -m 644 debian/lintian.override $(TMP_SCP)/usr/share/lintian/overrides/speedy-cgi-perl + + touch install-speedy-stamp + +install-modspeedy2-stamp: build-stamp + dh_testdir --package=$(MOD_SPEEDY2) + dh_testroot --package=$(MOD_SPEEDY2) + dh_clean -k -d --package=$(MOD_SPEEDY2) + dh_installdirs --package=$(MOD_SPEEDY2) + + $(INSTALL) -m 644 mod_speedycgi2/mod_speedycgi.so $(TMP_MOD_SCP2)/usr/lib/apache2/modules + install -m 644 debian/speedycgi.load debian/speedycgi.conf \ + $(TMP_MOD_SCP2)/etc/apache2/mods-available + + touch install-modspeedy2-stamp + +binary-indep: + +binary-arch: build install + + dh_testdir + dh_testroot + dh_installdocs README* + dh_installman + dh_installchangelogs Changes + dh_strip + dh_compress + dh_fixperms + dh_perl -V + dh_makeshlibs + dh_shlibdeps + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary patch unpatch install --- speedy-cgi-perl-2.22.orig/debian/speedy.1p +++ speedy-cgi-perl-2.22/debian/speedy.1p @@ -0,0 +1,150 @@ +.TH SPEEDY 1p +.SH NAME +speedy \- a persistent Perl interpreter +.SH SYNOPSIS +.B speedy [ +.I +.B ] [ \-\- +.I +.B ] [ +.I +.B ] +.SH DESCRIPTION +.B speedy, +short for +.I SpeedyCGI, +is a way to run perl scripts persistently, which can make them run much +more quickly. The most common way to make a script run persistently is +by changing the interpreter line at the top of the script from: +.IP +#!/usr/bin/perl +.PP +to +.IP +#!/usr/bin/speedy +.PP +After the script is initially run, instead of exiting, the perl +interpreter is kept running. During subsequent runs, this interpreter is +used to handle new executions instead of starting a new perl interpreter +each time. A very fast frontend program, written in C, is executed for +each request. This fast frontend then contacts the persistent Perl +process, which is usually already running, to do the work and return +the results. +.PP +Each perl script runs in its own Unix process, so one perl script can't +interfere with another. Command line options can also be used to deal +with programs that have memory leaks or other problems that might keep +them from otherwise running persistently. +.PP +Although SpeedyCGI is especially useful for CGI scripts, it can be used +to keep any perl script running persistently. See +.BR CGI::SpeedyCGI(3.pm) +for a complete description of +.I SpeedyCGI, +including further details on CGI execution and Apache issues. This +manual page is based on that, but concentrates on running +.B speedy +from the command line. +.SH OPTIONS +The speedy command line is the same as for regular perl, with the +exception that SpeedyCGI specific options can be passed in after a "\-\-". +.PP +For example the line: +.IP +#!/usr/bin/speedy \-w \-\- \-t300 +.PP +at the top of your script will set the perl option `\-w' and will pass +the `\-t' option to SpeedyCGI, setting the Timeout value to 300 seconds. +.PP +The options can also be set at run\-time from the perl script using the +.I CGI::SpeedyCGI +module. +.SS OPTIONS AVAILABLE +See +.BR CGI::SpeedyCGI(3.pm) +for a complete description of the options. +.TP +.BR \-p +.I BackendProg +: Path to the +.B speedy +backend program. (Default: /usr/bin/speedy_backend) +.TP +.BR \-B +.I BufsizGet +: Use bytes as the maximum size for the buffer that receives +data from the perl backend. (Default: 131072) +.TP +.BR \-b +.I BufsizPost +: Use bytes as the maximum size for the buffer that sends data +to the perl backend. (Default: 131072) +.TP +.BR \-g +.I Group +: Allow a single perl interpreter to run multiple scripts. +See +.BR CGI::SpeedyCGI(3.pm) +for details. (Default: `none') +.TP +.BR \-M +.I MaxBackends +: If non-zero, limits the number of speedy backends running +for this perl script to . (Default: 0) +.TP +.BR \-r +.I MaxRuns +: Once the perl interpreter has run times, re-exec +the backend process. Zero indicates no maximum. This +option is useful for processes that tend to consume +resources over time. (Default: 500) +.TP +.BR \-t +.I Timeout +: If no new requests have been received after +seconds, exit the persistent perl interpreter. Zero +indicates no timeout. (Default: 3600) +.TP +.BR \-T +.I TmpBase +: Use the given prefix for creating temporary files. This +must be a filename prefix, not a directory name. (Default: `/tmp/speedy') +.TP +.BR \-v +.I Version +: Print the SpeedyCGI version and exit. +.SH ENVIRONMENT +Environment variables can also be used to pass in options. This can only +be done before the initial execution, not from within the script itself. +The name of the environment variable is always SPEEDY_ followed by the +option name in upper-case. For example to set the speedy Timeout option, +use the environment variable named SPEEDY_TIMEOUT. +.SH FILES +.I /tmp/speedy* +A unix socket used to connect to the backend process. +See +.BR speedy_backend(1) +for more information. +.SH AUTHOR +.IP + Sam Horrocks + http://daemoninc.com + sam@daemoninc.com +.SH NOTES +This manual page was created by Niko Tyni for Debian +GNU/Linux, because the original program does not have one. It is +based on the original and more complete +.BR CGI::SpeedyCGI(3pm) +manual page. +.SH BUGS +There are command-line parsing incompatibilities with the real Perl. These aren't +very easy to fix, as even the perlrun manpage isn't quite accurate on +which parameters can be separated (like '\-I') and which can't (like '\-C'). +.B speedy +doesn't allow any of them to be separated. It considers +the first option without a leading dash as the script filename. +.SH SEE ALSO +.BR perl(1), +.BR CGI::SpeedyCGI(3pm), +.BR speedy_backend(1) + --- speedy-cgi-perl-2.22.orig/debian/libapache2-mod-speedycgi.dirs +++ speedy-cgi-perl-2.22/debian/libapache2-mod-speedycgi.dirs @@ -0,0 +1,2 @@ +usr/lib/apache2/modules +etc/apache2/mods-available --- speedy-cgi-perl-2.22.orig/debian/lintian.override +++ speedy-cgi-perl-2.22/debian/lintian.override @@ -0,0 +1 @@ +speedy-cgi-perl: package-installs-nonbinary-perl-in-usr-lib-perl5 --- speedy-cgi-perl-2.22.orig/debian/watch +++ speedy-cgi-perl-2.22/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://daemoninc.com/SpeedyCGI/download.html CGI-SpeedyCGI-(\d.+)\.tar\.gz --- speedy-cgi-perl-2.22.orig/debian/README.source +++ speedy-cgi-perl-2.22/debian/README.source @@ -0,0 +1,5 @@ +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +See /usr/share/doc/quilt/README.source for a detailed explanation. --- speedy-cgi-perl-2.22.orig/debian/compat +++ speedy-cgi-perl-2.22/debian/compat @@ -0,0 +1 @@ +5 --- speedy-cgi-perl-2.22.orig/debian/speedy-cgi-perl.manpages +++ speedy-cgi-perl-2.22/debian/speedy-cgi-perl.manpages @@ -0,0 +1,2 @@ +debian/speedy.1p +debian/speedy_backend.1p --- speedy-cgi-perl-2.22.orig/debian/README.Debian +++ speedy-cgi-perl-2.22/debian/README.Debian @@ -0,0 +1,13 @@ +speedy-cgi-perl for Debian +-------------------------- + +SpeedyCGI is a way to run perl scripts persistently, which usually makes +them run much more quickly. It is most often used for CGI scripts but +it can be used to speed up most perl programs. + +Craig Sanders , Thu, 15 Jul 1999 18:48:32 +1000 + +Note that this version of SpeedyCGI is compiled without support for suid +scripts (-DIAMSUID). See . + + -- Niko Tyni Tue, 17 Jun 2008 15:39:10 +0300 --- speedy-cgi-perl-2.22.orig/debian/libapache2-mod-speedycgi.postinst +++ speedy-cgi-perl-2.22/debian/libapache2-mod-speedycgi.postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +#DEBHELPER# + +if [ "$1" = "configure" ] && [ -z "$2" ]; then + a2enmod speedycgi || true +fi + +exit 0 --- speedy-cgi-perl-2.22.orig/debian/speedy-cgi-perl.dirs +++ speedy-cgi-perl-2.22/debian/speedy-cgi-perl.dirs @@ -0,0 +1,7 @@ +usr/bin +usr/lib/perl5/CGI +usr/share/doc/speedy-cgi-perl +usr/share/doc/speedy-cgi-perl/internals +usr/share/man/man3 +usr/share/man/man1 +usr/share/lintian/overrides --- speedy-cgi-perl-2.22.orig/debian/libapache2-mod-speedycgi.README.Debian +++ speedy-cgi-perl-2.22/debian/libapache2-mod-speedycgi.README.Debian @@ -0,0 +1,23 @@ +libapache2-mod-speedycgi for Debian +----------------------------------- + +This package provides an Apache2 module so that SpeedyCGI scripts can be +run without the overhead of doing a fork/exec for each request. This is +optional; SpeedyCGI can be used quite effectively without this module. + +SpeedyCGI options can be set in the httpd.conf file. The name of the +apache directive will always be Speedy followed by the option name. For +example to set the Timeout option, use the apache directive SpeedyTimeout. + +Note that these variables are global. There is currently no way to run +different scripts with different SpeedyCGI options when they are run +from the Apache module. Any or contexts have no +effect on the scope of the SpeedyCGI options. When the same SpeedyCGI +option is set several times, the last one overrides the others. + +Please note that this package only works with Apache2's prefork MPM, +as it is not thread-safe. + +See CGI::SpeedyCGI(3pm) for details. + +Niko Tyni Wed, 21 Jun 2006 22:23:22 +0300 --- speedy-cgi-perl-2.22.orig/debian/speedycgi.load +++ speedy-cgi-perl-2.22/debian/speedycgi.load @@ -0,0 +1 @@ +LoadModule speedycgi_module /usr/lib/apache2/modules/mod_speedycgi.so --- speedy-cgi-perl-2.22.orig/debian/speedy-cgi-perl.doc-base +++ speedy-cgi-perl-2.22/debian/speedy-cgi-perl.doc-base @@ -0,0 +1,13 @@ +Document: speedy-cgi-perl +Title: speedy-cgi-perl. +Abstract: SpeedyCGI is a way to run perl scripts persistently, which usually makes + them run much more quickly. This document answers how this software, and the options + available. +Section: Programming/Perl + +Format: HTML +Index: /usr/share/doc/speedy-cgi-perl/README.html +FIles: /usr/share/doc/speedy-cgi-perl/README.html + +Format: text +Files: /usr/share/doc/speedy-cgi-perl/README.gz --- speedy-cgi-perl-2.22.orig/debian/control +++ speedy-cgi-perl-2.22/debian/control @@ -0,0 +1,33 @@ +Source: speedy-cgi-perl +Section: perl +Priority: optional +Maintainer: Niko Tyni +Build-Depends: libperl-dev, debhelper (>= 5), quilt, apache2-prefork-dev (>= 2.2), perl (>= 5.6.0-16), procps +Standards-Version: 3.8.2 +Vcs-Git: git://git.debian.org/git/collab-maint/speedy-cgi-perl.git +Vcs-Browser: http://git.debian.org/?p=collab-maint/speedy-cgi-perl.git +Homepage: http://daemoninc.com/SpeedyCGI/ + +Package: speedy-cgi-perl +Architecture: any +Depends: ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends} +Description: speed up perl scripts by making them persistent + SpeedyCGI is a way to run perl scripts persistently, which usually makes + them run much more quickly because it avoids the overhead of starting + up a new perl interpreter and compiling the perl code. It is also known + as PersistentPerl: while its most common use is with CGI scripts, it can + be used to speed up most perl programs. + +Package: libapache2-mod-speedycgi +Architecture: any +Section: httpd +Depends: speedy-cgi-perl (= ${binary:Version}), apache2-mpm-prefork (>= 2.0.50-10) | apache2-mpm-itk, apache2.2-common, ${shlibs:Depends}, ${misc:Depends} +Description: apache2 module to speed up perl scripts by making them persistent + SpeedyCGI is a way to run perl scripts persistently, which usually makes + them run much more quickly because it avoids the overhead of starting + up a new perl interpreter and compiling the perl code. + . + This package provides an Apache2 module so that SpeedyCGI scripts can be run + without the overhead of doing a fork/exec for each request. Please note that + this package only works with Apache2's prefork MPM or the ITK MPM, as it is + not thread-safe. --- speedy-cgi-perl-2.22.orig/debian/copyright +++ speedy-cgi-perl-2.22/debian/copyright @@ -0,0 +1,33 @@ +This package was debianized by Craig Sanders on +Thu, 15 Jul 1999 18:54:54 +1000 + +After that, the package was adopted by Jose Carlos Garcia Sogo + on Mon, 9 Sep 2002 22:31:12 +0200 + +It was downloaded from +http://daemoninc.com/SpeedyCGI/download.html + +Upstream Author: Sam Horrocks + +Copyright: + + Copyright (C) 2002 Sam Horrocks + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + + This product includes software developed by the Apache Software + Foundation (http://www.apache.org/). + +In Debian, you can find the complete text of GPL-2 in /usr/share/common-licenses --- speedy-cgi-perl-2.22.orig/debian/speedycgi.conf +++ speedy-cgi-perl-2.22/debian/speedycgi.conf @@ -0,0 +1,3 @@ + + AddHandler speedycgi-script .speedy + --- speedy-cgi-perl-2.22.orig/debian/libapache2-mod-speedycgi.prerm +++ speedy-cgi-perl-2.22/debian/libapache2-mod-speedycgi.prerm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +#DEBHELPER# + +if [ "$1" = "remove" ]; then + a2dismod speedycgi || true +fi + +exit 0 --- speedy-cgi-perl-2.22.orig/debian/list-backends +++ speedy-cgi-perl-2.22/debian/list-backends @@ -0,0 +1,29 @@ +#!/usr/bin/perl -w +use strict; + +# list all speedy_backend processes with the given pathname +# +# we can't just use pgrep -f, since the full pathname could +# contain regexp characters +# +# pgrep -f -x won't do either, since the exact match should +# contain all the arguments too + +# the full pathname to the backend program +my $pathname = shift; +die("no speedy_backend pathname specified") if !$pathname; +my $namelen = length($pathname); + +open(P, "pgrep -U $< -f -l speedy_backend |") + or die("fork pgrep: $!"); + +while (

) { + chomp; + my ($pid, $cmdline) = split(/\s+/, $_, 2); + print "$pid\n" if substr($cmdline, 0, $namelen + 1) eq $pathname . " "; +} + +close P; + +exit 0; + --- speedy-cgi-perl-2.22.orig/debian/speedy_backend.1p +++ speedy-cgi-perl-2.22/debian/speedy_backend.1p @@ -0,0 +1,58 @@ +.TH SPEEDY_BACKEND 1p +.SH NAME +speedy_backend \- the backend process for a persistent Perl interpreter +.SH SYNOPSIS +.I none +; this program is not meant to be called directly. +.SH DESCRIPTION +.B speedy, +short for +.I SpeedyCGI, +is a way to run perl scripts persistently, which can make them run much +more quickly. +.PP +After the script is initially run, instead of exiting, the perl +interpreter is kept running inside a backend process, +.B speedy_backend. +During subsequent runs, this interpreter is +used to handle new executions instead of starting a new perl interpreter +each time. A very fast frontend program, +.B speedy, +written in C, is executed for each request. This fast frontend then +contacts the persistent Perl +process, which is usually already running, to do the work and return +the results. +.PP +Each perl script runs in its own Unix process, so one perl script can't +interfere with another. Command line options can also be used to deal +with programs that have memory leaks or other problems that might keep +them from otherwise running persistently. +.PP +The +.B speedy +front end connects to the back end process, +.B speedy_backend, +via a Unix socket in /tmp. A queue is kept in a shared file in /tmp +that holds an entry for each process. In that queue are the pids of the +perl processes waiting for connections. The frontend pulls a process +out of this queue, connects to its socket, sends over the environment +and argv, and then uses this socket for stdin/stdout to the perl process. +.SH FILES +.I /tmp/speedy* +A unix socket used to connect to the frontend process. +.SH AUTHOR +.IP + Sam Horrocks + http://daemoninc.com + sam@daemoninc.com +.SH NOTES +This manual page was created by Niko Tyni for Debian +GNU/Linux, because the original program does not have one. It is +based on the original and more complete +.BR CGI::SpeedyCGI(3pm) +manual page. +.SH SEE ALSO +.BR perl(1), +.BR CGI::SpeedyCGI(3pm), +.BR speedy(1) + --- speedy-cgi-perl-2.22.orig/debian/patches/97uninit-crash.patch +++ speedy-cgi-perl-2.22/debian/patches/97uninit-crash.patch @@ -0,0 +1,15 @@ +Author: Niko Tyni +Description: Closes: #537996 +The SvIV call crashes in on Perl 5.10.0 when warnings are +enabled and the value is undef. +--- a/src/speedy_perl.c ++++ b/src/speedy_perl.c +@@ -818,7 +818,7 @@ + my_call_sv(get_perlvar(&PERLVAR_RESET_GLOBALS)); + + /* Copy option values in from the perl vars */ +- if (SvIV(PERLVAL_OPTS_CHANGED)) { ++ if (SvTRUE(PERLVAL_OPTS_CHANGED)) { + int i; + for (i = 0; i < SPEEDY_NUMOPTS; ++i) { + OptRec *o = speedy_optdefs + i; --- speedy-cgi-perl-2.22.orig/debian/patches/70apache2.2.patch +++ speedy-cgi-perl-2.22/debian/patches/70apache2.2.patch @@ -0,0 +1,56 @@ +Author: Niko Tyni +Description: Apache 2.2 compatibility fixes (#393017): +* APR_BRIGADE_FOREACH macro removal +* apr_filename_of_pathname() rename +--- a/src/mod_speedycgi2.c ++++ b/src/mod_speedycgi2.c +@@ -340,7 +340,10 @@ + const char *buf; + apr_size_t len; + apr_status_t rv; +- APR_BRIGADE_FOREACH(e, bb) { ++ for (e = APR_BRIGADE_FIRST(bb); ++ e != APR_BRIGADE_SENTINEL(bb); ++ e = APR_BUCKET_NEXT(e)) { ++ + if (APR_BUCKET_IS_EOS(e)) { + break; + } +@@ -380,7 +383,7 @@ + return DECLINED; + } + +- argv0 = apr_filename_of_pathname(r->filename); ++ argv0 = apr_filepath_name_get(r->filename); + nph = !(strncmp(argv0, "nph-", 4)); + + if (!(ap_allow_options(r) & OPT_EXECCGI) && !is_scriptaliased(r)) +@@ -436,7 +439,7 @@ + if ((rv = default_build_command(&command, &argv, r, p)) != APR_SUCCESS) { + ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, rv, r, + "don't know how to spawn child process: %s", +- apr_filename_of_pathname(r->filename)); ++ apr_filepath_name_get(r->filename)); + return HTTP_INTERNAL_SERVER_ERROR; + } + +@@ -445,7 +448,7 @@ + command, argv, r, p)) != APR_SUCCESS) { + ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, rv, r, + "couldn't spawn child process: %s", +- apr_filename_of_pathname(r->filename)); ++ apr_filepath_name_get(r->filename)); + return HTTP_INTERNAL_SERVER_ERROR; + } + +@@ -465,7 +468,9 @@ + return rv; + } + +- APR_BRIGADE_FOREACH(bucket, bb) { ++ for (bucket = APR_BRIGADE_FIRST(bb); ++ bucket != APR_BRIGADE_SENTINEL(bb); ++ bucket = APR_BUCKET_NEXT(bucket)) { + const char *data; + apr_size_t len; + --- speedy-cgi-perl-2.22.orig/debian/patches/90speedy_unsafe_putenv.patch +++ speedy-cgi-perl-2.22/debian/patches/90speedy_unsafe_putenv.patch @@ -0,0 +1,16 @@ +Author: banb@yahoo.co.jp +Description: Debian #418447, CPAN #13521 +http://rt.cpan.org/Public/Bug/Display.html?id=13521 +--- a/src/speedy_backend_main.c ++++ b/src/speedy_backend_main.c +@@ -176,6 +176,10 @@ + DIE_QUIET("Cannot allocate perl"); + perl_construct(my_perl); + ++#if defined(PL_use_safe_putenv) || defined(PL_Guse_safe_putenv) ++ PL_use_safe_putenv = 0; ++#endif ++ + #ifdef SPEEDY_DEBUG + dont_fork = getenv("SPEEDY_NOPARENT") != NULL; + #endif --- speedy-cgi-perl-2.22.orig/debian/patches/96perl_sys_init.patch +++ speedy-cgi-perl-2.22/debian/patches/96perl_sys_init.patch @@ -0,0 +1,28 @@ +Author: Niko Tyni +Description: Properly call PERL_SYS_INIT3() to fix lockups on hppa with perl 5.10.0. (Closes: #486070) + +This was always buggy but didn't bite until now. From 'perldoc perlembed': + +The macros PERL_SYS_INIT3() and PERL_SYS_TERM() provide system-specific +tune up of the C runtime environment necessary to run Perl interpreters +--- a/src/speedy_backend_main.c ++++ b/src/speedy_backend_main.c +@@ -170,6 +170,8 @@ + int i; + SigList sl; + ++ PERL_SYS_INIT3(&argc, &argv, &_junk); ++ + speedy_util_unlimit_core(); + + if (!(my_perl = perl_alloc())) +--- a/src/speedy_perl.c ++++ b/src/speedy_perl.c +@@ -405,6 +405,7 @@ + + perl_destruct(my_perl); + } ++ PERL_SYS_TERM(); + speedy_util_exit(0,0); + } + --- speedy-cgi-perl-2.22.orig/debian/patches/20makefile-manpage.patch +++ speedy-cgi-perl-2.22/debian/patches/20makefile-manpage.patch @@ -0,0 +1,16 @@ +Author: Niko Tyni +Description: Makefile.PL tries to be too smart, make it generate a manpage. +--- a/Makefile.PL ++++ b/Makefile.PL +@@ -34,9 +34,9 @@ + VERSION_FROM => 'src/SpeedyCGI.src', + EXE_FILES => [qw(speedy/speedy speedy_backend/speedy_backend)], + CONFIGURE => sub { return {DIR=>\@dirs} }, +- PM => {'src/SpeedyCGI.pm'=>'$(INST_LIBDIR)/SpeedyCGI.pm'}, ++ # PM => {'src/SpeedyCGI.pm'=>'$(INST_LIBDIR)/SpeedyCGI.pm'}, + MAN1PODS => {}, +- MAN3PODS => {}, ++ # MAN3PODS => {}, + dist => {DIST_DEFAULT => 'mydist'}, + realclean => {FILES => 'README README.html lib'}, + %write_makefile_common --- speedy-cgi-perl-2.22.orig/debian/patches/60apache-docs.patch +++ speedy-cgi-perl-2.22/debian/patches/60apache-docs.patch @@ -0,0 +1,18 @@ +Author: Niko Tyni +Description: Documentation for bug #204461. +--- a/src/SpeedyCGI.src ++++ b/src/SpeedyCGI.src +@@ -250,6 +250,13 @@ + be Speedy followed by the option name. For example to set the + Timeout option, use the apache directive SpeedyTimeout. + ++Note that these variables are global. There is currently no way to run ++different scripts with different SpeedyCGI options when they are run ++from the Apache module. Any or contexts ++have no effect on the scope of the SpeedyCGI options. When the ++same SpeedyCGI option is set several times, the last one overrides ++the others. ++ + =back + + =head2 Context --- speedy-cgi-perl-2.22.orig/debian/patches/40strerror.patch +++ speedy-cgi-perl-2.22/debian/patches/40strerror.patch @@ -0,0 +1,47 @@ +Author: Niko Tyni +Description: Don't crash while printing a fatal error. +--- a/src/speedy_util.c ++++ b/src/speedy_util.c +@@ -96,13 +96,42 @@ + } + + static void just_die(const char *fmt, va_list ap) { ++ /* ++ * All this strerror_r() stuff is here because ++ * including perl.h in some cases (Perl 5.8?) replaces ++ * strerr() with a wrapper that needs an embedded perl ++ * interpreter running. Otherwise we get SIGSEGV when ++ * accessing interpreter-specific global variables for the ++ * strerror buffer ++ * ++ * Furthermore, there are two implementations of ++ * strerror_r() out there, with different prototypes. ++ */ ++ + char buf[2048]; ++#ifdef HAS_STRERROR_R ++ char errbuf[256]; ++ int errsv; ++#endif + + sprintf(buf, "%s[%u]: ", SPEEDY_PROGNAME, (int)getpid()); + vsprintf(buf + strlen(buf), fmt, ap); + if (errno) { + strcat(buf, ": "); ++#ifdef HAS_STRERROR_R ++#ifdef _GNU_SOURCE ++ strcat(buf, strerror_r(errno, errbuf, sizeof(errbuf))); ++#else /* ! _GNU_SOURCE */ ++ errsv = errno; ++ if (strerror_r(errsv, errbuf, sizeof(errbuf)) ++ sprintf(buf + strlen(buf), "(errno = %d)", errsv); ++ else ++ strcat(buf, errbuf); ++ } ++#endif ++#else /* ! HAS_STRERROR_R */ + strcat(buf, strerror(errno)); ++#endif /* HAS_STRERROR_R */ + } + strcat(buf, "\n"); + # ifdef SPEEDY_DEBUG --- speedy-cgi-perl-2.22.orig/debian/patches/95perl5.10.patch +++ speedy-cgi-perl-2.22/debian/patches/95perl5.10.patch @@ -0,0 +1,26 @@ +Author: Niko Tyni +Description: Fix build failures with Perl 5.10. +Pod::Text::pod2text() calling conventions changed +use Newx() instead of New() +--- a/Makefile.PL ++++ b/Makefile.PL +@@ -71,7 +71,7 @@ + chmod -R u+w,go-w,go+r . + + README: src/SpeedyCGI.pm +- cd src && $(PERL) -e "use Pod::Text; pod2text(-80)" ../README ++ cd src && pod2text -80 ../README + + README.html: src/SpeedyCGI.pm + cd src && pod2html SpeedyCGI.pm >../README.html && $(RM_F) pod2h* +--- a/src/speedy_backend_main.h ++++ b/src/speedy_backend_main.h +@@ -38,7 +38,7 @@ + + #else + +-#define speedy_new(s,n,t) New(123,s,n,t) ++#define speedy_new(s,n,t) Newx(s,n,t) + #define speedy_renew Renew + #define speedy_free Safefree + --- speedy-cgi-perl-2.22.orig/debian/patches/30empty-param.patch +++ speedy-cgi-perl-2.22/debian/patches/30empty-param.patch @@ -0,0 +1,40 @@ +Author: Niko Tyni +Description: Allow empty strings as command-line parameters +--- a/src/speedy_frontend.c ++++ b/src/speedy_frontend.c +@@ -535,7 +535,26 @@ + ADD_STRING(b, s, l); + } + } ++ /* Terminate with zero-length string */ ++ ADDCHAR(b, 0); ++} ++ ++/* Copy a block of strings into the buffer, including empty strings */ ++static void add_strings_with_empty(register SpeedyBuf *b, register const char * const * p) ++{ ++ int l; ++ register const char *s; + ++ /* Add strings in p array */ ++ for (; (s = *p); ++p) { ++ if ((l = strlen(s))) { ++ ADD_STRING(b, s, l); ++ } else { ++ /* add a 1-byte long string containing just '\0' */ ++ l = 1; ++ ADD_STRING(b, s, l); ++ } ++ } + /* Terminate with zero-length string */ + ADDCHAR(b, 0); + } +@@ -560,7 +579,7 @@ + + /* Add env and argv */ + add_strings(sb, envp); +- add_strings(sb, scr_argv+1); ++ add_strings_with_empty(sb, scr_argv+1); + + /* Put script filename into buffer */ + add_string(sb, script_fname, strlen(script_fname)); --- speedy-cgi-perl-2.22.orig/debian/patches/85test-timeout.patch +++ speedy-cgi-perl-2.22/debian/patches/85test-timeout.patch @@ -0,0 +1,14 @@ +Author: Niko Tyni +Description: Increase the time for the backend to start so slower buildds +have a chance. (#418717) +--- a/speedy/t/killfe.t ++++ b/speedy/t/killfe.t +@@ -9,7 +9,7 @@ + my $cmd = "exec $ENV{SPEEDY} -- -M1 $scr +Description: fix the detach test on systems with a large socket buffer size (#584344) +--- speedy-cgi-perl.orig/speedy/t/detach.t ++++ speedy-cgi-perl/speedy/t/detach.t +@@ -6,9 +6,22 @@ + + use strict; + use IO::File; ++use Socket; + + my $smbuf = 8 * 1024; +-my $lgbuf = 512 * 1024; ++my $lgbuf; ++ ++# find out the size of the socket write buffer ++# see http://bugs.debian.org/584344 ++my $s; ++if (socket($s, AF_UNIX, SOCK_STREAM, 0) && ++ (my $packed_size = getsockopt($s, SOL_SOCKET, SO_SNDBUF))) { ++ $lgbuf = $smbuf + 2 * unpack("I", $packed_size); ++} else { ++ warn("socket() or getsockopt() failed: $!"); ++} ++ ++$lgbuf = 512 * 1024 if $lgbuf < 512 * 1024; + my $scr = 't/scripts/detach'; + + use vars qw(@open_files @pids %children); +@@ -23,7 +36,7 @@ + $| = 1; print ""; $| = 0; + my $child; + if (($child = open($fh, "-|")) == 0) { +- open(F, "$ENV{SPEEDY} -- -B$sz $scr |"); ++ open(F, "$ENV{SPEEDY} -- -B$sz $scr $lgbuf |"); + print scalar ; + close(STDOUT); + sleep 60; # Simulate slow drain of output +--- speedy-cgi-perl.orig/speedy/t/scripts/detach ++++ speedy-cgi-perl/speedy/t/scripts/detach +@@ -1,3 +1,6 @@ + $| = 1; ++# the data should not fit in the socket write buffer ++# see http://bugs.debian.org/584344 ++my $size = shift || (512 * 1024); + print "$$\n"; +-print 'x' x (500*1024); ++print 'x' x int(500 / 512 * $size); --- speedy-cgi-perl-2.22.orig/debian/patches/50log-exit-messages-on-die.patch +++ speedy-cgi-perl-2.22/debian/patches/50log-exit-messages-on-die.patch @@ -0,0 +1,34 @@ +Author: Jose Carlos Garcia Sogo +Description: Try to log exit messages on die() (#326442) +--- a/src/speedy_main.c ++++ b/src/speedy_main.c +@@ -299,6 +299,7 @@ + /* Copy streams */ + while (1) { + /* Do reads/writes */ ++ int close_stdout_delayed = 0; + for (i = 0; i < NUMFDS; ++i) { + register CopyBuf *b = cb + i; + int do_read = my_canread(b) && +@@ -346,10 +347,17 @@ + /* Try to close files now, so we can wake up the backend + * and do more I/O before dropping into select + */ +- if (!do_read && !do_write) +- try_close(b); +- } +- } ++ if (!do_read && !do_write) { ++ if (i == 1) ++ /* delay closing STDOUT until all the other fds are closed */ ++ close_stdout_delayed = 1; ++ else ++ try_close(b); ++ } ++ } ++ } ++ if (close_stdout_delayed) ++ try_close(cb+1); + + /* All done with reads/writes after backend exited */ + if (backend_exited) { --- speedy-cgi-perl-2.22.orig/debian/patches/series +++ speedy-cgi-perl-2.22/debian/patches/series @@ -0,0 +1,13 @@ +10big-socket-buffers.patch +20makefile-manpage.patch +30empty-param.patch +40strerror.patch +50log-exit-messages-on-die.patch +60apache-docs.patch +70apache2.2.patch +80strip-backend-libs.patch +85test-timeout.patch +90speedy_unsafe_putenv.patch +95perl5.10.patch +96perl_sys_init.patch +97uninit-crash.patch --- speedy-cgi-perl-2.22.orig/debian/patches/80strip-backend-libs.patch +++ speedy-cgi-perl-2.22/debian/patches/80strip-backend-libs.patch @@ -0,0 +1,31 @@ +Author: Niko Tyni +Description: Use the automatic 'remove extra libs' feature with speedy_backend too. +These unnecessary linking flags get removed: -lm -lcrypt -lpthread +--- a/speedy_backend/Makefile.PL ++++ b/speedy_backend/Makefile.PL +@@ -29,6 +29,10 @@ + sub am_frontend {0} + sub my_name {'backend'} + ++sub remove_libs { my $class = shift; ++ 'BIN=speedy_backend ../util/remove_libs'; ++} ++ + use ExtUtils::Embed; + + my $tmp = "xsinit.tmp$$"; +--- a/util/remove_libs ++++ b/util/remove_libs +@@ -3,7 +3,11 @@ + # Remove extranaeous libs from the linking command. Reduces shared-library + # overhead at exec time. + +-BIN=speedy ++# allow testing other binaries too ++if [ "x$BIN" = "x" ] ++then ++ BIN=speedy ++fi + TMP1=/tmp/remove_libs$$ + TMP2="${TMP1}2" +