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
6b4a2672
Commit
6b4a2672
authored
Mar 09, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e5d3866a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
wcfs/client/wcfs_watchlink.cpp
wcfs/client/wcfs_watchlink.cpp
+7
-5
No files found.
wcfs/client/wcfs_watchlink.cpp
View file @
6b4a2672
...
@@ -31,6 +31,10 @@
...
@@ -31,6 +31,10 @@
// wcfs::
// wcfs::
namespace
wcfs
{
namespace
wcfs
{
// ErrLinkDown is the error indicating that WCFS watch link is no-longer operational.
global
<
error
>
ErrLinkDown
=
errors
::
New
(
"link is down"
);
// _openwatch opens new watch link on wcfs.
// _openwatch opens new watch link on wcfs.
pair
<
WatchLink
,
error
>
WCFS
::
_openwatch
()
{
pair
<
WatchLink
,
error
>
WCFS
::
_openwatch
()
{
WCFS
*
wc
=
this
;
WCFS
*
wc
=
this
;
...
@@ -285,7 +289,7 @@ tuple</*rxq*/chan<rxPkt>, error> _WatchLink::_sendReq(context::Context ctx, cons
...
@@ -285,7 +289,7 @@ tuple</*rxq*/chan<rxPkt>, error> _WatchLink::_sendReq(context::Context ctx, cons
wlink
->
_rxmu
.
lock
();
wlink
->
_rxmu
.
lock
();
if
(
wlink
->
_rxdown
)
{
if
(
wlink
->
_rxdown
)
{
wlink
->
_rxmu
.
unlock
();
wlink
->
_rxmu
.
unlock
();
return
make_tuple
(
nil
,
fmt
::
errorf
(
"link is down"
)
);
return
make_tuple
(
nil
,
ErrLinkDown
);
}
}
if
(
wlink
->
_rxtab
.
has
(
stream
))
{
if
(
wlink
->
_rxtab
.
has
(
stream
))
{
wlink
->
_rxmu
.
unlock
();
wlink
->
_rxmu
.
unlock
();
...
@@ -309,11 +313,9 @@ tuple</*rxq*/chan<rxPkt>, error> _WatchLink::_sendReq(context::Context ctx, cons
...
@@ -309,11 +313,9 @@ tuple</*rxq*/chan<rxPkt>, error> _WatchLink::_sendReq(context::Context ctx, cons
}
}
// replyReq sends reply to client <- server request received by recvReq.
// replyReq sends reply to client <- server request received by recvReq.
//
// XXX document EOF. XXX -> no EOF here - only ErrUnexpectedEOF
error
_WatchLink
::
replyReq
(
context
::
Context
ctx
,
const
PinReq
*
req
,
const
string
&
answer
)
{
error
_WatchLink
::
replyReq
(
context
::
Context
ctx
,
const
PinReq
*
req
,
const
string
&
answer
)
{
_WatchLink
*
wlink
=
this
;
_WatchLink
*
wlink
=
this
;
xerr
::
Contextf
E
(
"%s: replyReq .%d"
,
v
(
wlink
),
req
.
stream
);
xerr
::
Contextf
E
(
"%s: replyReq .%d"
,
v
(
wlink
),
req
->
stream
);
//print('C: reply %s <- %r ...' % (req, answer))
//print('C: reply %s <- %r ...' % (req, answer))
wlink
->
_rxmu
.
lock
();
wlink
->
_rxmu
.
lock
();
...
@@ -333,7 +335,7 @@ error _WatchLink::replyReq(context::Context ctx, const PinReq *req, const string
...
@@ -333,7 +335,7 @@ error _WatchLink::replyReq(context::Context ctx, const PinReq *req, const string
if
(
!
ok
)
if
(
!
ok
)
panic
(
"BUG: stream vanished from wlink._accepted while reply was in progress"
);
panic
(
"BUG: stream vanished from wlink._accepted while reply was in progress"
);
//
XXX
also track as answered? (and don't accept with the same ID ?)
//
TODO
also track as answered? (and don't accept with the same ID ?)
return
E
(
err
);
return
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