From 9fbb5a05ab312b41a74e22b0680bf88d31605b7c Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Thu, 21 May 2020 18:14:50 +0700 Subject: [PATCH] close the connection when it is refused by InterceptSecured --- transport.go | 1 + 1 file changed, 1 insertion(+) diff --git a/transport.go b/transport.go index c7902b3..815384a 100644 --- a/transport.go +++ b/transport.go @@ -186,6 +186,7 @@ func (t *transport) Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) (tp connaddrs := &connAddrs{lmAddr: localMultiaddr, rmAddr: remoteMultiaddr} if t.gater != nil && !t.gater.InterceptSecured(n.DirOutbound, p, connaddrs) { + sess.CloseWithError(0, "") pconn.DecreaseCount() return nil, fmt.Errorf("secured connection gated") }