Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
43c43472
Commit
43c43472
authored
Oct 24, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4f012c3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
20 deletions
+23
-20
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+23
-20
No files found.
wcfs/internal/wcfs_virtmem.cpp
View file @
43c43472
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment