summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2022-05-25 06:38:49 +0000
committerStan Hu <stanhu@gmail.com>2022-05-25 06:38:49 +0000
commitf7b0c2f4d244de03d7e087129a15f093189a92d5 (patch)
tree4fac67ffdaf2089f779c4196b10eea4b9da90604
parentfc6c2e16cf3e64d6492cdb639b1abb590ab38c5e (diff)
parent1fe75fb5af709f6756c9583ea7066a006039c616 (diff)
downloadgitlab-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.go3
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)