mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-11 12:42:31 +00:00
* Make DownloadStore::save(...) validate the new file by loading the
bencoded data. * Make it safe to remove torrents that are selected. * Delete the rtorrent and libtorrent sections when loading non-session torrents. * Added ^O to change a torrent's root dir, ^P to set a variable. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@628 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <time.h>
|
||||
#include <rak/functional.h>
|
||||
#include <torrent/exceptions.h>
|
||||
|
||||
@@ -117,12 +118,24 @@ uint32_t
|
||||
CommandScheduler::parse_absolute(const char* str) {
|
||||
Time result = parse_time(str);
|
||||
|
||||
// Do the local time thing.
|
||||
struct tm local;
|
||||
|
||||
switch (result.first) {
|
||||
case 1:
|
||||
return result.second;
|
||||
|
||||
case 2:
|
||||
return (result.second - cachedTime.seconds() % 3600) % 3600;
|
||||
if (localtime_r(&cachedTime.tval().tv_sec, &local) == NULL)
|
||||
throw torrent::input_error("Could not convert unix time to local time.");
|
||||
|
||||
return (result.second + 3600 - 60 * local.tm_min - local.tm_sec) % 3600;
|
||||
|
||||
case 3:
|
||||
if (localtime_r(&cachedTime.tval().tv_sec, &local) == NULL)
|
||||
throw torrent::input_error("Could not convert unix time to local time.");
|
||||
|
||||
return (result.second + 24 * 3600 - 3600 * local.tm_hour - 60 * local.tm_min - local.tm_sec) % (24 * 3600);
|
||||
|
||||
case 0:
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user