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