… | |
… | |
49 | my $sub = sub { |
49 | my $sub = sub { |
50 | package cf; |
50 | package cf; |
51 | select $fh; |
51 | select $fh; |
52 | |
52 | |
53 | # compile first, the execute, as Coro does not support switching in eval string |
53 | # compile first, the execute, as Coro does not support switching in eval string |
54 | my $cb = eval "sub { $cmd }"; |
54 | my $cb = eval "sub { $cmd \n}"; |
55 | |
55 | |
56 | my $t1 = Time::HiRes::time; |
56 | my $t1 = Time::HiRes::time; |
57 | my @res = $@ ? () : eval { $cb->() }; |
57 | my @res = $@ ? () : eval { $cb->() }; |
58 | my $t2 = Time::HiRes::time; |
58 | my $t2 = Time::HiRes::time; |
59 | |
59 | |
… | |
… | |
87 | |
87 | |
88 | our $LISTENER; |
88 | our $LISTENER; |
89 | |
89 | |
90 | # now a shell listening on a tcp-port - let the firewall decide access rights |
90 | # now a shell listening on a tcp-port - let the firewall decide access rights |
91 | if ($cf::CFG{perl_shell}) { |
91 | if ($cf::CFG{perl_shell}) { |
92 | if (my $listen = new IO::Socket::INET LocalAddr => $cf::CFG{perl_shell}, Listen => 1, ReuseAddr => 1) { |
92 | if (my $listen = new IO::Socket::INET LocalAddr => $cf::CFG{perl_shell}, Listen => 1, ReuseAddr => 1, Blocking => 0) { |
93 | $LISTENER = EV::io $listen, EV::READ, sub { tcp_serve $listen->accept }; |
93 | $LISTENER = EV::io $listen, EV::READ, sub { tcp_serve $listen->accept }; |
94 | } |
94 | } |
95 | } |
95 | } |
96 | |
96 | |
97 | |
97 | |