From: Mike Taylor Date: Thu, 22 Feb 2007 17:46:23 +0000 (+0000) Subject: Ignore errors detected on RECV_APDU except when the task is Connect. X-Git-Tag: CPAN-v1.02~605 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=dfad8457017003a53ac4449456e632439fdb3235;p=irspy-moved-to-github.git Ignore errors detected on RECV_APDU except when the task is Connect. Nasty special case, will probably go away when I add the event-flushing code. --- diff --git a/lib/ZOOM/IRSpy.pm b/lib/ZOOM/IRSpy.pm index b2e0f15..6ea8910 100644 --- a/lib/ZOOM/IRSpy.pm +++ b/lib/ZOOM/IRSpy.pm @@ -1,4 +1,4 @@ -# $Id: IRSpy.pm,v 1.63 2007-02-22 15:43:13 mike Exp $ +# $Id: IRSpy.pm,v 1.64 2007-02-22 17:46:23 mike Exp $ package ZOOM::IRSpy; @@ -427,14 +427,19 @@ sub check { eval { $conn->_check() }; if ($@ && ($ev == ZOOM::Event::RECV_DATA || - $ev == ZOOM::Event::ZEND)) { + $ev == ZOOM::Event::ZEND || + ($ev == ZOOM::Event::RECV_APDU && + !$task->isa("ZOOM::IRSpy::Task::Connect")))) { # An error in, say, a search response, becomes visible to # ZOOM before the Receive Data event is sent and persists # until after the End, which means that successive events # each report the same error. So we just ignore errors on - # "unimportant" events. ### But this doesn't work for, - # say, a Connection Refused, as the only event that shows - # us this error is the ZEND. + # "unimportant" events. We can also ignore errors on + # RECV_APDU in most cases, but since there is no RECV_INIT + # event, we need to avoid doing this if the task is + # Connect. Yuck -- special cases. + # ### But this doesn't work for, say, a Connection Refused, + # as the only event that shows us this error is the ZEND. $conn->log("irspy_event", "ignoring error ", "on event $ev ($evstr): $@"); next;