diff options
author | Peter Volkov <pva@gentoo.org> | 2010-09-15 14:21:11 +0000 |
---|---|---|
committer | Peter Volkov <pva@gentoo.org> | 2010-09-15 14:21:11 +0000 |
commit | f18f3ff876141bc9e4ac9eae462a8718df8ded3e (patch) | |
tree | cd7d058c2388c1c3ba31e844eb7a603aa8c8a959 /dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-big-socket-buffers.patch | |
parent | stable x86, bug 337125 (diff) | |
download | gentoo-2-f18f3ff876141bc9e4ac9eae462a8718df8ded3e.tar.gz gentoo-2-f18f3ff876141bc9e4ac9eae462a8718df8ded3e.tar.bz2 gentoo-2-f18f3ff876141bc9e4ac9eae462a8718df8ded3e.zip |
Another patch from debian. Respect LDFLAGS, bug #335153, thank Diego E. 'Flameeyes' Pettenò for report. Drop old.
(Portage version: 2.1.9.5/cvs/Linux x86_64)
Diffstat (limited to 'dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-big-socket-buffers.patch')
-rw-r--r-- | dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-big-socket-buffers.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-big-socket-buffers.patch b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-big-socket-buffers.patch new file mode 100644 index 000000000000..a67d9b6954b3 --- /dev/null +++ b/dev-perl/SpeedyCGI/files/SpeedyCGI-2.22-big-socket-buffers.patch @@ -0,0 +1,47 @@ +Author: Niko Tyni <ntyni@debian.org> +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 <F>; + 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); |