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
d228f970
Commit
d228f970
authored
Dec 18, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X Kill IdentifyPeer - requireIdentifyHello is good to use instead
parent
d44994d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
54 deletions
+1
-54
go/neo/server.go
go/neo/server.go
+1
-54
No files found.
go/neo/server.go
View file @
d228f970
// Copyright (C) 2016-20
17
Nexedi SA and Contributors.
// Copyright (C) 2016-20
20
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
...
...
@@ -67,59 +67,6 @@ func Serve(ctx context.Context, l *neo.Listener, srv Server) error {
}
*/
/*
// FIXME kill vvv
// ----------------------------------------
// XXX goes away? (we need a func to make sure to recv RequestIdentification
// XXX and pass it to server main logic - whether to accept it or not should be
// XXX programmed there)
//
// IdentifyPeer identifies peer on the link
// it expects peer to send RequestIdentification packet and replies with AcceptIdentification if identification passes.
// returns information about identified node or error.
func IdentifyPeer(ctx context.Context, link *neonet.NodeLink, myNodeType proto.NodeType) (nodeInfo proto.RequestIdentification, err error) {
defer xerr.Contextf(&err, "%s: identify", link)
// the first conn must come with RequestIdentification packet
conn, err := link.Accept() //+ctx
if err != nil {
return nodeInfo, err
}
defer func() {
err2 := conn.Close()
if err == nil {
err = err2
// XXX also clear nodeInfo ?
}
}()
req := proto.RequestIdentification{}
_, err = conn.Expect(&req)
if err != nil {
return nodeInfo, err
}
// TODO (.NodeType, .UUID, .Address, .Name, .IdTimestamp) -> check + register to NM
// TODO hook here in logic to check identification request, assign nodeID etc
err = conn.Send(&proto.AcceptIdentification{
NodeType: myNodeType,
MyUUID: 0, // XXX
NumPartitions: 1, // XXX
NumReplicas: 1, // XXX
YourUUID: req.UUID,
})
if err != nil {
return nodeInfo, err
}
return req, 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