Commit 43c43472 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4f012c3c
......@@ -147,6 +147,21 @@ struct _Mapping {
// StreamID stands for ID of a stream multiplexed over WatchLink.
typedef uint64_t StreamID;
// rxPkt internally represents data of one message sent/received over WatchLink.
// XXX recv only ok?
// XXX place?
struct rxPkt {
// stream over which the data was received; XXX kill: used internally by send
StreamID stream;
// raw data received/to-be-sent.
// XXX not e.g. string as chan<T> currently does not support types with
// non-trivial copy. Note: we anyway need to limit line length to avoid DoS
// but just for DoS the limit would be higher.
char rawdata[128-sizeof(StreamID)];
};
// WatchLink represents /head/watch link opened on wcfs.
//
// It is created by WCFS::_openwatch().
......@@ -161,14 +176,15 @@ class WatchLink {
chan<structZ> _rx_eof; // becomes ready when wcfs closes its tx side
// inv.protocol message IO
chan<(StreamID,msg)> _acceptq; // server originated messages go here
sync::Mutex _rxmu;
dict<StreamID, chan<XXX>> _rxtab; // {} stream -> rxq server replies go via here
set<StreamID> _accepted; // streams we accepted but did not replied yet
chan<rxPkt> _acceptq; // server originated messages go here
sync::Mutex _rxmu;
dict<StreamID, chan<rxPkt>>
_rxtab; // {} stream -> rxq server replies go via here
set<StreamID> _accepted; // streams we accepted but did not replied yet
StreamID _req_next; // stream ID for next client-originated request XXX -> atomic
sync::Mutex _txmu; // serializes writes
bool _txclosed; // XXX -> _txcloseOnce
StreamID _req_next; // stream ID for next client-originated request XXX -> atomic
sync::Mutex _txmu; // serializes writes
bool _txclosed; // XXX -> _txcloseOnce
#if 0
func() _serveCancel
......@@ -341,19 +357,6 @@ error _Mapping::_remmapblk(int64_t blk, Tid at) {
// ---- WatchLink ----
// Pkt internally represents data of one message sent/received over WatchLink.
// XXX used only for recv?
struct Pkt {
// stream over which the data was received; used internally by send
StreamID stream;
// raw data received/to-be-sent.
// XXX not e.g. string as chan<T> currently does not support types with
// non-trivial copy. Note: we anyway need to limit line length to avoid DoS
// but just for DoS the limit would be higher.
char rawdata[128-sizeof(StreamID)];
};
// _openwatch opens new watch link on wcfs.
tuple<WatchLink*, error> WCFS::_openwatch() {
WCFS *wc = this;
......
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