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
0e0c6522
Commit
0e0c6522
authored
Nov 26, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e23f0fc1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
1 deletion
+22
-1
wcfs/internal/_wcfs.pyx
wcfs/internal/_wcfs.pyx
+12
-0
wcfs/internal/wcfs_watchlink.cpp
wcfs/internal/wcfs_watchlink.cpp
+3
-0
wcfs/internal/wcfs_watchlink.h
wcfs/internal/wcfs_watchlink.h
+5
-0
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+2
-1
No files found.
wcfs/internal/_wcfs.pyx
View file @
0e0c6522
...
...
@@ -70,6 +70,8 @@ cdef extern from "wcfs_watchlink.h" nogil:
Tid
at
string
msg
error
_twlinkwrite
(
WatchLink
wlink
,
const
string
&
pkt
)
cdef
extern
from
"wcfs.h"
nogil
:
cppclass
WCFS
:
...
...
@@ -175,6 +177,13 @@ cdef class PyPinReq:
return
pypin
.
pinreq
.
msg
def
_tpywlinkwrite
(
PyWatchLink
pywlink
,
bytes
pypkt
):
cdef
string
pkt
=
pypkt
with
nogil
:
err
=
_twlinkwrite_pyexc
(
pywlink
.
wlink
,
pkt
)
if
err
!=
nil
:
raise
RuntimeError
(
err
.
Error
())
# XXX exc class?
# ---- misc ----
from
golang
cimport
topyexc
...
...
@@ -195,3 +204,6 @@ cdef nogil:
pair
[
string
,
error
]
wlink_sendReq_pyexc
(
WatchLink
wlink
,
context
.
Context
ctx
,
const
string
&
req
)
except
+
topyexc
:
return
wlink
.
sendReq
(
ctx
,
req
)
error
_twlinkwrite_pyexc
(
WatchLink
wlink
,
const
string
&
pkt
)
except
+
topyexc
:
return
_twlinkwrite
(
wlink
,
pkt
)
wcfs/internal/wcfs_watchlink.cpp
View file @
0e0c6522
...
...
@@ -224,6 +224,9 @@ error _WatchLink::_send(StreamID stream, const string &msg) {
return
wlink
->
_write
(
pkt
);
}
error
_twlinkwrite
(
WatchLink
wlink
,
const
string
&
pkt
)
{
return
wlink
->
_write
(
pkt
);
}
error
_WatchLink
::
_write
(
const
string
&
pkt
)
{
_WatchLink
*
wlink
=
this
;
...
...
wcfs/internal/wcfs_watchlink.h
View file @
0e0c6522
...
...
@@ -113,6 +113,8 @@ private:
error
_send
(
StreamID
stream
,
const
string
&
msg
);
error
_write
(
const
string
&
pkt
);
tuple
<
chan
<
rxPkt
>
,
error
>
_sendReq
(
context
::
Context
ctx
,
const
string
&
req
);
friend
error
_twlinkwrite
(
WatchLink
wlink
,
const
string
&
pkt
);
};
// PinReq represents 1 server-initiated wcfs pin request received over /head/watch link.
...
...
@@ -126,4 +128,7 @@ struct PinReq {
};
// for testing
error
_twlinkwrite
(
WatchLink
wlink
,
const
string
&
pkt
);
#endif
wcfs/wcfs_test.py
View file @
0e0c6522
...
...
@@ -52,6 +52,7 @@ import pytest; xfail = pytest.mark.xfail
from
pytest
import
raises
,
fail
from
six
import
reraise
from
.internal
import
io
,
mm
from
.internal._wcfs
import
_tpywlinkwrite
as
_twlinkwrite
from
.internal.wcfs_test
import
_tDB
,
read_nogil
,
install_sigbus_trap
,
fadvise_dontneed
# XXX `py.test -v` -> WENDELIN_CORE_WCFS_OPTIONS += -v=1?
...
...
@@ -1240,7 +1241,7 @@ def test_wcfs_watch_robust():
# invalid request not following frame structure -> fatal + wcfs must close watch link
assert
wl
.
fatalv
==
[]
wl
.
_write
(
b'zzz hello
\
n
'
)
_twlinkwrite
(
wl
,
b'zzz hello
\
n
'
)
_
,
_rx
=
select
(
timeout
().
done
().
recv
,
wl
.
rx_eof
.
recv
,
...
...
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