Skip to content

Commit

Permalink
session status and duration displaying properly
Browse files Browse the repository at this point in the history
  • Loading branch information
valentin.daviot committed Nov 5, 2018
1 parent 41eeb36 commit 1695d4f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,19 @@ func channelHandler(srv *ssh.Server, conn *gossh.ServerConn, newChan gossh.NewCh
if err != nil {
log.Printf("Error: %v", err)
}
}()

now := time.Now()
sessUpdate := Session{
Status: SessionStatusClosed,
ErrMsg: fmt.Sprintf("%v", err),
StoppedAt: &now,
}
switch sessUpdate.ErrMsg {
case "lch closed the connection", "rch closed the connection":
sessUpdate.ErrMsg = ""
}
actx.db.Model(&sess).Updates(&sessUpdate)
now := time.Now()
sessUpdate := Session{
Status: SessionStatusClosed,
ErrMsg: fmt.Sprintf("%v", err),
StoppedAt: &now,
}
switch sessUpdate.ErrMsg {
case "lch closed the connection", "rch closed the connection":
sessUpdate.ErrMsg = ""
}
actx.db.Model(&sess).Updates(&sessUpdate)
}()
case BastionSchemeTelnet:
tmpSrv := ssh.Server{
// PtyCallback: srv.PtyCallback,
Expand Down

0 comments on commit 1695d4f

Please sign in to comment.