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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
1301bbc7
Commit
1301bbc7
authored
Oct 28, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
5c02054e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+21
-1
No files found.
wcfs/internal/wcfs_virtmem.cpp
View file @
1301bbc7
...
...
@@ -41,6 +41,7 @@ using namespace golang;
#include <sys/stat.h>
#include <unistd.h>
#include <stdint.h>
#include <inttypes.h>
#include "wcfs_misc.h"
...
...
@@ -470,12 +471,13 @@ error WatchLink::_serveRX(IContext *ctx) { // XXX error -> where ?
string
l
;
error
err
;
rxPkt
pkt
;
while
(
1
)
{
// NOTE: .close() makes sure .f.read*() will wake up
tie
(
l
,
err
)
=
wlink
.
_readline
();
if
(
err
==
io
::
EOF_
)
{
// peer closed its tx
// XXX what happens
with
other errors?
// XXX what happens
on
other errors?
wlink
.
_rx_eof
.
close
();
}
if
(
err
!=
nil
)
...
...
@@ -483,6 +485,24 @@ error WatchLink::_serveRX(IContext *ctx) { // XXX error -> where ?
printf
(
"C: watch : rx: %s"
,
l
.
c_str
());
// <stream> ... \n
sp
=
l
.
find
(
' '
);
if
(
sp
==
string
::
npos
)
{
// XXX invalid pkt: no sp
return
fmt
.
errorf
(
"invalid pkt: no SP"
);
}
sid
=
string
(
l
,
0
,
sp
);
smsg
=
string
(
l
,
sp
+
1
);
sscanf
(
sid
.
c_str
(),
"%"
SCNu64
,
&
pkt
.
streamID
);
snprintf
(....,
"%"
PRIu64
,
pkt
.
streamID
);
if
(
string
(...)
!=
sid
)
return
fmt
.
errorf
(
"invalid pkt: invalid stream ID"
);
// XXX len(data) > pkt.data?
// XXX copy data -> pkt.data
stream
,
msg
=
l
.
split
(
' '
,
1
)
stream
=
int
(
stream
)
msg
=
msg
.
rstrip
(
'\n'
)
...
...
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