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
943c50d3
Commit
943c50d3
authored
Dec 23, 2016
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
21e815b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
t/neo/storage.go
t/neo/storage.go
+37
-0
No files found.
t/neo/storage.go
View file @
943c50d3
...
...
@@ -39,6 +39,43 @@ type Buffer struct {
func
(
stor
*
StorageApplication
)
ServeLink
(
ctx
context
.
Context
,
link
*
NodeLink
)
{
fmt
.
Printf
(
"stor: serving new node %s <-> %s
\n
"
,
link
.
peerLink
.
LocalAddr
(),
link
.
peerLink
.
RemoteAddr
())
pktri
,
err
:=
expect
(
RequestIdentification
)
if
err
!=
nil
{
send
(
err
)
return
}
if
pktri
.
ProtocolVersion
!=
PROTOCOL_VERSION
{
sendErr
(
"..."
)
return
}
(
.
NodeType
,
.
UUID
,
.
Address
,
.
Name
,
.
IdTimestamp
)
->
check
+
register
to
NM
send
(
AcceptIdentification
{
...
})
// TODO mark link as identified
pkt
,
err
:=
recv
()
if
err
!=
nil
{
err
return
}
switch
pkt
.
MsgCode
{
case
GetObject
:
req
:=
GetObject
{}
err
=
req
.
Decode
(
pkt
.
Payload
())
if
err
!=
nil
{
sendErr
(
"malformed GetObject packet:"
,
err
)
}
->
DM
.
getObject
(
req
.
Oid
,
req
.
Serial
,
req
.
Tid
)
case
StoreObject
:
case
StoreTransaction
:
}
//fmt.Fprintf(conn, "Hello up there, you address is %s\n", conn.RemoteAddr()) // XXX 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