Do not die if no packets are coming in.

This commit is contained in:
Stefan `Sec` Zehl 2012-04-05 14:41:11 +02:00
parent aefbbd5611
commit 72194bf139
1 changed files with 6 additions and 2 deletions

View File

@ -104,7 +104,7 @@ sub get_packet{
};
my $cnt=0;
while(++$cnt<100){
while(1){
if(length($buffer)<2){
_get_bytes();
}elsif($buffer !~ /^\\[12]/){
@ -123,8 +123,12 @@ sub get_packet{
}else{
_get_bytes();
};
if(++$cnt%100 == 0){
if(!$quiet){
print STDERR "No packets for 5 seconds?\n";
};
};
};
die "No packets for 5seconds?\n";
};
sub rest{