Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
close the connection when it is refused by InterceptSecured
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed May 21, 2020
1 parent f5ea352 commit 9fbb5a0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 9fbb5a0

Please sign in to comment.