Opened 22 months ago

Last modified 21 months ago

#1982 new enhancement

Redesign handling of .config files

Reported by: jogger Owned by: zzz
Priority: major Milestone: undecided
Component: apps/i2psnark Version: 0.9.29
Keywords: Cc:
Parent Tickets:

Description

The .config files contains metainfo for running torrents. I propose changes that aim to eliminate from the ground data loss, system crashes and annoyances already only in part described elsewhere.

1.) Do not overwrite the .config file in case of a torrent rescan (e.g. after crash or after moving the .torrent file out and in the snark data dir). Instead check torrent data against the contents of the config file if it exists, especially preserving the fields "base", "preserveFileNames", "running" and "uploaded" and update where necessary.

This solves problems currently experienced by loss of the fields "base" and "preserveFileNames", when empty files are recreated with different names in the data dir, potentially crashing the system by filling the disk and often rendering the torrent useless.

2.) Postpone any .config file deletion to the next restart and then delete if no corresponding torrent is found. Supports moving .torrrent files in and out the data dir without data loss.

3.) Write out the .config file when any change occurs instead of relying on a clean restart. At least write out when the "uploaded" field changes by 1% in order to save this valuable information that is currently frequently lost.

4.) Drop the "preserveFileNames" feature altogether. It was designed to avoid "unsafe" characters in filenames. Todays OSes and filesystems have no problem moving around files with those "unsafe" characters.

Furthermore currently leechers have files named differently from what is listed at the tracker and what the original seeders has.

Although untested it should currently be impossible to download a torrent containing the two files "*" and "?", since they will map to the same file "_".

If there are single characters that snark or trackers can not deal with at all, they should be consistently exempt and creation of torrents containing such filenames blocked.

Subtickets (add)

Change History (2)

comment:1 Changed 21 months ago by zzz

re: 4) and "today's OS and filesystems... have no problem"

This is simply speculation/handwaving and is clearly untrue:

comment:2 Changed 21 months ago by zzz

previously re: 4) : #571 #771 #1132 #1415 #1893 #1938

Note: See TracTickets for help on using tickets.