Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
8522b312
Commit
8522b312
authored
Feb 22, 2018
by
Ivan Daniluk
Committed by
Péter Szilágyi
Feb 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p: remove unused code (#16158)
* p2p: remove unused code * p2p: remove unused imports
parent
45352477
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
29 deletions
+1
-29
message.go
p2p/message.go
+0
-26
server.go
p2p/server.go
+1
-3
No files found.
p2p/message.go
View file @
8522b312
...
...
@@ -22,8 +22,6 @@ import (
"fmt"
"io"
"io/ioutil"
"net"
"sync"
"sync/atomic"
"time"
...
...
@@ -112,30 +110,6 @@ func SendItems(w MsgWriter, msgcode uint64, elems ...interface{}) error {
return
Send
(
w
,
msgcode
,
elems
)
}
// netWrapper wraps a MsgReadWriter with locks around
// ReadMsg/WriteMsg and applies read/write deadlines.
type
netWrapper
struct
{
rmu
,
wmu
sync
.
Mutex
rtimeout
,
wtimeout
time
.
Duration
conn
net
.
Conn
wrapped
MsgReadWriter
}
func
(
rw
*
netWrapper
)
ReadMsg
()
(
Msg
,
error
)
{
rw
.
rmu
.
Lock
()
defer
rw
.
rmu
.
Unlock
()
rw
.
conn
.
SetReadDeadline
(
time
.
Now
()
.
Add
(
rw
.
rtimeout
))
return
rw
.
wrapped
.
ReadMsg
()
}
func
(
rw
*
netWrapper
)
WriteMsg
(
msg
Msg
)
error
{
rw
.
wmu
.
Lock
()
defer
rw
.
wmu
.
Unlock
()
rw
.
conn
.
SetWriteDeadline
(
time
.
Now
()
.
Add
(
rw
.
wtimeout
))
return
rw
.
wrapped
.
WriteMsg
(
msg
)
}
// eofSignal wraps a reader with eof signaling. the eof channel is
// closed when the wrapped reader returns an error or when count bytes
// have been read.
...
...
p2p/server.go
View file @
8522b312
...
...
@@ -36,9 +36,7 @@ import (
)
const
(
defaultDialTimeout
=
15
*
time
.
Second
refreshPeersInterval
=
30
*
time
.
Second
staticPeerCheckInterval
=
15
*
time
.
Second
defaultDialTimeout
=
15
*
time
.
Second
// Connectivity defaults.
maxActiveDialTasks
=
16
...
...
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