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
Message body not shown because it is not plain text.