mirror of
https://github.com/restic/restic.git
synced 2026-08-28 16:27:31 +00:00
Upadte vendored dependencies
This commit is contained in:
+3
-1
@@ -38,10 +38,12 @@ func (t *timeoutReader) Read(p []byte) (int, error) {
|
||||
done <- result{n, err}
|
||||
}()
|
||||
// Wait for the read or the timeout
|
||||
timer := time.NewTimer(t.timeout)
|
||||
defer timer.Stop()
|
||||
select {
|
||||
case r := <-done:
|
||||
return r.n, r.err
|
||||
case <-time.After(t.timeout):
|
||||
case <-timer.C:
|
||||
t.cancel()
|
||||
return 0, TimeoutError
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user