Skip to content
Snippets Groups Projects
Unverified Commit 23604149 authored by Steve Azzopardi's avatar Steve Azzopardi
Browse files

WIP

parent 3da9fb91
No related branches found
No related tags found
No related merge requests found
...@@ -56,8 +56,6 @@ func NewSession(logger *logrus.Entry) (*Session, error) { ...@@ -56,8 +56,6 @@ func NewSession(logger *logrus.Entry) (*Session, error) {
log: logger, log: logger,
} }
sess.setMux()
return sess, nil return sess, nil
} }
...@@ -84,14 +82,6 @@ func generateToken() (string, error) { ...@@ -84,14 +82,6 @@ func generateToken() (string, error) {
return token, nil return token, nil
} }
func (s *Session) setMux() {
s.Lock()
defer s.Unlock()
s.mux = http.NewServeMux()
s.mux.HandleFunc(s.Endpoint+"/exec", s.execHandler)
}
func (s *Session) execHandler(w http.ResponseWriter, r *http.Request) { func (s *Session) execHandler(w http.ResponseWriter, r *http.Request) {
logger := s.log.WithField("uri", r.RequestURI) logger := s.log.WithField("uri", r.RequestURI)
logger.Debug("Exec terminal session request") logger.Debug("Exec terminal session request")
...@@ -174,10 +164,17 @@ func (s *Session) closeTerminalConn(conn terminal.Conn) { ...@@ -174,10 +164,17 @@ func (s *Session) closeTerminalConn(conn terminal.Conn) {
func (s *Session) SetInteractiveTerminal(interactiveTerminal terminal.InteractiveTerminal) { func (s *Session) SetInteractiveTerminal(interactiveTerminal terminal.InteractiveTerminal) {
s.Lock() s.Lock()
defer s.Unlock() defer s.Unlock()
s.interactiveTerminal = interactiveTerminal s.interactiveTerminal = interactiveTerminal
s.mux = http.NewServeMux()
s.mux.HandleFunc(s.Endpoint+"/exec", s.execHandler)
} }
func (s *Session) Mux() *http.ServeMux { func (s *Session) Mux() *http.ServeMux {
s.Lock()
defer s.Unlock()
return s.mux return s.mux
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment