… | |
… | |
12 | s/\015?\012$//; |
12 | s/\015?\012$//; |
13 | chomp; |
13 | chomp; |
14 | if (/^q/) { |
14 | if (/^q/) { |
15 | Event::unloop; |
15 | Event::unloop; |
16 | } elsif (/^i/) { |
16 | } elsif (/^i/) { |
17 | my @conn; |
17 | my @data; |
18 | push @conn, values %$_ for values %conn::conn; |
|
|
19 | for (values %conn::conn) { |
18 | for (values %conn::conn) { |
20 | for (values %$_) { |
19 | for (values %$_) { |
21 | next unless $_; |
20 | next unless $_; |
22 | print $fh "$_: $_->{remote_addr} $_->{uri}\n"; |
21 | push @data, "$_: $_->{remote_addr} $_->{uri}\n"; |
23 | } |
22 | } |
24 | } |
23 | } |
|
|
24 | print $fh sort @data; |
|
|
25 | print $fh scalar@data, " connections\n";#d# |
25 | } elsif (/^r/) { |
26 | } elsif (/^r/) { |
26 | $::RESTART = 1; |
27 | $::RESTART = 1; |
27 | unloop; |
28 | unloop; |
28 | print $fh "bye bye.\n"; |
29 | print $fh "bye bye.\n"; |
29 | last; |
30 | last; |
… | |
… | |
43 | or die "unable to bind cmdshell port: $!"; |
44 | or die "unable to bind cmdshell port: $!"; |
44 | |
45 | |
45 | push @listen_sockets, $port; |
46 | push @listen_sockets, $port; |
46 | |
47 | |
47 | async { |
48 | async { |
48 | async \&shell, $port->accept; |
49 | async \&shell, $port->accept |
|
|
50 | while 1; |
49 | }; |
51 | }; |
50 | } |
52 | } |
51 | |
53 | |
52 | # bind to stdin (debug) |
54 | # bind to stdin (debug) |
53 | if (1) { |
55 | if (1) { |