about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2001-08-06 16:26:25 +0000
committerGraham Barr <gbarr@pobox.com>2001-08-06 16:26:25 +0000
commit975515b206dbe000e0b92919a4ec8a13c15b4890 (patch)
tree2dff30f0d45d57213a8caeeb0d7ddcea3d9f9a2b
parent4e2662fff6dbbd0789454bc43a1f8f2eb48e7658 (diff)
downloadperl-libnet-975515b206dbe000e0b92919a4ec8a13c15b4890.tar.gz
Set the status if command returns due to the connection being closed
-rw-r--r--Net/Cmd.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/Net/Cmd.pm b/Net/Cmd.pm
index a0dff98..0007047 100644
--- a/Net/Cmd.pm
+++ b/Net/Cmd.pm
@@ -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