Compare commits

..

No commits in common. "82847ba7e6bfe5329890b49b2fd140ba70342898" and "d3aef63feb07d79f6f9a9d5d52b6c96db9b03c9f" have entirely different histories.

6 changed files with 53 additions and 53 deletions

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework> <TargetFramework>net6.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
@ -28,8 +28,5 @@
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None> </None>
<None Update="Servers.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -21,7 +21,6 @@ namespace EonaCat.DnsTester.Helpers
{ {
client.DontFragment = true; client.DontFragment = true;
client.EnableBroadcast = false; client.EnableBroadcast = false;
client.Client.SendTimeout = DnsSendTimeout;
client.Client.ReceiveTimeout = DnsReceiveTimeout; client.Client.ReceiveTimeout = DnsReceiveTimeout;
byte[] responseBytes = null; byte[] responseBytes = null;
if (FakeResponse) if (FakeResponse)
@ -43,7 +42,6 @@ namespace EonaCat.DnsTester.Helpers
// For testing purposes // For testing purposes
public static bool FakeResponse { get; set; } public static bool FakeResponse { get; set; }
public static int DnsSendTimeout { get; set; } = 5;
public static int DnsReceiveTimeout { get; set; } = 5; public static int DnsReceiveTimeout { get; set; } = 5;

View File

@ -39,23 +39,11 @@ namespace EonaCat.DnsTester.Helpers
string url = searchEngine.Value + letters; string url = searchEngine.Value + letters;
using (var client = new WebClient())
{
string responseString = null;
try try
{ {
responseString = client.DownloadString(url); using (var client = new WebClient())
}
catch (Exception ex)
{ {
searchEngineUrls.Remove(searchEngine.Key); string responseString = client.DownloadString(url);
SetStatus($"{searchEngine.Key}: {ex.Message}");
}
if (responseString == null)
{
continue;
}
// find all .xxx.com addresses // find all .xxx.com addresses
MatchCollection hostNames = Regex.Matches(responseString, @"[.](\w+[.]com)"); MatchCollection hostNames = Regex.Matches(responseString, @"[.](\w+[.]com)");
@ -86,9 +74,18 @@ namespace EonaCat.DnsTester.Helpers
} }
} }
letters = GetRandomLetters();
await Task.Delay(100); await Task.Delay(100);
} }
catch (Exception ex)
{
searchEngineUrls.Remove(searchEngine.Key);
SetStatus($"{searchEngine.Key}: {ex.Message}");
}
finally
{
letters = GetRandomLetters();
}
}
var urlText = "url" + (urls.Count > 1 ? "'s" : string.Empty); var urlText = "url" + (urls.Count > 1 ? "'s" : string.Empty);
SetStatus($"{urls.Count} random {urlText} found"); SetStatus($"{urls.Count} random {urlText} found");

View File

@ -55,6 +55,12 @@ namespace EonaCat.DnsTester
urls = await UrlHelper.RetrieveUrls(numThreads, numUrlsPerThread); urls = await UrlHelper.RetrieveUrls(numThreads, numUrlsPerThread);
AddUrlToView(urls); AddUrlToView(urls);
if (IsRunning)
{
return;
}
IsRunning = true; IsRunning = true;
await Process(_recordType, urls.ToArray(), _dnsServer1, _dnsServer2); await Process(_recordType, urls.ToArray(), _dnsServer1, _dnsServer2);
IsRunning = false; IsRunning = false;
@ -192,11 +198,15 @@ namespace EonaCat.DnsTester
DnsHelper.OnLog += DnsHelper_OnLog; DnsHelper.OnLog += DnsHelper_OnLog;
for (int i = 0; i < urlsTotal; i++) for (int i = 0; i < urlsTotal; i++)
{
await Task.Run(async () =>
{ {
var currentUrl = urls[i]; var currentUrl = urls[i];
await ExecuteDns1(recordType, dnsAddress1, currentUrl, dnsId1, i); await ExecuteDns1(recordType, dnsAddress1, currentUrl, dnsId1, i);
if (!chkDns2.Checked) return; if (!chkDns2.Checked) return;
await ExecuteDns2(recordType, dnsAddress2, currentUrl, dnsId2, i); await ExecuteDns2(recordType, dnsAddress2, currentUrl, dnsId2, i);
});
await Task.Delay(100); await Task.Delay(100);
} }
} }

View File

@ -5,5 +5,3 @@ EonaCat.DnsTester
Dns Testing tool for Blocky Dns Testing tool for Blocky
https://blocky.EonaCat.com https://blocky.EonaCat.com
[![EonaCat DnsTester](https://github.com/EonaCat/EonaCat.DnsTester/blob/main/Screenshots/1.png?raw=true "EonaCat DnsTester")](https://github.com/EonaCat/EonaCat.DnsTester/blob/main/Screenshots/1.png?raw=true "EonaCat DnsTester")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB