From: miker Date: Thu, 11 Aug 2005 20:49:10 +0000 (+0000) Subject: fixing preconstructed Result test in AppSession X-Git-Tag: osrf_rel_2_0_1~1401 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7b052d802faf8021c9b81a488abbcad91576a1fa;p=OpenSRF.git fixing preconstructed Result test in AppSession git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@472 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/OpenSRF/AppSession.pm b/src/perlmods/OpenSRF/AppSession.pm index 865df94..679fd16 100644 --- a/src/perlmods/OpenSRF/AppSession.pm +++ b/src/perlmods/OpenSRF/AppSession.pm @@ -752,17 +752,14 @@ sub recv { $avail = @{ $self->{recv_queue} }; } - #$logger->debug( ref($self)." queue after wait: " . $self->_print_queue(), INTERNAL ); - + my @list; while ( my $msg = shift @{ $self->{recv_queue} } ) { push @list, $msg; last if (scalar(@list) >= $args{count}); } -# $self->{recv_queue} = [@unlist, @{ $self->{recv_queue} }]; $logger->debug( "Number of matched responses: " . @list, DEBUG ); - $self->queue_wait(0); # check for statuses return $list[0] unless (wantarray); @@ -948,7 +945,7 @@ sub respond { return unless ($self and $self->session and !$self->complete); my $response; - if (ref($msg) && UNIVERSAL::can($msg, 'getAttribute') && $msg->getAttribute('name') =~ /oilsResult/) { + if (ref($msg) && UNIVERSAL::isa($msg, 'OpenSRF::DomainObject::oilsResult')) { $response = $msg; } else { $response = new OpenSRF::DomainObject::oilsResult; @@ -964,7 +961,7 @@ sub respond_complete { return unless ($self and $self->session and !$self->complete); my $response; - if (ref($msg) && UNIVERSAL::can($msg, 'getAttribute') && $msg->getAttribute('name') =~ /oilsResult/) { + if (ref($msg) && UNIVERSAL::isa($msg, 'OpenSRF::DomainObject::oilsResult')) { $response = $msg; } else { $response = new OpenSRF::DomainObject::oilsResult;