Patch for timestamp extenstion of libtorrent

arvid at cs.umu.se arvid at cs.umu.se
Wed Jun 17 07:03:06 UTC 2009


Quoting Atul Aggarwal <searchatul at gmail.com>:

> This is a patch for adding timestamp extention to libtorrent. Some of the
> points regarding patch is
> 
> 1. It fixes the issue of storing attribute for single file.
> 2. The key used to store timestamp is "timestamp".
> 3. When dump_torrent example is called,it shows timestamp in GMT timezone
> (i.e. torrent_info returns timestamp in GMT time). This might not be an
> issue for IM project and may serve as a feature than an issue.
> 
> I will soon send the symlink extension patch.
> For any improvement, mail me.

It seems a bit redundant to me to retrieve the time_t, then convert it to ptime,
then convert it back to time_t (by subtracting the Jan 1st, 1970 date). I
believe time_t is already well defined to be relative to that date.

Also, I wonder if it might be better to name the key one of "ctime", "mtime" or
"atime", to more closely match the posix standard. Since you're using the write
time, "mtime" would be the corresponding posix name.

The timestamp to add_file() should have a default value to remain backwards
compatible.

looks good otherwise.

-- 
Arvid Norberg




More information about the instantmirror-list mailing list