(listener net.Listener, addr string)
| 162 | } |
| 163 | |
| 164 | func (c *secureShell) localForwardAcceptLoop(listener net.Listener, addr string) { |
| 165 | defer listener.Close() |
| 166 | |
| 167 | for { |
| 168 | conn, err := listener.Accept() |
| 169 | if err != nil { |
| 170 | if netErr, ok := err.(net.Error); ok && netErr.Temporary() { |
| 171 | time.Sleep(100 * time.Millisecond) |
| 172 | continue |
| 173 | } |
| 174 | return |
| 175 | } |
| 176 | |
| 177 | go c.handleForwardConnection(conn, addr) |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | func (c *secureShell) handleForwardConnection(conn net.Conn, targetAddr string) { |
| 182 | defer conn.Close() |
no test coverage detected