Commit 8045d1e3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d80f5e07
...@@ -410,8 +410,13 @@ void WatchLink::_closeTX() { ...@@ -410,8 +410,13 @@ void WatchLink::_closeTX() {
// 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). The connection can be already closed // _serveRX on client (= on us). The connection can be already closed
// by wcfs - so ignore errors when sending bye. // by wcfs - so ignore errors when sending bye.
(void)wlink._send(1, "bye"); (void)wlink._send(1, "bye"); // XXX stream ok?
wlink._wtx.close(); // XXX ._f.closeTX() ? XXX err // XXX vvv should be ~ shutdown(TX, wlink._f), however shutdown does
// not work for non-socket file descriptors. And even if we dup link
// fd, and close only one used for TX, peer's RX will still be blocked
// ad fds are referring to one file object which stays in opened
// state. So just use ^^^ "bye" as "TX closed" message.
// wlink._wtx.close();
}); });
} }
...@@ -420,6 +425,7 @@ error WatchLink::close() { ...@@ -420,6 +425,7 @@ error WatchLink::close() {
WatchLink& wlink = *this; WatchLink& wlink = *this;
wlink._closeTX(); wlink._closeTX();
#if 0
wlink._serveCancel(); wlink._serveCancel();
// 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
...@@ -431,8 +437,11 @@ error WatchLink::close() { ...@@ -431,8 +437,11 @@ error WatchLink::close() {
// canceled is expected and ok // canceled is expected and ok
if (err == context.canceled) if (err == context.canceled)
err = nil; err = nil;
#else
error err = nil;
#endif
error err2 = wlink._wrx.close(); // XXX err; error err2 = wlink._f.close();
if (err == nil) if (err == nil)
err = err2; err = err2;
......
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