-
Notifications
You must be signed in to change notification settings - Fork 323
Send Reset if the ResetTime elapsed in between checks #725
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
Changes from 4 commits
5b68992
2fe3f12
1899c8f
f83e8a8
cec0770
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -388,6 +388,7 @@ func (f sessionFactory) newSession( | |
| } | ||
| s.EnableResetSeqTime = true | ||
| s.ResetSeqTime = seqTime | ||
| s.LastCheckedResetSeqTime = seqTime | ||
|
||
| } else { | ||
| s.EnableResetSeqTime = false | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,11 +157,11 @@ func (sm *stateMachine) CheckSessionTime(session *session, now time.Time) { | |
|
|
||
| func (sm *stateMachine) CheckResetTime(session *session, now time.Time) { | ||
| if session.EnableResetSeqTime { | ||
| if session.ResetSeqTime.Hour() == now.Hour() && | ||
| session.ResetSeqTime.Minute() == now.Minute() && | ||
| session.ResetSeqTime.Second() == now.Second() { | ||
| // If we have crossed the reset time boundary in between checks, we send the reset | ||
| if session.LastCheckedResetSeqTime.Before(session.ResetSeqTime) && now.After(session.ResetSeqTime) && session.stateMachine.State.IsConnected() { | ||
|
||
| session.sendLogonInReplyTo(true, nil) | ||
| } | ||
| session.LastCheckedResetSeqTime = now | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a session settings struct and this variable does not belong here