Skip to content

Commit

Permalink
Revert additional stream closed polling on proxy command (#802)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaWilkes authored Nov 12, 2024
1 parent eeec10e commit 8785167
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions pkg/granted/proxy/listenandproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ package proxy

import (
"context"
"errors"
"fmt"
"io"
"net"
"time"

"github.com/common-fate/clio"
"github.com/common-fate/clio/clierr"
Expand Down Expand Up @@ -95,26 +93,6 @@ func ListenAndProxy(ctx context.Context, yamuxStreamConnection *yamux.Session, c
}

}()

// This function polls the stream connection to see if it has been closed remotely
// https://github.com/hashicorp/yamux/pull/115
// when the proxy server has errors which are fatal to this session, it will close the stream
go func() {
defer clientConn.Close()
defer sessionConn.Close()
for {
b := make([]byte, 0)
_, err := sessionConn.Read(b)
if err != nil {
if errors.Is(err, io.EOF) {
clio.Infof("The proxy server ended the connection for the session unexpectedly [%v]", sessionConn.StreamID())
return
}
}
time.Sleep(time.Second)
}

}()
}(result.conn)
}
}
Expand Down

0 comments on commit 8785167

Please sign in to comment.