mirror of https://github.com/jech/galene.git
Replace use of os.ErrTimeout by our own value.
ErrTimeout was introduced in Go 1.15, while we support 1.13 and later. Thanks to Michael Ströder for the report.
This commit is contained in:
parent
1fd8b92f02
commit
0f7cbe5701
14
ice/ice.go
14
ice/ice.go
|
@ -18,6 +18,18 @@ import (
|
||||||
"github.com/jech/galene/turnserver"
|
"github.com/jech/galene/turnserver"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type timeoutError struct{}
|
||||||
|
|
||||||
|
func (e timeoutError) Error() string {
|
||||||
|
return "timeout"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e timeoutError) Timeout() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
var errTimeout = timeoutError{}
|
||||||
|
|
||||||
type Server struct {
|
type Server struct {
|
||||||
URLs []string `json:"urls"`
|
URLs []string `json:"urls"`
|
||||||
Username string `json:"username,omitempty"`
|
Username string `json:"username,omitempty"`
|
||||||
|
@ -235,6 +247,6 @@ func RelayTest(timeout time.Duration) (time.Duration, error) {
|
||||||
}
|
}
|
||||||
return time.Now().Sub(tm), nil
|
return time.Now().Sub(tm), nil
|
||||||
case <-timer.C:
|
case <-timer.C:
|
||||||
return 0, os.ErrDeadlineExceeded
|
return 0, errTimeout
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue