Commit 2eb9c369 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e19d6686
......@@ -152,19 +152,18 @@ class WatchLink {
chan<structZ> _rxeof; // becomes ready when wcfs closes its tx side
// inv.protocol message IO
_acceptq = chan() // (stream, msg) server originated messages go here
sync::Mutex _rxmu;
chan<(stream,msg)> _acceptq; // server originated messages go here
sync::Mutex _rxmu;
dict<stream, chan<XXX>> _rxtab; // {} stream -> rxq server replies go via here
set<stream> _accepted; // streams we accepted but did not replied yet
set<stream> _accepted; // streams we accepted but did not replied yet
XXXint _req_next = 1; // stream ID for next client-originated request XXX -> atomic
sync::Mutex _txmu // serializes writes
bool _txclosed; // XXX = False
#if 0
serveCtx, wlink._serveCancel = context.with_cancel(context.background())
wlink._serveWG = sync.WorkGroup(serveCtx)
wlink._serveWG.go(wlink._serveRX)
func() _serveCancel
sync.WorkGroup *_serveWG
#endif
public:
......@@ -174,10 +173,10 @@ public:
// SrvReq represents 1 server-initiated wcfs request received over /head/watch link.
// XXX -> PinReq?
struct SrvReq {
// XXX
Oid foid; // request is about this file
int64_t blk; // ----//---- about this block
Tid at; // pin to this at XXX ffff = None = unpin
uint64_t stream // request was received with this stream ID
Oid foid; // request is about this file
int64_t blk; // ----//---- about this block
Tid at; // pin to this at XXX ffff = None = unpin
};
......@@ -335,9 +334,18 @@ tuple<WatchLink*, error> WCFS::_openwatch() {
return make_tuple(NULL, err);
wlink = new(WatchLink);
wlink->_wc = wc;
wlink->_f = f;
wlink->rx_eof = makechan<structZ>();
wlink->_wc = wc;
wlink->_f = f;
wlink->_rx_eof = makechan<structZ>();
wlink->_acceptq = makechan<XXX>();
wlink->_req_next = 1;
wlink->_txclosed = false;
#if 0
serveCtx, wlink._serveCancel = context.with_cancel(context.background())
wlink->_serveWG = sync.WorkGroup(serveCtx)
wlink->_serveWG.go(wlink._serveRX)
#endif
}
// XXX close
......
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