Skip to content

Commit d80b1da

Browse files
authored
webtransport: close quic conn on dial error (#3104)
1 parent ba1703f commit d80b1da

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

p2p/transport/webtransport/transport.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,12 @@ func (t *transport) dialWithScope(ctx context.Context, raddr ma.Multiaddr, p pee
175175
sconn, err := t.upgrade(ctx, sess, p, certHashes)
176176
if err != nil {
177177
sess.CloseWithError(1, "")
178+
qconn.CloseWithError(1, "")
178179
return nil, err
179180
}
180181
if t.gater != nil && !t.gater.InterceptSecured(network.DirOutbound, p, sconn) {
181182
sess.CloseWithError(errorCodeConnectionGating, "")
183+
qconn.CloseWithError(errorCodeConnectionGating, "")
182184
return nil, fmt.Errorf("secured connection gated")
183185
}
184186
conn := newConn(t, sess, sconn, scope, qconn)

0 commit comments

Comments
 (0)