From 4f18197b2cd32f3dea170f783201005777160523 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 22 Feb 2007 17:46:23 +0000 Subject: [PATCH] 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. --- lib/ZOOM/IRSpy.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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; -- 1.7.10.4