Commit 2e132450 authored by Steven Allen's avatar Steven Allen
Browse files

reset when we fail in identify

parent d9712a3b
...@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment