From e26dbd289a6700d4e07cf6b1c346832d85719437 Mon Sep 17 00:00:00 2001 From: ian Date: Sun, 8 Jun 2008 00:18:38 +0000 Subject: [PATCH] cope if client of current command dies --- hostside/multiplex | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hostside/multiplex b/hostside/multiplex index 0607825..9415dd1 100755 --- a/hostside/multiplex +++ b/hostside/multiplex @@ -82,7 +82,9 @@ proc xmit-relevantly {m} { if {$executing} { puts "<* $m" set myconn $currentconn - trapping xmit-only-noreport $currentconn +$m + if {[string length $currentconn]} { + trapping xmit-only-noreport $currentconn +$m + } set othersm -$m } else { puts "<& $m" @@ -371,9 +373,12 @@ proc xmit-only {conn msg} { #---------- error handling ---------- proc kill-conn {conn msg} { - global conns queueing + global conns queueing currentconn upvar #0 c/$conn c catch { unset conns($conn) } ;# do this first to stop any recursion + if {[info exists currentconn]} { + if {![string compare $currentconn $conn]} { set currentconn {} } + } puts "<$conn\$ closing : $msg" if {[string length $msg]} { catch { xmit-only-always $conn "$msg" } } catch { close $conn } -- 2.30.2