]> dxcluster.net Git - spider.git/commitdiff
decode AGW messages when there 36 bytes available
authorminima <minima>
Fri, 30 Mar 2001 18:34:45 +0000 (18:34 +0000)
committerminima <minima>
Fri, 30 Mar 2001 18:34:45 +0000 (18:34 +0000)
perl/AGWMsg.pm
perl/Msg.pm

index 7582e2c723be8d45e0e3b0f23293e3d6f72174a3..a2a353f42e47c394bc5cb128b6826cbd26dbfe5c 100644 (file)
@@ -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;
index 3b9dbd36f2a4f546f4b25169f1360b0552bed40d..d1f2589b0aabb58d96af1d44a7b6f6b51d459bdf 100644 (file)
@@ -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};