mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
replace time.NewTimer() with time.After()
This commit is contained in:
@@ -642,10 +642,8 @@ func (sc *ServerConn) handleRequest(req *base.Request) (*base.Response, error) {
|
|||||||
// this was causing problems during unit tests.
|
// this was causing problems during unit tests.
|
||||||
if ua, ok := req.Header["User-Agent"]; ok && len(ua) == 1 &&
|
if ua, ok := req.Header["User-Agent"]; ok && len(ua) == 1 &&
|
||||||
strings.HasPrefix(ua[0], "GStreamer") {
|
strings.HasPrefix(ua[0], "GStreamer") {
|
||||||
t := time.NewTimer(1 * time.Second)
|
|
||||||
defer t.Stop()
|
|
||||||
select {
|
select {
|
||||||
case <-t.C:
|
case <-time.After(1 * time.Second):
|
||||||
case <-sc.terminate:
|
case <-sc.terminate:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user