Commit a631c5ab authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0ca57f0d
......@@ -88,7 +88,9 @@ error _WatchLink::close() {
// TODO -> better pthread_kill(SIGINT) instead of relying on wcfs proper behaviour?
error err2 = wlink._serveWG->wait();
// XXX getting ErrLinkDown from wait - ok?
if (errors::Is(err2, context::canceled)) // canceled is expected and ok
if (errors::Is(err2, context::canceled) || // we canceled _serveWG
errors::Is(err2, io::EOF_) || // EOF received from WCFS
errors::Is(err2, ErrLinkDown)) // link shutdown due to logic error; details logged
err2 = nil;
error err3 = wlink._f->close();
......@@ -153,7 +155,6 @@ error _WatchLink::_serveRX(context::Context ctx) {
if (err != nil) {
// peer closed its tx
if (err == io::EOF_) {
err = nil;
rxeof = true;
wlink.rx_eof.close();
}
......@@ -168,7 +169,7 @@ error _WatchLink::_serveRX(context::Context ctx) {
if (pkt.stream == 0) { // control/fatal message from wcfs
log::Errorf("C: watch : rx fatal: %s\n", v(l));
wlink.fatalv.push_back(pkt.to_string());
return ErrLinkDown; // XXX correct error
return E(ErrLinkDown); // XXX correct error
}
bool reply = (pkt.stream % 2 != 0);
......
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