From f27e9460a85b5ba3ec8b51d14808220023b70917 Mon Sep 17 00:00:00 2001 From: minima Date: Fri, 30 Mar 2001 18:34:45 +0000 Subject: [PATCH] decode AGW messages when there 36 bytes available --- perl/AGWMsg.pm | 7 +++++-- perl/Msg.pm | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/perl/AGWMsg.pm b/perl/AGWMsg.pm index 7582e2c7..a2a353f4 100644 --- a/perl/AGWMsg.pm +++ b/perl/AGWMsg.pm @@ -183,6 +183,8 @@ sub _rcv { # Complement to _send if (defined ($bytes_read)) { if ($bytes_read > 0) { $inmsg .= $msg; +# $msg =~ s/([\x00-\x1f\x7f-\xff])/sprintf("%%%02X", ord($1))/eg; +# dbg('connll', $msg); } } else { if (Msg::_err_will_block($!)) { @@ -196,7 +198,7 @@ FINISH: if (defined $bytes_read && $bytes_read == 0) { finish(); } else { - _decode() if length $inmsg > 36; + _decode() if length $inmsg >= 36; } } @@ -358,7 +360,8 @@ sub _decode dbg('agw', "AGW Port: $_"); } for (my $i = 0; $i < $noports; $i++) { - _sendf('y', undef, undef, $i ); + _sendf('y', undef, undef, $i); + _sendf('g', undef, undef, $i); } } else { my $d = unpack "Z*", $data; diff --git a/perl/Msg.pm b/perl/Msg.pm index 3b9dbd36..d1f2589b 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -482,7 +482,7 @@ sub event_loop { # Quit the loop if no handles left to process last unless ($rd_handles->count() || $wt_handles->count()); - ($rset, $wset) = IO::Select->select($rd_handles, $wt_handles, $er_handles, $timeout); + ($rset, $wset, $eset) = IO::Select->select($rd_handles, $wt_handles, $er_handles, $timeout); foreach $e (@$eset) { &{$er_callbacks{$e}}($e) if exists $er_callbacks{$e}; -- 2.43.0