diff options
author | Graham Barr <gbarr@pobox.com> | 2001-08-06 16:26:25 +0000 |
---|---|---|
committer | Graham Barr <gbarr@pobox.com> | 2001-08-06 16:26:25 +0000 |
commit | 975515b206dbe000e0b92919a4ec8a13c15b4890 (patch) | |
tree | 2dff30f0d45d57213a8caeeb0d7ddcea3d9f9a2b | |
parent | 4e2662fff6dbbd0789454bc43a1f8f2eb48e7658 (diff) | |
download | perl-libnet-975515b206dbe000e0b92919a4ec8a13c15b4890.tar.gz |
Set the status if command returns due to the connection being closed
-rw-r--r-- | Net/Cmd.pm | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,4 +1,4 @@ -# Net::Cmd.pm $Id: //depot/libnet/Net/Cmd.pm#23 $ +# Net::Cmd.pm $Id: //depot/libnet/Net/Cmd.pm#24 $ # # Copyright (c) 1995-1997 Graham Barr <gbarr@pobox.com>. All rights reserved. # This program is free software; you can redistribute it and/or @@ -192,7 +192,12 @@ sub command { my $cmd = shift; - return $cmd unless defined fileno($cmd); + unless (defined fileno($cmd)) + { + $cmd->set_status("599", "Connection closed"); + return $cmd; + } + $cmd->dataend() if(exists ${*$cmd}{'net_cmd_lastch'}); @@ -634,6 +639,6 @@ it under the same terms as Perl itself. =for html <hr> -I<$Id: //depot/libnet/Net/Cmd.pm#23 $> +I<$Id: //depot/libnet/Net/Cmd.pm#24 $> =cut |