X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fclient.pl;h=ffae6e584ebfbc5fc4c5fa44ef7f929cbe031bc9;hb=d8b3b94c40205c64e08402f4a4b272a55c14f80d;hp=c39bda4c0fbde42c8b1e3890a85773e22be5c960;hpb=97d5445b1e468d9228367640421b2f90ac021224;p=spider.git diff --git a/perl/client.pl b/perl/client.pl index c39bda4c..ffae6e58 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -110,7 +110,7 @@ sub rec_socket $line =~ s/\n/\r/og if $mode == 1; #my $p = qq($line$snl); if ($buffered) { - if (length $outqueue >= 128) { + if (length $outqueue >= $client_buffer_lth) { print $stdout $outqueue; $outqueue = ""; } @@ -296,12 +296,12 @@ sub timeout $mode = 2; # 1 - \n = \r as EOL, 2 - \n = \n, 0 - transparent $call = ""; # the callsign being used -@stdoutq = (); # the queue of stuff to send out to the user $conn = 0; # the connection object for the cluster $lastbit = ""; # the last bit of an incomplete input line $mynl = "\n"; # standard terminator $lasttime = time; # lasttime something happened on the interface -$outqueue = ""; # the output queue length +$outqueue = ""; # the output queue +$client_buffer_lth = 200; # how many characters are buffered up on outqueue $buffered = 1; # buffer output $savenl = ""; # an NL that has been saved from last time $timeout = 60; # default timeout for connects @@ -317,6 +317,7 @@ $stdout = *STDOUT; $rfh = 0; $wfh = 0; +$waitedpid = 0; # # deal with args @@ -344,6 +345,7 @@ $SIG{'INT'} = \&sig_term; $SIG{'TERM'} = \&sig_term; $SIG{'HUP'} = 'IGNORE'; $SIG{'CHLD'} = \&sig_chld; +$SIG{'ALRM'} = \&timeout; dbgadd('connect'); @@ -359,7 +361,7 @@ if ($loginreq) { close(I); $issue = s/\n/\r/og if $mode == 1; local $/ = $nl; - $stdout->print($issue) if issue; + $stdout->print($issue) if $issue; } @@ -414,7 +416,7 @@ if ($connsort eq "connect") { open(IN, "$cpath/$mcall") or cease(2); @in = ; close IN; - + alarm($timeout); for (@in) { @@ -442,7 +444,7 @@ if ($connsort eq "connect") { # close W; $stdin = $rfh; $stdout = $wfh; - $csort = 'telnet' if $sort eq 'prog'; + $csort = 'telnet' if $csort eq 'prog'; } elsif ($csort eq 'telnet') { # open(STDIN, "<&$sock"); # open(STDOUT, ">&$sock");