ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/myhttpd/shell.pl
(Generate patch)

Comparing Coro/myhttpd/shell.pl (file contents):
Revision 1.22 by pcg, Thu Feb 12 22:18:27 2004 UTC vs.
Revision 1.23 by root, Sat Dec 8 21:01:17 2007 UTC

1# a server command shell 1# a server command shell
2 2
3use EV;
3use Coro; 4use Coro;
5use Coro::EV;
4use Coro::Handle; 6use Coro::Handle;
5use Coro::Socket; 7use Coro::Socket;
6use Event;
7use Time::HiRes 'time'; 8use Time::HiRes 'time';
8 9
9use Text::Abbrev; 10use Text::Abbrev;
10 11
11my $last_ts = time; 12my $last_ts = time;
24 if ($cmd eq "quit") { 25 if ($cmd eq "quit") {
25 print $fh "bye bye.\n";#d# 26 print $fh "bye bye.\n";#d#
26 last; 27 last;
27 } elsif ($cmd eq "squit") { 28 } elsif ($cmd eq "squit") {
28 print $fh "server quit.\n";#d# 29 print $fh "server quit.\n";#d#
29 Event::unloop; 30 EV::unloop;
30 last; 31 last;
31 } elsif ($cmd eq "print") { 32 } elsif ($cmd eq "print") {
32 my @res = eval $_; 33 my @res = eval $_;
33 print $fh "eval: $@\n" if $@; 34 print $fh "eval: $@\n" if $@;
34 print $fh "RES = ", (join " : ", @res), "\n"; 35 print $fh "RES = ", (join " : ", @res), "\n";
59 } elsif ($cmd eq "clrdiridx") { 60 } elsif ($cmd eq "clrdiridx") {
60 %statdata_cache = (); 61 %statdata_cache = ();
61 delete $diridx{$_} for keys %diridx; # server error on %diridx = (); 62 delete $diridx{$_} for keys %diridx; # server error on %diridx = ();
62 } elsif ($cmd eq "restart") { 63 } elsif ($cmd eq "restart") {
63 $::RESTART = 1; 64 $::RESTART = 1;
64 unloop; 65 EV::unloop;
65 print $fh "restarting, cu!\n"; 66 print $fh "restarting, cu!\n";
66 last; 67 last;
67 } elsif ($cmd eq "country") { 68 } elsif ($cmd eq "country") {
68 print $fh netgeo::ip_request($_), "\n"; 69 print $fh netgeo::ip_request($_), "\n";
69 } 70 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines