r57318 - /trunk/libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Sun May 2 14:23:38 UTC 2010
Author: gregoa
Date: Sun May 2 14:23:28 2010
New Revision: 57318
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=57318
Log:
un-apply patch
Modified:
trunk/libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm
Modified: trunk/libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm?rev=57318&op=diff
==============================================================================
--- trunk/libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm (original)
+++ trunk/libhttp-server-simple-perl/lib/HTTP/Server/Simple.pm Sun May 2 14:23:28 2010
@@ -5,7 +5,6 @@
use FileHandle;
use Socket;
use Carp;
-use IO::Select;
use vars qw($VERSION $bad_request_doc);
$VERSION = '0.43';
@@ -206,30 +205,9 @@
sub background {
my $self = shift;
-
- # set up a pipe so the child can tell the parent when it's ready
- # to accept requests
- my ($readfh, $writefh) = FileHandle::pipe;
-
my $child = fork;
croak "Can't fork: $!" unless defined($child);
-
- if ($child) { # parent
- my $s = IO::Select->new;
- $s->add($readfh);
- my $now = time; my $left = 0;
- my @ready;
- while(not @ready and $left < 5) {
- @ready = $s->can_read($left);
- $left = time - $now;
- }
- die("child unresponsive for 5 seconds") if(not @ready);
- my $response = <$readfh>;
- chomp $response;
- die("child is confused: answer '$response' != 'OK'")
- if $response ne "OK";
- return $child;
- }
+ return $child if $child;
srand(); # after a fork, we need to reset the random seed
# or we'll get the same numbers in both branches
@@ -238,8 +216,6 @@
POSIX::setsid()
or croak "Can't start a new session: $!";
}
-
- $self->{_parent_handle} = $writefh;
$self->run(@_); # should never return
exit; # just to be sure
}
@@ -289,7 +265,6 @@
$self->after_setup_listener();
*{"$pkg\::run"} = $self->_default_run;
}
- $self->_maybe_tell_parent();
local $SIG{HUP} = sub { $SERVER_SHOULD_RUN = 0; };
@@ -426,16 +401,6 @@
$self->handler;
}
-}
-
-sub _maybe_tell_parent {
- # inform the parent process that we're ready, if applicable
- my $self = shift;
- my $handle = $self->{_parent_handle};
- return if !$handle;
- print $handle "OK\n";
- close $handle;
- delete $self->{_parent_handle};
}
=head2 stdio_handle [FILEHANDLE]
More information about the Pkg-perl-cvs-commits
mailing list