diff --git a/client.go b/client.go index 0af904b92..456a2c321 100644 --- a/client.go +++ b/client.go @@ -96,7 +96,7 @@ func (c *Client) openStreamingChannel(ctx context.Context, streamName, condition if err != nil { return nil, fmt.Errorf("error opening ssh channel for transport: %v", err) } - go c.processChannelRequests(ctx, reqs) + go ssh.DiscardRequests(reqs) requestType := fmt.Sprintf("stream-transport-%s", streamID) _, err = channel.SendRequest(requestType, true, nil) @@ -106,16 +106,3 @@ func (c *Client) openStreamingChannel(ctx context.Context, streamName, condition return channel, nil } - -func (c *Client) processChannelRequests(ctx context.Context, reqs <-chan *ssh.Request) { - for { - select { - case req := <-reqs: - if req != nil { - // TODO(josebalius): Handle - } - case <-ctx.Done(): - break - } - } -} diff --git a/port_forwarder.go b/port_forwarder.go index 0ae5e1916..20382c208 100644 --- a/port_forwarder.go +++ b/port_forwarder.go @@ -53,8 +53,8 @@ func (l *LocalPortForwarder) handleConnection(ctx context.Context, conn net.Conn copyConn := func(writer io.Writer, reader io.Reader) { _, err := io.Copy(writer, reader) if err != nil { - log.Println("errrrr copyConn") - log.Println(err) //TODO(josebalius): handle this somehow + channel.Close() + conn.Close() } }