[LON-CAPA-cvs] cvs: loncom / LondConnection.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 27 Feb 2004 18:32:21 -0000


albertel		Fri Feb 27 13:32:21 2004 EDT

  Modified files:              
    /loncom	LondConnection.pm 
  Log:
  - should prevent a logging death spiral when socket becomes undefined
  
  
Index: loncom/LondConnection.pm
diff -u loncom/LondConnection.pm:1.25 loncom/LondConnection.pm:1.26
--- loncom/LondConnection.pm:1.25	Mon Feb  9 08:33:16 2004
+++ loncom/LondConnection.pm	Fri Feb 27 13:32:21 2004
@@ -1,7 +1,7 @@
 #   This module defines and implements a class that represents
 #   a connection to a lond daemon.
 #
-# $Id: LondConnection.pm,v 1.25 2004/02/09 13:33:16 albertel Exp $
+# $Id: LondConnection.pm,v 1.26 2004/02/27 18:32:21 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -414,7 +414,12 @@
 sub Writable {
     my $self     = shift;		# Get reference to the object.
     my $socket   = $self->{Socket};
-    my $nwritten = $socket->send($self->{TransactionRequest}, 0);
+    my $nwritten;
+    if ($socket) {
+	eval {
+	    $nwritten = $socket->send($self->{TransactionRequest}, 0);
+	}
+    }
     my $errno    = $! + 0;
     unless (defined $nwritten) {
 	if($errno != POSIX::EINTR) {