get rid of old buffered session packets

This commit is contained in:
Arceliar 2019-06-28 20:02:58 -05:00
parent e7cb76cea3
commit e88bef35c0
3 changed files with 3 additions and 15 deletions

View file

@ -215,7 +215,7 @@ func (c *Conn) Write(b []byte) (bytesWritten int, err error) {
}
switch {
case !sinfo.init:
doSearch()
sinfo.core.sessions.ping(sinfo)
case time.Since(sinfo.time) > 6*time.Second:
if sinfo.time.Before(sinfo.pingTime) && time.Since(sinfo.pingTime) > 6*time.Second {
// TODO double check that the above condition is correct