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
f3ff04c0
Commit
f3ff04c0
authored
Oct 24, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
48270acd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+14
-5
No files found.
wcfs/internal/wcfs_virtmem.cpp
View file @
f3ff04c0
...
...
@@ -382,26 +382,35 @@ tuple<WatchLink*, error> WCFS::_openwatch() {
//
// multiple _send can be called in parallel - _send serializes writes.
// XXX +ctx?
def
WatchLink
::
_send
(
StreamID
stream
,
const
string
&
msg
)
{
error
WatchLink
::
_send
(
StreamID
stream
,
const
string
&
msg
)
{
WatchLink
*
wlink
=
this
;
if
(
msg
.
find
(
'\n'
)
!=
string
::
npos
)
panic
(
"msg has
\\
n"
);
// XXX Pkt is not needed here
#if 0
Pkt pkt;
pkt.stream = stream;
pkt.rawdata = // XXX copy msg XXX + "%d <stream> ...\n" ?
//pkt = b"%d %s\n" % (stream, msg)
wlink
->
_write
(
&
pkt
)
return wlink->_write(&pkt)
#endif
pkt
=
fmt
::
sprintf
(
"%ul %s
\n
"
,
stream
,
msg
.
c_str
());
}
def
WatchLink
::
_write
(
Pkt
*
pkt
)
{
//error WatchLink::_write(const Pkt *pkt) {
error
WatchLink
::
_write
(
const
string
&
pkt
)
{
WatchLink
*
wlink
=
this
;
wlink
->
_txmu
.
lock
();
defer
([
&
]()
{
wlink
->
_txmu
.
unlock
();
})
//printf('C: watch : tx: %r' % pkt)
wlink
->
_f
.
write
(
pkt
);
// XXX all data
int
n
;
error
err
;
tie
(
n
,
err
)
=
wlink
->
_f
.
write
(
pkt
.
c_str
(),
pkt
.
size
());
return
err
;
#if 0
wlink->_wtx.write(pkt);
wlink->_wtx.flush();
...
...
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