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
c70438d5
Commit
c70438d5
authored
Mar 10, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3c43bcbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
wcfs/client/wcfs_watchlink.cpp
wcfs/client/wcfs_watchlink.cpp
+8
-8
No files found.
wcfs/client/wcfs_watchlink.cpp
View file @
c70438d5
...
...
@@ -218,37 +218,37 @@ error _WatchLink::_serveRX(context::Context ctx) {
//
// XXX +ctx?
error
_WatchLink
::
_send
(
StreamID
stream
,
const
string
&
msg
)
{
_WatchLink
*
wlink
=
this
;
_WatchLink
&
wlink
=
*
this
;
// XXX +errctx ?
if
(
msg
.
find
(
'\n'
)
!=
string
::
npos
)
panic
(
"msg has
\\
n"
);
string
pkt
=
fmt
::
sprintf
(
"%lu %s
\n
"
,
stream
,
v
(
msg
));
return
wlink
->
_write
(
pkt
);
return
wlink
.
_write
(
pkt
);
}
error
_twlinkwrite
(
WatchLink
wlink
,
const
string
&
pkt
)
{
return
wlink
->
_write
(
pkt
);
}
error
_WatchLink
::
_write
(
const
string
&
pkt
)
{
_WatchLink
*
wlink
=
this
;
_WatchLink
&
wlink
=
*
this
;
// XXX +errctx ?
wlink
->
_txmu
.
lock
();
wlink
.
_txmu
.
lock
();
defer
([
&
]()
{
wlink
->
_txmu
.
unlock
();
wlink
.
_txmu
.
unlock
();
});
//trace('C: watch : tx: %r' % pkt)
int
n
;
error
err
;
tie
(
n
,
err
)
=
wlink
->
_f
->
write
(
pkt
.
c_str
(),
pkt
.
size
());
tie
(
n
,
err
)
=
wlink
.
_f
->
write
(
pkt
.
c_str
(),
pkt
.
size
());
return
err
;
}
// sendReq sends client -> server request and returns server reply.
// XXX -> reply | None when EOF
pair
<
string
,
error
>
_WatchLink
::
sendReq
(
context
::
Context
ctx
,
const
string
&
req
)
{
_WatchLink
*
wlink
=
this
;
_WatchLink
&
wlink
=
*
this
;
xerr
::
Contextf
E
(
"%s: sendReq"
,
v
(
wlink
));
// XXX + streamID
//printf("wlink sendReq '%s'\n", v(req));
...
...
@@ -256,7 +256,7 @@ pair<string, error> _WatchLink::sendReq(context::Context ctx, const string &req)
rxPkt
rx
;
bool
ok
;
chan
<
rxPkt
>
rxq
;
error
err
;
tie
(
rxq
,
err
)
=
wlink
->
_sendReq
(
ctx
,
req
);
tie
(
rxq
,
err
)
=
wlink
.
_sendReq
(
ctx
,
req
);
if
(
err
!=
nil
)
return
make_pair
(
""
,
E
(
err
));
...
...
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