(deadline time.Time, now time.Time, rtt time.Duration)
| 47 | } |
| 48 | |
| 49 | func adjustDeadlineForRTT(deadline time.Time, now time.Time, rtt time.Duration) time.Time { |
| 50 | if !deadline.IsZero() { |
| 51 | timeout := deadline.Sub(now) |
| 52 | if timeout < rtt { |
| 53 | rtt = timeout / 4 |
| 54 | } |
| 55 | deadline = deadline.Add(-rtt) |
| 56 | } |
| 57 | return deadline |
| 58 | } |
no test coverage detected