[LON-CAPA-cvs] cvs: loncom / loncnew

foxr foxr@source.lon-capa.org
Mon, 10 Jan 2011 12:23:01 -0000


foxr		Mon Jan 10 12:23:01 2011 EDT

  Modified files:              
    /loncom	loncnew 
  Log:
  Insulate child processes from SIGPIPE that will get thrown on a 
  disconnect.
  
  
Index: loncom/loncnew
diff -u loncom/loncnew:1.92 loncom/loncnew:1.93
--- loncom/loncnew:1.92	Tue Dec 21 11:17:03 2010
+++ loncom/loncnew	Mon Jan 10 12:23:00 2011
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # lonc maintains the connections to remote computers
 #
-# $Id: loncnew,v 1.92 2010/12/21 11:17:03 foxr Exp $
+# $Id: loncnew,v 1.93 2011/01/10 12:23:00 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1733,6 +1733,13 @@
 		  cb       => \&ToggleDebug,
 		  data     => "INT");
 
+    # Block the pipe signal we'll get when the socket disconnects.  We detect 
+    # socket disconnection via send/receive failures. On disconnect, the
+    # socket becomes readable .. which will force the disconnect detection.
+
+    my $set = POSIX::SigSet->new(SIGPIPE);
+    sigprocmask(SIG_BLOCK, $set);
+
     #  Figure out if we got passed a socket or need to open one to listen for
     #  client requests.