Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Commit

Permalink
#461: removed option "AccurateRate"
Browse files Browse the repository at this point in the history
  • Loading branch information
hugbug committed Oct 29, 2017
1 parent 07c5474 commit 5b33721
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 34 deletions.
7 changes: 3 additions & 4 deletions daemon/main/Options.cpp
Expand Up @@ -117,7 +117,6 @@ static const char* OPTION_SCRIPTPAUSEQUEUE = "ScriptPauseQueue";
static const char* OPTION_NZBCLEANUPDISK = "NzbCleanupDisk";
static const char* OPTION_PARTIMELIMIT = "ParTimeLimit";
static const char* OPTION_KEEPHISTORY = "KeepHistory";
static const char* OPTION_ACCURATERATE = "AccurateRate";
static const char* OPTION_UNPACK = "Unpack";
static const char* OPTION_DIRECTUNPACK = "DirectUnpack";
static const char* OPTION_UNPACKCLEANUPDISK = "UnpackCleanupDisk";
Expand Down Expand Up @@ -172,6 +171,7 @@ static const char* OPTION_DECODE = "Decode";
static const char* OPTION_SAVEQUEUE = "SaveQueue";
static const char* OPTION_RELOADQUEUE = "ReloadQueue";
static const char* OPTION_TERMINATETIMEOUT = "TerminateTimeout";
static const char* OPTION_ACCURATERATE = "AccurateRate";

const char* BoolNames[] = { "yes", "no", "true", "false", "1", "0", "on", "off", "enable", "disable", "enabled", "disabled" };
const int BoolValues[] = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 };
Expand Down Expand Up @@ -498,7 +498,6 @@ void Options::InitDefaults()
SetOption(OPTION_NZBCLEANUPDISK, "no");
SetOption(OPTION_PARTIMELIMIT, "0");
SetOption(OPTION_KEEPHISTORY, "7");
SetOption(OPTION_ACCURATERATE, "no");
SetOption(OPTION_UNPACK, "no");
SetOption(OPTION_DIRECTUNPACK, "no");
SetOption(OPTION_UNPACKCLEANUPDISK, "no");
Expand Down Expand Up @@ -755,7 +754,6 @@ void Options::InitOptions()
m_parPauseQueue = (bool)ParseEnumValue(OPTION_PARPAUSEQUEUE, BoolCount, BoolNames, BoolValues);
m_scriptPauseQueue = (bool)ParseEnumValue(OPTION_SCRIPTPAUSEQUEUE, BoolCount, BoolNames, BoolValues);
m_nzbCleanupDisk = (bool)ParseEnumValue(OPTION_NZBCLEANUPDISK, BoolCount, BoolNames, BoolValues);
m_accurateRate = (bool)ParseEnumValue(OPTION_ACCURATERATE, BoolCount, BoolNames, BoolValues);
m_formAuth = (bool)ParseEnumValue(OPTION_FORMAUTH, BoolCount, BoolNames, BoolValues);
m_secureControl = (bool)ParseEnumValue(OPTION_SECURECONTROL, BoolCount, BoolNames, BoolValues);
m_unpack = (bool)ParseEnumValue(OPTION_UNPACK, BoolCount, BoolNames, BoolValues);
Expand Down Expand Up @@ -1607,7 +1605,8 @@ bool Options::ValidateOptionName(const char* optname, const char* optvalue)
!strcasecmp(optname, OPTION_HISTORYCLEANUPDISK) ||
!strcasecmp(optname, OPTION_SAVEQUEUE) ||
!strcasecmp(optname, OPTION_RELOADQUEUE) ||
!strcasecmp(optname, OPTION_TERMINATETIMEOUT))
!strcasecmp(optname, OPTION_TERMINATETIMEOUT) ||
!strcasecmp(optname, OPTION_ACCURATERATE))
{
ConfigWarn("Option \"%s\" is obsolete, ignored", optname);
return true;
Expand Down
2 changes: 0 additions & 2 deletions daemon/main/Options.h
Expand Up @@ -278,7 +278,6 @@ class Options
bool GetNzbCleanupDisk() { return m_nzbCleanupDisk; }
int GetParTimeLimit() { return m_parTimeLimit; }
int GetKeepHistory() { return m_keepHistory; }
bool GetAccurateRate() { return m_accurateRate; }
bool GetUnpack() { return m_unpack; }
bool GetDirectUnpack() { return m_directUnpack; }
bool GetUnpackCleanupDisk() { return m_unpackCleanupDisk; }
Expand Down Expand Up @@ -431,7 +430,6 @@ class Options
bool m_nzbCleanupDisk = false;
int m_parTimeLimit = 0;
int m_keepHistory = 0;
bool m_accurateRate = false;
bool m_unpack = false;
bool m_directUnpack = false;
bool m_unpackCleanupDisk = false;
Expand Down
2 changes: 1 addition & 1 deletion daemon/nntp/ArticleDownloader.cpp
Expand Up @@ -370,7 +370,7 @@ ArticleDownloader::EStatus ArticleDownloader::Download()
g_StatMeter->AddSpeedReading(len);
time_t oldTime = m_lastUpdateTime;
SetLastUpdateTimeNow();
if (oldTime != m_lastUpdateTime || g_Options->GetAccurateRate())
if (oldTime != m_lastUpdateTime)
{
AddServerData();
}
Expand Down
2 changes: 0 additions & 2 deletions daemon/nntp/StatMeter.cpp
Expand Up @@ -308,8 +308,6 @@ void StatMeter::AddSpeedReading(int bytes)
time_t curTime = Util::CurrentTime();
int nowSlot = (int)curTime / SPEEDMETER_SLOTSIZE;

Guard guard(g_Options->GetAccurateRate() ? &m_speedMutex : nullptr);

if (curTime != m_curSecTime)
{
m_curSecTime = curTime;
Expand Down
1 change: 0 additions & 1 deletion daemon/nntp/StatMeter.h
Expand Up @@ -106,7 +106,6 @@ class StatMeter : public Debuggable
int m_speedBytesIndex;
int m_curSecBytes;
time_t m_curSecTime;
Mutex m_speedMutex;

// time
int64 m_allBytes = 0;
Expand Down
24 changes: 0 additions & 24 deletions nzbget.conf
Expand Up @@ -1025,12 +1025,6 @@ UrlInterval=10
# Connection timeout when fetching nzb-files via URLs and fetching RSS feeds.
UrlTimeout=60

# Timeout until a download-thread should be killed (seconds).
#
# This can help on hanging downloads, but is dangerous.
# Do not use small values!
TerminateTimeout=600

# Timeout for incoming connections (seconds).
#
# Set timeout for connections from clients (web-browsers and API clients).
Expand All @@ -1043,24 +1037,6 @@ RemoteTimeout=90
# Value "0" means no speed control.
DownloadRate=0

# Accurate speed rate calculation (yes, no).
#
# During downloading using several connections the download threads may
# interfere with each other when updating statistical data for speed
# meter. This may cause small errors in current download speed reported
# by the program. The speed meter recovers automatically from such errors
# after max. 30 seconds (time window used for speed calculation).
#
# Enable the option to use thread synchronisation mechanisms in order to
# provide absolutely accurate speed calculations.
#
# NOTE: Thread synchronisation increases CPU load and therefore can
# decrease download speed. Do not activate this option on computers with
# limited CPU power. Before activating the option it is recommended to
# run tests to determine how the option affects the CPU usage and the
# download speed on a particular system.
AccurateRate=no

# Maximum number of simultaneous connections for nzb URL downloads (0-999).
#
# When NZB-files are added to queue via URL, the program downloads them
Expand Down

0 comments on commit 5b33721

Please sign in to comment.