effigies / BitTornado

UNMAINTAINED - John Hoffman's fork of the original bittorrent
Other
150 stars 44 forks source link

BF: Use integer mtime for parsed directory #26

Closed effigies closed 8 years ago

effigies commented 8 years ago

parsedir is only called from Client.launchmanycore.LaunchMany.scan() and Tracker.track.Tracker.parse_allowed(). In the former case, the affected dict, file_cache is only used in repeated calls to parsedir. In the latter, the affected dict, allowed_dir_files also exists in the Tracker.state dict, which is what caused #25 in the first place.

The only potentially negative impact of this change I can see is if a file of the same length is placed in the same directory before the clock rolls over to a new second. The alternative fix would be to coerce the float to an int at save time, which would result in having to re-parse the directory anyway, as the mtimes would no longer match.

Closes #25.