Prevent panics due to EOF in gob.Decode #5

Merged
6543 merged 3 commits from zeripath/session:no-more-EOF-panic into master 2022-12-20 00:55:50 +00:00

3 Commits

Author SHA1 Message Date
techknowlogick
15afcca0bc Merge branch 'master' into no-more-EOF-panic
All checks were successful
continuous-integration/drone/pr Build is passing
2022-12-20 05:18:21 +08:00
4d70fcf0cb Update 'file.go'
All checks were successful
continuous-integration/drone/pr Build is passing
2022-12-19 21:11:38 +08:00
522faccee0 Prevent panics due to EOF in gob.Decode
All checks were successful
continuous-integration/drone/pr Build is passing
If a session file has been truncated due to server disk errors then the FileReader may return an io.EOF error on Read().

This then percolates up to the session manager which will panic.

This PR instead suggests that we simply swallow this error and start off again with empty session data.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-12-19 21:10:06 +08:00