Commit 6b4a2672 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e5d3866a
......@@ -31,6 +31,10 @@
// wcfs::
namespace wcfs {
// ErrLinkDown is the error indicating that WCFS watch link is no-longer operational.
global<error> ErrLinkDown = errors::New("link is down");
// _openwatch opens new watch link on wcfs.
pair<WatchLink, error> WCFS::_openwatch() {
WCFS *wc = this;
......@@ -285,7 +289,7 @@ tuple</*rxq*/chan<rxPkt>, error> _WatchLink::_sendReq(context::Context ctx, cons
wlink->_rxmu.lock();
if (wlink->_rxdown) {
wlink->_rxmu.unlock();
return make_tuple(nil, fmt::errorf("link is down"));
return make_tuple(nil, ErrLinkDown);
}
if (wlink->_rxtab.has(stream)) {
wlink->_rxmu.unlock();
......@@ -309,11 +313,9 @@ tuple</*rxq*/chan<rxPkt>, error> _WatchLink::_sendReq(context::Context ctx, cons
}
// replyReq sends reply to client <- server request received by recvReq.
//
// XXX document EOF. XXX -> no EOF here - only ErrUnexpectedEOF
error _WatchLink::replyReq(context::Context ctx, const PinReq *req, const string& answer) {
_WatchLink *wlink = this;
xerr::Contextf E("%s: replyReq .%d", v(wlink), req.stream);
xerr::Contextf E("%s: replyReq .%d", v(wlink), req->stream);
//print('C: reply %s <- %r ...' % (req, answer))
wlink->_rxmu.lock();
......@@ -333,7 +335,7 @@ error _WatchLink::replyReq(context::Context ctx, const PinReq *req, const string
if (!ok)
panic("BUG: stream vanished from wlink._accepted while reply was in progress");
// XXX also track as answered? (and don't accept with the same ID ?)
// TODO also track as answered? (and don't accept with the same ID ?)
return E(err);
}
......
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