cleanup(quic): wait for handshake completion in netxlite (#729)
See https://github.com/ooni/probe/issues/2097
This commit is contained in:
parent
5904e6988d
commit
2238908afe
6 changed files with 140 additions and 102 deletions
|
|
@ -64,12 +64,8 @@ func (s *Saver) QUICDialContext(ctx context.Context, dialer model.QUICDialer,
|
|||
var state tls.ConnectionState
|
||||
sess, err := dialer.DialContext(ctx, network, address, tlsConfig, quicConfig)
|
||||
if err == nil {
|
||||
select {
|
||||
case <-sess.HandshakeComplete().Done():
|
||||
state = sess.ConnectionState().TLS.ConnectionState
|
||||
case <-ctx.Done():
|
||||
sess, err = nil, ctx.Err()
|
||||
}
|
||||
<-sess.HandshakeComplete().Done() // robustness (the dialer already does that)
|
||||
state = sess.ConnectionState().TLS.ConnectionState
|
||||
}
|
||||
s.appendQUICHandshake(&QUICTLSHandshakeEvent{
|
||||
ALPN: tlsConfig.NextProtos,
|
||||
|
|
|
|||
Loading…
Reference in a new issue