--- lib/PXElator/httpd.pm 2009/08/02 12:09:02 115 +++ lib/PXElator/httpd.pm 2009/08/04 13:30:47 136 @@ -17,7 +17,6 @@ use File::Slurp; #use JSON; use IO::Socket::INET; -use Module::Refresh; our $pids; $pids = { httpd => $$ } unless defined $pids; # keep pids on refresh @@ -99,7 +98,7 @@ sub start_stop { my $daemon = shift; - my $pid = $pids->{$daemon}; + my $pid = $pids->{$daemon} || 'not started'; warn "start_stop $daemon $pid\n"; @@ -137,6 +136,8 @@ sub get_request { my ( $client, $path, $param ) = @_; + server->refresh; + warn "get_request $path ", $param ? dump( $param ) : '', "\n"; if ( my $found = static( $client,$path ) ) { @@ -257,14 +258,12 @@ start_stop 'screen'; start_stop 'kvm'; - while (my $client = $server->accept()) { - $client->autoflush(1); + while (1) { + my $client = $server->accept() || next; # ALARM trickle us my $request = <$client>; warn "request $request\n" if $debug; - Module::Refresh->refresh; - if ($request =~ m{^GET (/.*) HTTP/1.[01]}) { my $path = $1; my $param;