Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Oct 6, 2024
1 parent 409fe52 commit 53a2fbd
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions v2rayN/ServiceLib/Handler/WebDavHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,26 @@ public async Task<bool> CheckConnection()
}
await TryCreateDir();

var testName = "readme_test";
var myContent = new StringContent(testName);
var result = await _client.PutFile($"{_webDir}/{testName}", myContent);
if (result.IsSuccessful)
try
{
await _client.Delete($"{_webDir}/{testName}");
return true;
var testName = "readme_test";
var myContent = new StringContent(testName);
var result = await _client.PutFile($"{_webDir}/{testName}", myContent);
if (result.IsSuccessful)
{
await _client.Delete($"{_webDir}/{testName}");
return true;
}
else
{
SaveLog(result.Description);
}
}
else
catch (Exception ex)
{
SaveLog(result.Description);
return false;
SaveLog(ex);
}
return false;
}

public async Task<bool> PutFile(string fileName)
Expand Down

0 comments on commit 53a2fbd

Please sign in to comment.