Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
b9009ed2
Commit
b9009ed2
authored
Jan 13, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
aea23d6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
+37
-2
go/neo/client_test.go
go/neo/client_test.go
+31
-2
go/neo/neonet/connection.go
go/neo/neonet/connection.go
+6
-0
No files found.
go/neo/client_test.go
View file @
b9009ed2
...
...
@@ -52,6 +52,10 @@ type NEOSrv interface {
URL
()
string
// zurl to access this NEO server
Bugs
()
[]
string
// list of known server bugs
// BugEncFixed reports whether server, instead of autodetection,
// supports only fixed encoding, and, if yes, which one.
BugEncFixed
()
(
bool
,
proto
.
Encoding
)
}
// NEOSrvOptions represents options for a NEO server.
...
...
@@ -81,7 +85,11 @@ type NEOPySrv struct {
}
func
(
_
*
NEOPySrv
)
Bugs
()
[]
string
{
return
[]
string
{}
return
[]
string
{
"encfixed"
}
}
func
(
_
*
NEOPySrv
)
BugEncFixed
()
(
bool
,
proto
.
Encoding
)
{
return
true
,
'N'
// NEO/py 1.12
}
// StartNEOPySrv starts NEO/py server specified by options.
...
...
@@ -209,6 +217,10 @@ func (_ *NEOGoSrv) Bugs() []string {
return
[]
string
{
"nocommit"
}
}
func
(
_
*
NEOGoSrv
)
BugEncFixed
()
(
bool
,
proto
.
Encoding
)
{
return
false
,
0
// NEO/go server autodetects client encoding
}
// StartNEOGoSrv starts NEO/go server specified by options.
func
StartNEOGoSrv
(
opt
NEOSrvOptions
)
(
_
*
NEOGoSrv
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"start neo/go %s/%s"
,
opt
.
workdir
,
opt
.
name
)
...
...
@@ -537,7 +549,24 @@ func TestEncAutodetect(t *testing.T) {
neonet
.
DialEncTryOrder
=
encv
ndrv
,
_
,
err
:=
neoOpen
(
nsrv
.
URL
(),
&
zodb
.
DriverOptions
{
ReadOnly
:
true
});
X
(
err
)
err
=
ndrv
.
Close
();
X
(
err
)
defer
func
()
{
err
:=
ndrv
.
Close
();
X
(
err
)
}()
// verify that link was established with either:
// - encv[0] encoding (NEO/go = server supports autodetection)
// - server encoding (NEO/py)
encOK
:=
encv
[
0
]
noautodetect
,
srvEnc
:=
nsrv
.
BugEncFixed
()
if
noautodetect
{
encOK
=
srvEnc
}
mlink
,
err
:=
ndrv
.
masterLink
(
context
.
Background
());
X
(
err
)
enc
:=
mlink
.
Encoding
()
if
enc
!=
encOK
{
t
.
Fatalf
(
"connected with encoding %c ; want %c"
,
enc
,
encOK
)
}
})
}
})
...
...
go/neo/neonet/connection.go
View file @
b9009ed2
...
...
@@ -166,6 +166,12 @@ type NodeLink struct {
rxghandoff
chan
struct
{}
}
// Encoding returns protocol encoding with which the link was handshaked. XXX
// XXX place
func
(
nl
*
NodeLink
)
Encoding
()
proto
.
Encoding
{
return
nl
.
enc
}
// XXX rx handoff make latency better for serial request-reply scenario but
// does a lot of harm for case when there are several parallel requests -
// serveRecv after handing off is put to tail of current cpu runqueue - not
...
...
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