Maximum number of half-open connections can now be changed from program preferences (default is now 50 instead of unlimited)

This commit is contained in:
Christophe Dumez
2010-03-25 19:16:43 +00:00
parent daff6dce4c
commit 63457c034f
6 changed files with 32 additions and 4 deletions

View File

@@ -916,6 +916,19 @@ public:
settings.setValue(QString::fromUtf8("Preferences/Connection/ResolvePeerHostNames"), resolve);
}
static int getMaxHalfOpenConnections() {
QSettings settings("qBittorrent", "qBittorrent");
const int val = settings.value(QString::fromUtf8("Preferences/Connection/MaxHalfOpenConnec"), 50).toInt();
if(val <= 0) return -1;
return val;
}
static void setMaxHalfOpenConnections(int value) {
QSettings settings("qBittorrent", "qBittorrent");
if(value <= 0) value = -1;
settings.setValue(QString::fromUtf8("Preferences/Connection/MaxHalfOpenConnec"), value);
}
};
#endif // PREFERENCES_H