Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
2e132450
Commit
2e132450
authored
Aug 08, 2018
by
Steven Allen
Browse files
reset when we fail in identify
parent
d9712a3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
p2p/protocol/identify/id.go
View file @
2e132450
...
@@ -92,13 +92,13 @@ func (ids *IDService) IdentifyConn(c inet.Conn) {
...
@@ -92,13 +92,13 @@ func (ids *IDService) IdentifyConn(c inet.Conn) {
c
.
Close
()
c
.
Close
()
return
return
}
}
defer
inet
.
FullClose
(
s
)
s
.
SetProtocol
(
ID
)
s
.
SetProtocol
(
ID
)
// ok give the response to our handler.
// ok give the response to our handler.
if
err
:=
msmux
.
SelectProtoOrFail
(
ID
,
s
);
err
!=
nil
{
if
err
:=
msmux
.
SelectProtoOrFail
(
ID
,
s
);
err
!=
nil
{
log
.
Event
(
context
.
TODO
(),
"IdentifyOpenFailed"
,
c
.
RemotePeer
(),
logging
.
Metadata
{
"error"
:
err
})
log
.
Event
(
context
.
TODO
(),
"IdentifyOpenFailed"
,
c
.
RemotePeer
(),
logging
.
Metadata
{
"error"
:
err
})
s
.
Reset
()
return
return
}
}
...
@@ -111,8 +111,8 @@ func (ids *IDService) IdentifyConn(c inet.Conn) {
...
@@ -111,8 +111,8 @@ func (ids *IDService) IdentifyConn(c inet.Conn) {
if
!
found
{
if
!
found
{
log
.
Errorf
(
"IdentifyConn failed to find channel (programmer error) for %s"
,
c
)
log
.
Errorf
(
"IdentifyConn failed to find channel (programmer error) for %s"
,
c
)
return
}
}
inet
.
FullClose
(
s
)
}
}
func
(
ids
*
IDService
)
requestHandler
(
s
inet
.
Stream
)
{
func
(
ids
*
IDService
)
requestHandler
(
s
inet
.
Stream
)
{
...
...
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