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

.

parent b9efdbbb
...@@ -502,8 +502,12 @@ class tWatchLink: ...@@ -502,8 +502,12 @@ class tWatchLink:
t._serveCancel() t._serveCancel()
# ask wcfs to close its tx & rx sides; close(wcfs.tx) wakes up # ask wcfs to close its tx & rx sides; close(wcfs.tx) wakes up
# _serveRX on client (= on us). # _serveRX on client (= on us). The connection can be already closed by
t._send(1, b'bye') # 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 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 # XXX in particular if there is a silly - e.g. syntax or type error in
# test code - we curently get stuck here. # test code - we curently get stuck here.
...@@ -527,7 +531,6 @@ class tWatchLink: ...@@ -527,7 +531,6 @@ class tWatchLink:
def _serveRX(t, ctx): def _serveRX(t, ctx):
# when finishing - wakeup everyone waiting for rx # when finishing - wakeup everyone waiting for rx
def _(): def _():
t.rx_eof.close()
t._acceptq.close() t._acceptq.close()
with t._rxmu: with t._rxmu:
rxtab = t._rxtab rxtab = t._rxtab
...@@ -540,8 +543,9 @@ class tWatchLink: ...@@ -540,8 +543,9 @@ class tWatchLink:
# NOTE: .close() makes sure ._wrx.read*() will wake up # NOTE: .close() makes sure ._wrx.read*() will wake up
l = t._wrx.readline() l = t._wrx.readline()
print('C: watch : rx: %r' % l) print('C: watch : rx: %r' % l)
if len(l) == 0: if len(l) == 0: # peer closed its tx
break # closed t.rx_eof.close()
break
# <stream> ... \n # <stream> ... \n
stream, msg = l.split(' ', 1) 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