forked from quic-go/quic-go
wait for connection to shut down when the Dial context is cancelled (#4872)
This commit is contained in:
@@ -245,6 +245,11 @@ func (c *client) dial(ctx context.Context) error {
|
|||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
c.conn.destroy(nil)
|
c.conn.destroy(nil)
|
||||||
|
// wait until the Go routine that called Connection.run() returns
|
||||||
|
select {
|
||||||
|
case <-errorChan:
|
||||||
|
case <-recreateChan:
|
||||||
|
}
|
||||||
return context.Cause(ctx)
|
return context.Cause(ctx)
|
||||||
case err := <-errorChan:
|
case err := <-errorChan:
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user