Commit 266a2474 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b9efdbbb
......@@ -502,8 +502,12 @@ class tWatchLink:
t._serveCancel()
# ask wcfs to close its tx & rx sides; close(wcfs.tx) wakes up
# _serveRX on client (= on us).
t._send(1, b'bye')
# _serveRX on client (= on us). The connection can be already closed by
# wcfs - so ignore errorswhen sending bye.
try:
t._send(1, b'bye')
except IOError:
pass
# XXX we can get stuck here if wcfs does not behave as we want.
# XXX in particular if there is a silly - e.g. syntax or type error in
# test code - we curently get stuck here.
......@@ -527,7 +531,6 @@ class tWatchLink:
def _serveRX(t, ctx):
# when finishing - wakeup everyone waiting for rx
def _():
t.rx_eof.close()
t._acceptq.close()
with t._rxmu:
rxtab = t._rxtab
......@@ -540,8 +543,9 @@ class tWatchLink:
# NOTE: .close() makes sure ._wrx.read*() will wake up
l = t._wrx.readline()
print('C: watch : rx: %r' % l)
if len(l) == 0:
break # closed
if len(l) == 0: # peer closed its tx
t.rx_eof.close()
break
# <stream> ... \n
stream, msg = l.split(' ', 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment