mirror of
https://github.com/Stone-Red-Code/HyperbolicDownloader.git
synced 2026-09-04 09:06:10 +02:00
Improve deletion of port mapping
This commit is contained in:
@@ -94,14 +94,7 @@ public class ApiManager
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IEnumerable<Mapping>? mappings = device.GetAllMappingsAsync().GetAwaiter().GetResult();
|
device.DeletePortMapAsync(portMapping).GetAwaiter().GetResult();
|
||||||
foreach (Mapping? mapping in mappings)
|
|
||||||
{
|
|
||||||
if (mapping.Description.Contains("HyperbolicDowloader") && mapping.PrivateIP.ToString() == portMapping?.PrivateIP.ToString())
|
|
||||||
{
|
|
||||||
device.DeletePortMapAsync(mapping).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user