condRelease releases this connection if the error pointed to by err is nil (not an error) or is only a protocol level error (e.g. a cache miss). The purpose is to not recycle TCP connections that are bad.
(err *error)
| 205 | // cache miss). The purpose is to not recycle TCP connections that |
| 206 | // are bad. |
| 207 | func (cn *conn) condRelease(err *error) { |
| 208 | if *err == nil || resumableError(*err) { |
| 209 | cn.release() |
| 210 | } else { |
| 211 | cn.nc.Close() |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | func (c *Client) putFreeConn(addr net.Addr, cn *conn) { |
| 216 | c.mu.Lock() |
no test coverage detected