diff options
author | Stan Hu <stanhu@gmail.com> | 2022-05-25 06:38:49 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2022-05-25 06:38:49 +0000 |
commit | f7b0c2f4d244de03d7e087129a15f093189a92d5 (patch) | |
tree | 4fac67ffdaf2089f779c4196b10eea4b9da90604 | |
parent | fc6c2e16cf3e64d6492cdb639b1abb590ab38c5e (diff) | |
parent | 1fe75fb5af709f6756c9583ea7066a006039c616 (diff) | |
download | gitlab-shell-f7b0c2f4d244de03d7e087129a15f093189a92d5.tar.gz |
Merge branch 'id-calculate-started-just-before-session-handling' into 'main'
Calculate session start after the connection is established
See merge request gitlab-org/gitlab-shell!653
-rw-r--r-- | internal/sshd/sshd.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/internal/sshd/sshd.go b/internal/sshd/sshd.go index a0c4d0e..43c4d7b 100644 --- a/internal/sshd/sshd.go +++ b/internal/sshd/sshd.go @@ -171,7 +171,6 @@ func (s *Server) handleConn(ctx context.Context, nconn net.Conn) { } }() - started := time.Now() conn := newConnection(s.Config, nconn) conn.handle(ctx, s.serverConfig.get(ctx), func(sconn *ssh.ServerConn, channel ssh.Channel, requests <-chan *ssh.Request) error { session := &session{ @@ -179,7 +178,7 @@ func (s *Server) handleConn(ctx context.Context, nconn net.Conn) { channel: channel, gitlabKeyId: sconn.Permissions.Extensions["key-id"], remoteAddr: remoteAddr, - started: started, + started: time.Now(), } return session.handle(ctx, requests) |