Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
e2b740aa
Commit
e2b740aa
authored
Jul 06, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8a571de2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
go/zodb/storage/zeo/zrpc.go
go/zodb/storage/zeo/zrpc.go
+7
-5
No files found.
go/zodb/storage/zeo/zrpc.go
View file @
e2b740aa
...
...
@@ -523,6 +523,8 @@ func handshake(ctx context.Context, conn net.Conn) (_ *zLink, err error) {
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
// server first announces its preferred protocol
// it is e.g. "M5", "Z5", "Z4", "Z3101", ...
//
// first letter is preferred encoding: 'M' (msgpack), or 'Z' (pickles).
pkb
,
err
:=
zl
.
recvPkt
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"rx: %s"
,
err
)
...
...
@@ -534,9 +536,9 @@ func handshake(ctx context.Context, conn net.Conn) (_ *zLink, err error) {
return
fmt
.
Errorf
(
"rx: invalid peer handshake: %q"
,
proto
)
}
//
even if server announced it prefers 'M' (msgpack) it will
// accept 'Z' (pickles) as encoding. We always use 'Z'.
//
//
use wire encoding preferred by server
encoding
:=
proto
[
0
]
// extract peer version from protocol string and choose actual
// version to use as min(peer, mybest)
ver
:=
proto
[
1
:
]
...
...
@@ -560,14 +562,14 @@ func handshake(ctx context.Context, conn net.Conn) (_ *zLink, err error) {
// version selected - now send it back to server as
// corresponding handshake reply.
pkb
=
allocPkb
()
pkb
.
WriteString
(
"Z"
+
ver
)
pkb
.
WriteString
(
fmt
.
Sprintf
(
"%c%s"
,
encoding
,
ver
)
)
err
=
zl
.
sendPkt
(
pkb
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"tx: %s"
,
err
)
}
zl
.
ver
=
ver
zl
.
encoding
=
'Z'
// XXX hardcoded
zl
.
encoding
=
encoding
close
(
hok
)
return
nil
})
...
...
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