Skip Menu |

This queue is for tickets about the Net-CLI-Interact CPAN distribution.

Report information
The Basics
Id: 101360
Status: resolved
Priority: 0/
Queue: Net-CLI-Interact

People
Owner: Nobody in particular
Requestors: allonikramer [...] gmail.com
Cc:
AdminCc:

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



Subject: When a connection is closed from the other side, Net::CLI::Interact session flounders until timeout.
Date: Tue, 6 Jan 2015 14:53:36 -0600
To: bug-Net-CLI-Interact [...] rt.cpan.org
From: Alloni Kramer <allonikramer [...] gmail.com>
When a connection is closed from the other side - due to a login failure causing the server to kill the connection, or similar - Net::CLI::Interact eternally (or until timeout) a) checks for new output, which there is none of due to the killed connection, and b) checks the existing, unchanged output buffer to see if it matches any of the prompts in the phrasebook, which will never happen since the output is unchanged. Since Net::Telnet does report when the output buffer is empty and has hit eof (by returning undef on a Net::Telnet::get() call), I'm attaching a patchfile which resolves this issue for Net::Telnet. Note that a) this is probably not the most efficient way to do it, but I'm not familiar enough with Moo/Moose to do it better, and b) IPC::Run does not seem to have any such easy way to tell if things have been shut down (or at least not that I can find in its documentation), so I've left it (mostly) untouched. Thanks, Alloni Kramer
Download patchfile
application/octet-stream 2.6k

Message body not shown because it is not plain text.

Hi, Seems reasonable enough to me, but I have one concern, which is that if this line: my $content = $self->wrapper->get(Timeout => $self->timeout); can legitimately return *without* timing out, then simply checking the content isn't sufficient. We would accidentally close when we want to pump again. Can you advise? regards, oliver. On Tue Jan 06 15:53:45 2015, allonikramer@gmail.com wrote: Show quoted text
> When a connection is closed from the other side - due to a login failure > causing the server to kill the connection, or similar - Net::CLI::Interact > eternally (or until timeout) a) checks for new output, which there is none > of due to the killed connection, and b) checks the existing, unchanged > output buffer to see if it matches any of the prompts in the phrasebook, > which will never happen since the output is unchanged. > > Since Net::Telnet does report when the output buffer is empty and has hit > eof (by returning undef on a Net::Telnet::get() call), I'm attaching a > patchfile which resolves this issue for Net::Telnet. Note that a) this is > probably not the most efficient way to do it, but I'm not familiar enough > with Moo/Moose to do it better, and b) IPC::Run does not seem to have any > such easy way to tell if things have been shut down (or at least not that I > can find in its documentation), so I've left it (mostly) untouched. > > Thanks, > Alloni Kramer
-- regards, oliver.