1 | | - | package Prox5 |
| 1 | + | package prox5 |
2 | 2 | | |
3 | 3 | | import ( |
4 | 4 | | "sync/atomic" |
| skipped 91 lines |
96 | 96 | | return false |
97 | 97 | | } |
98 | 98 | | |
99 | | - | if time.Since(sock.lastValidated.Load().(time.Time)) > s.swampopt.stale.Load().(time.Duration) { |
| 99 | + | if s.swampopt.stale.Load().(time.Duration) == 0 { |
| 100 | + | return true |
| 101 | + | } |
| 102 | + | since := time.Since(sock.lastValidated.Load().(time.Time)) |
| 103 | + | if since > s.swampopt.stale.Load().(time.Duration) { |
100 | 104 | | s.dbgPrint("proxy stale: " + sock.Endpoint) |
101 | 105 | | go s.Stats.stale() |
102 | 106 | | return false |
| skipped 5 lines |