mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-02 11:56:47 +00:00
fix: a sub-millisecond URL test is reported as a failure (#3316)
This commit is contained in:
1 parent
349af19116
commit
df1b07af2c
1 file changed
+5
@@ -275,6 +275,11 @@ func (p *Proxy) URLTest(ctx context.Context, url string, expectedStatus utils.In
|
||||
|
||||
satisfied = resp != nil && (expectedStatus == nil || expectedStatus.Check(uint16(resp.StatusCode)))
|
||||
t = uint16(time.Since(start) / time.Millisecond)
|
||||
if t == 0 {
|
||||
// a zero delay means a failed test to callers, so report a test
|
||||
// that completed in under a millisecond as 1 ms
|
||||
t = 1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user