ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/dm-support.ext
(Generate patch)

Comparing deliantra/maps/perl/dm-support.ext (file contents):
Revision 1.7 by root, Mon Oct 2 16:55:35 2006 UTC vs.
Revision 1.8 by root, Fri Dec 15 19:06:29 2006 UTC

13 my $buf; 13 my $buf;
14 my ($a,$b,$c,$d,%l,@l); # for use by shell users 14 my ($a,$b,$c,$d,%l,@l); # for use by shell users
15 15
16 print $fh "Welcome\n> "; 16 print $fh "Welcome\n> ";
17 17
18 Event->io (fd => $fh, poll => 'r', cb => sub { 18 Event->io (fd => $fh, poll => 'r', data => cf::WF_AUTOCANCEL, cb => sub {
19 if (defined (my $cmd = <$fh>)) { 19 if (defined (my $cmd = <$fh>)) {
20 my $old_fh = select $fh; 20 my $old_fh = select $fh;
21 21
22 if ($cmd =~ /^\s*exit\b/i) { 22 if ($cmd =~ /^\s*exit\b/i) {
23 print "will not exit() server.\n"; 23 print "will not exit() server.\n";
38} 38}
39 39
40# now a shell listening on a tcp-port - let the firewall decide access rights 40# now a shell listening on a tcp-port - let the firewall decide access rights
41if ($cf::CFG{perl_shell}) { 41if ($cf::CFG{perl_shell}) {
42 if (my $listen = new IO::Socket::INET LocalAddr => $cf::CFG{perl_shell}, Listen => 1, ReuseAddr => 1) { 42 if (my $listen = new IO::Socket::INET LocalAddr => $cf::CFG{perl_shell}, Listen => 1, ReuseAddr => 1) {
43 Event->io (fd => $listen, poll => 'r', cb => sub { tcp_serve $listen->accept }); 43 Event->io (fd => $listen, poll => 'r', data => cf::WF_AUTOCANCEL, cb => sub { tcp_serve $listen->accept });
44 } 44 }
45} 45}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines