Feature: Option to disable latency test on connected

This commit is contained in:
dyhkwong 2020-12-12 17:07:13 +08:00 committed by QxQ
parent 5c6072cdc1
commit 3e47e3c6ca
7 changed files with 40 additions and 2 deletions

View File

@ -118,7 +118,8 @@ namespace Qv2ray::base::config
bool setSessionResumption = false;
bool testLatencyPeriodcally = false;
bool disableSystemRoot = false;
JSONSTRUCT_REGISTER(Qv2rayConfig_Advanced, F(setAllowInsecure, setSessionResumption, testLatencyPeriodcally, disableSystemRoot))
bool testLatencyOnConnected = false;
JSONSTRUCT_REGISTER(Qv2rayConfig_Advanced, F(setAllowInsecure, setSessionResumption, testLatencyPeriodcally, disableSystemRoot, testLatencyOnConnected))
};
enum Qv2rayLatencyTestingMethod

View File

@ -657,7 +657,10 @@ void MainWindow::OnConnected(const ConnectionGroupPair &id)
//
QTimer::singleShot(1000, ConnectionManager, [id]() {
// After the kernel initialization is complete, we can test the delay without worry
if (GlobalConfig.advancedConfig.testLatencyOnConnected)
{
ConnectionManager->StartLatencyTest(id.connectionId);
}
});
if (GlobalConfig.inboundConfig.systemProxySettings.setSystemProxy)
{

View File

@ -194,6 +194,7 @@ PreferencesWindow::PreferencesWindow(QWidget *parent) : QvDialog("PreferenceWind
setAllowInsecureCB->setChecked(CurrentConfig.advancedConfig.setAllowInsecure);
setSessionResumptionCB->setChecked(CurrentConfig.advancedConfig.setSessionResumption);
setTestLatenctCB->setChecked(CurrentConfig.advancedConfig.testLatencyPeriodcally);
setTestLatenctOnConnectedCB->setChecked(CurrentConfig.advancedConfig.testLatencyOnConnected);
disableSystemRootCB->setChecked(CurrentConfig.advancedConfig.disableSystemRoot);
}
//
@ -854,6 +855,16 @@ void PreferencesWindow::on_setTestLatenctCB_stateChanged(int arg1)
CurrentConfig.advancedConfig.testLatencyPeriodcally = arg1 == Qt::Checked;
}
void PreferencesWindow::on_setTestLatenctOnConnectedCB_stateChanged(int arg1)
{
LOADINGCHECK
if (arg1 == Qt::Checked)
{
QvMessageBoxWarn(this, tr("Dangerous Operation"), tr("This will (probably) make it easy to fingerprint your connection."));
}
CurrentConfig.advancedConfig.testLatencyOnConnected = arg1 == Qt::Checked;
}
void PreferencesWindow::on_setSessionResumptionCB_stateChanged(int arg1)
{
LOADINGCHECK

View File

@ -96,6 +96,7 @@ class PreferencesWindow
void on_qvProxyPortCB_valueChanged(int arg1);
void on_setAllowInsecureCB_stateChanged(int arg1);
void on_setTestLatenctCB_stateChanged(int arg1);
void on_setTestLatenctOnConnectedCB_stateChanged(int arg1);
void on_setSessionResumptionCB_stateChanged(int arg1);
void on_quietModeCB_stateChanged(int arg1);
void on_tproxGroupBox_toggled(bool arg1);

View File

@ -647,6 +647,20 @@ But could damage your server if improperly used.</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_44">
<property name="text">
<string>Test Latency On Connected</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="setTestLatenctOnConnectedCB">
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -1335,6 +1335,10 @@ This could resolve the certificate issues, but also could let one performing TLS
<source>Test Latency Periodcally</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Test Latency On Connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Run TCPing or ICMPing periodcally after connecting to a server.
Qv2ray will give a more accurate latency value if Enabled, but makes it easy to fingerprint the connection.</source>

View File

@ -1342,6 +1342,10 @@ This could resolve the certificate issues, but also could let one performing TLS
<source>Test Latency Periodcally</source>
<translation></translation>
</message>
<message>
<source>Test Latency On Connected</source>
<translation></translation>
</message>
<message>
<source>Run TCPing or ICMPing periodcally after connecting to a server.
Qv2ray will give a more accurate latency value if Enabled, but makes it easy to fingerprint the connection.</source>