Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: remove session success update api #1559

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions pkg/proxy/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ func NewServer(conn UserConnection, jmsService *service.JMService, opts ...Conne
_, err2 := jmsService.CreateSession(*apiSession)
return err2
},
ConnectedSuccessCallback: func() error {
return jmsService.SessionSuccess(apiSession.ID)
},
ConnectedFailedCallback: func(err error) error {
return jmsService.SessionFailed(apiSession.ID, err)
},
Expand Down Expand Up @@ -150,10 +147,9 @@ type Server struct {

cacheSSHConnection *srvconn.SSHConnection

CreateSessionCallback func() error
ConnectedSuccessCallback func() error
ConnectedFailedCallback func(err error) error
DisConnectedCallback func() error
CreateSessionCallback func() error
ConnectedFailedCallback func(err error) error
DisConnectedCallback func() error

keyboardMode int32

Expand Down Expand Up @@ -1005,9 +1001,6 @@ func (s *Server) Proxy() {
}

logger.Infof("Conn[%s] create session %s success", s.UserConn.ID(), s.ID)
if err2 := s.ConnectedSuccessCallback(); err2 != nil {
logger.Errorf("Conn[%s] update session %s err: %s", s.UserConn.ID(), s.ID, err2)
}
if s.OnSessionInfo != nil {
actions := s.connOpts.authInfo.Actions
tokenConnOpts := s.connOpts.authInfo.ConnectOptions
Expand Down