Skip to content

Commit de5d0ae

Browse files
author
goingfine
committed
udate diagnose to include upload results
1 parent 0ac1edd commit de5d0ae

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

windows/Classes/Checker/CheckIPWorking.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ public bool check()
7878
Tools.logStep(
7979
string.Format(Environment.NewLine + "Fronting Result: {0}", frontingSuccess ? "SUCCESS" : "FAILED") + Environment.NewLine +
8080
string.Format("v2ray.exe Execution: {0}", isV2rayExecutionSuccess ? "SUCCESS" : "FAILED") + Environment.NewLine +
81-
string.Format("Download Result: {0}", v2rayDLSuccess ? "SUCCESS" : "FAILED"), isDiagnosing
81+
string.Format("Download Result: {0}", checkResultStatus.isDownSuccess() ? "SUCCESS" : "FAILED") + Environment.NewLine +
82+
string.Format("Upload Result: {0}", checkResultStatus.isUpSuccess() ? "SUCCESS" : "FAILED"), isDiagnosing
8283
);
8384

8485
Tools.logStep("\n------------ End IP Check ------------\n", isDiagnosing);
@@ -167,7 +168,7 @@ public bool checkFronting(bool withCustumDNSResolver = true, int timeout = 1)
167168
private bool checkV2raySpeed()
168169
{
169170
// check download
170-
if (checkType is CheckType.DOWNLOAD or CheckType.BOTH)
171+
if (checkType is CheckType.DOWNLOAD or CheckType.BOTH || isDiagnosing)
171172
{
172173
string dlUrl = "https://" + ConfigManager.Instance.getAppConfig().downloadDomain + dlTargetSpeed.getTargetFileSize(checkTimeout);
173174
var cs = new CheckSettings(ip, port, checkTimeout, dlUrl, isDiagnosing, checkType, dlTargetSpeed);
@@ -185,7 +186,7 @@ private bool checkV2raySpeed()
185186
}
186187

187188
// check upload
188-
if (checkType is CheckType.UPLOAD or CheckType.BOTH){
189+
if (checkType is CheckType.UPLOAD or CheckType.BOTH || isDiagnosing){
189190
string upUrl = "https://" + ConfigManager.Instance.getAppConfig().uploadDomain;
190191
var cs = new CheckSettings(ip, port, checkTimeout, upUrl, isDiagnosing, checkType, upTargetSpeed);
191192
var upChecker = new UploadChecker(cs);

windows/Classes/Checker/CheckResultStatus.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ public bool isSuccess()
3232
}
3333
}
3434

35+
public bool isDownSuccess()
36+
{
37+
return isDownloadSuccess;
38+
}
39+
40+
public bool isUpSuccess()
41+
{
42+
return isUploadSuccess;
43+
}
44+
3545
public void setDownloadSuccess()
3646
{
3747
this.isDownloadSuccess = true;

0 commit comments

Comments
 (0)