Skip Menu |

This queue is for tickets about the Net-Appliance-Session CPAN distribution.

Report information
The Basics
Id: 65453
Status: resolved
Priority: 0/
Queue: Net-Appliance-Session

People
Owner: OLIVER [...] cpan.org
Requestors: steve [...] computurn.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.110090
Fixed in: (no value)



Subject: Another enhancement to prevent Net::Appliance::Session::close() doing anything it shouldn't
Adding the code below to the top of Net::Appliance::Session::close() prevents it from doing anything unless it's actually in an open session. # Just return if we're in an open session. my $s = *$self->{net_telnet}; return unless $s->{opened};
On Fri Feb 04 12:39:00 2011, STEVEC wrote: Show quoted text
> Adding the code below to the top of Net::Appliance::Session::close() > prevents it from doing anything unless it's actually in an open session. > > # Just return if we're in an open session. > my $s = *$self->{net_telnet}; > return unless $s->{opened};
Many thanks for this. I'm interested: is it that the module is calling close() when it shouldn't do (i.e. when there is no connection), or this is protection against the user calling close() in the wrong situation? regards, oliver.
Subject: Re: [rt.cpan.org #65453] Another enhancement to prevent Net::Appliance::Session::close() doing anything it shouldn't
Date: Sun, 6 Feb 2011 20:14:14 +0000 (GMT)
To: Oliver Gorwits via RT <bug-Net-Appliance-Session [...] rt.cpan.org>
From: Steve Campbell <campbels [...] computurn.com>
Oliver, The problem occurs when your disconnect() needs to send a disconnect command to the remote device (some of our Cisco devices have issues if you disconnect without calling 'exit' first). open() calls close() to ensure that you're not already open. close() calls disconnect(). disconnect() tries to write a disconnect command to a filehandle which isn't open, and it dies with an error message. Of couse the proper fix is for this check to be in Net::Telnet::open(), but hey ho. Steve On Sat, 5 Feb 2011, Oliver Gorwits via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=65453 > > > On Fri Feb 04 12:39:00 2011, STEVEC wrote:
>> Adding the code below to the top of Net::Appliance::Session::close() >> prevents it from doing anything unless it's actually in an open session. >> >> # Just return if we're in an open session. >> my $s = *$self->{net_telnet}; >> return unless $s->{opened};
> > Many thanks for this. > > I'm interested: is it that the module is calling close() when it shouldn't do (i.e. when there is no > connection), or this is protection against the user calling close() in the wrong situation? > > regards, > oliver. > >
On Fri Feb 04 12:39:00 2011, STEVEC wrote: Show quoted text
> Adding the code below to the top of Net::Appliance::Session::close() > prevents it from doing anything unless it's actually in an open session.
Thanks, I've just shipped v2.110470 to CPAN. -- regards, oliver.