-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Control termshark's cache of pcap files on disk
When termshark is run in live capture mode, it saves the pcaps it creates under $XDG_CACHE_HOME/termshark/pcaps/. Termshark doesn't yet cap the growth of that directory. Ross reported his cache dir was 40GB! This change adds a new config option to put a limit on this directory e.g. [main] disk-cache-size-mb = 300 Termshark will check the disk cache once per session, after the first 5s of inactivity. Omit this config setting, or set the value to -1, to preserve the current behavior and let the directory grow. The default is -1 because I don't want to suddenly delete pcaps that existing users might expect to remain there based on termshark's current behavior.
- Loading branch information
Showing
3 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47d705f
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.
Forgive the ignorance - I'm not seeing where this change is made in this commit?
47d705f
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.
np, it's on line 646
47d705f
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.
No I meant the default value of 300. I'm assuming that's in another commit with the default config?
47d705f
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.
oh right, sorry - no, I think that was a poor commit message in that case, I meant it as an example. I left the default at -1 out of fear that I would anger someone who has come to depend on files that have collected in that cache directory then discovering that I've deleted all but 1GB of them. I am adding a preferences dialog though that will make this cache option more discoverable.
47d705f
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.
For this problem, why not ask at 1GB (or next time they start it after an update if > 1GB)? Something like "I've noticed that you have 5GB of cached pcaps in $cache_dir. The first couple are
$random_name1
$random_name2
$random_name3
Are you using these pcaps or can I delete them to free up space?"
If yes, then ask if they want cache enabled at all. The way to not anger people is to ask them what they want and then do that.