mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
client: fix enforcing timeout to responses (#406)
This commit is contained in:
@@ -599,9 +599,12 @@ func (c *Client) runInner() error {
|
||||
}
|
||||
|
||||
func (c *Client) waitResponse() (*base.Response, error) {
|
||||
t := time.NewTimer(c.ReadTimeout)
|
||||
defer t.Stop()
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-time.After(c.ReadTimeout):
|
||||
case <-t.C:
|
||||
return nil, liberrors.ErrClientRequestTimedOut{}
|
||||
|
||||
case err := <-c.chReadError:
|
||||
|
Reference in New Issue
Block a user