fix: don't close tuic when read timeout
This commit is contained in:
parent
30ca59dab7
commit
142d17ebad
1 changed files with 19 additions and 15 deletions
|
@ -214,6 +214,7 @@ func (t *Client) DialContext(ctx context.Context, metadata *C.Metadata, dialFn f
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
stream, err := func() (quic.Stream, error) {
|
||||
defer func() {
|
||||
t.deferQuicConn(quicConn, err)
|
||||
}()
|
||||
|
@ -230,6 +231,9 @@ func (t *Client) DialContext(ctx context.Context, metadata *C.Metadata, dialFn f
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return stream, err
|
||||
}()
|
||||
|
||||
if t.RequestTimeout > 0 {
|
||||
_ = stream.SetReadDeadline(time.Now().Add(time.Duration(t.RequestTimeout) * time.Millisecond))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue