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
9a37b817
Commit
9a37b817
authored
Jul 06, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2d01bfb2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
go/neo/neonet/connection.go
go/neo/neonet/connection.go
+19
-20
No files found.
go/neo/neonet/connection.go
View file @
9a37b817
...
@@ -92,8 +92,8 @@ import (
...
@@ -92,8 +92,8 @@ import (
"sync"
"sync"
"time"
"time"
"lab.nexedi.com/kirr/neo/go/neo/proto"
"lab.nexedi.com/kirr/neo/go/internal/packed"
"lab.nexedi.com/kirr/neo/go/internal/packed"
"lab.nexedi.com/kirr/neo/go/neo/proto"
"github.com/someonegg/gocontainer/rbuf"
"github.com/someonegg/gocontainer/rbuf"
...
@@ -319,7 +319,6 @@ func (c *Conn) reinit() {
...
@@ -319,7 +319,6 @@ func (c *Conn) reinit() {
c
.
rxerrOnce
=
sync
.
Once
{}
// XXX ok?
c
.
rxerrOnce
=
sync
.
Once
{}
// XXX ok?
// XXX vvv not strictly needed for light mode?
// XXX vvv not strictly needed for light mode?
// ensureOpen(&c.rxdown)
// ensureOpen(&c.rxdown)
c
.
rxdownOnce
=
sync
.
Once
{}
// XXX ok?
c
.
rxdownOnce
=
sync
.
Once
{}
// XXX ok?
...
@@ -372,7 +371,7 @@ func (link *NodeLink) _NewConn() (*Conn, error) {
...
@@ -372,7 +371,7 @@ func (link *NodeLink) _NewConn() (*Conn, error) {
// nextConnId could wrap around uint32 limits - find first free slot to
// nextConnId could wrap around uint32 limits - find first free slot to
// not blindly replace existing connection
// not blindly replace existing connection
for
i
:=
uint32
(
0
)
;
;
i
++
{
for
i
:=
uint32
(
0
)
;
;
i
++
{
_
,
exists
:=
link
.
connTab
[
link
.
nextConnId
]
_
,
exists
:=
link
.
connTab
[
link
.
nextConnId
]
if
!
exists
{
if
!
exists
{
break
break
...
@@ -588,7 +587,7 @@ func (c *Conn) downRX(errMsg *proto.Error) {
...
@@ -588,7 +587,7 @@ func (c *Conn) downRX(errMsg *proto.Error) {
// time to keep record of a closed connection so that we can properly reply
// time to keep record of a closed connection so that we can properly reply
// "connection closed" if a packet comes in with same connID.
// "connection closed" if a packet comes in with same connID.
var
connKeepClosed
=
1
*
time
.
Minute
var
connKeepClosed
=
1
*
time
.
Minute
// CloseRecv closes reading end of connection.
// CloseRecv closes reading end of connection.
//
//
...
@@ -1311,7 +1310,7 @@ func (c *Conn) err(op string, e error) error {
...
@@ -1311,7 +1310,7 @@ func (c *Conn) err(op string, e error) error {
// msgPack allocates pktBuf and encodes msg into it.
// msgPack allocates pktBuf and encodes msg into it.
func
msgPack
(
connId
uint32
,
msg
proto
.
Msg
)
*
pktBuf
{
func
msgPack
(
connId
uint32
,
msg
proto
.
Msg
)
*
pktBuf
{
l
:=
msg
.
NEOMsgEncodedLen
()
l
:=
msg
.
NEOMsgEncodedLen
()
buf
:=
pktAlloc
(
proto
.
PktHeaderLen
+
l
)
buf
:=
pktAlloc
(
proto
.
PktHeaderLen
+
l
)
h
:=
buf
.
Header
()
h
:=
buf
.
Header
()
h
.
ConnId
=
packed
.
Hton32
(
connId
)
h
.
ConnId
=
packed
.
Hton32
(
connId
)
...
...
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