(cmd Cmder)
| 1017 | } |
| 1018 | |
| 1019 | func (c *baseClient) cmdTimeout(cmd Cmder) time.Duration { |
| 1020 | if timeout := cmd.readTimeout(); timeout != nil { |
| 1021 | t := *timeout |
| 1022 | if t == 0 { |
| 1023 | return 0 |
| 1024 | } |
| 1025 | return t + 10*time.Second |
| 1026 | } |
| 1027 | return c.opt.ReadTimeout |
| 1028 | } |
| 1029 | |
| 1030 | // context returns the context for the current connection. |
| 1031 | // If the context timeout is enabled, it returns the original context. |