aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs')
-rw-r--r--Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs16
1 files changed, 6 insertions, 10 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
index 6c658a695..8755ee3a7 100644
--- a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
+++ b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Net;
+using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
@@ -9,10 +10,9 @@ using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Events;
-using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Threading;
+using Microsoft.Extensions.Logging;
using Mono.Nat;
-using System.Threading;
namespace Emby.Server.Implementations.EntryPoints
{
@@ -108,11 +108,9 @@ namespace Emby.Server.Implementations.EntryPoints
var info = e.Argument;
- string usn;
- if (!info.Headers.TryGetValue("USN", out usn)) usn = string.Empty;
+ if (!info.Headers.TryGetValue("USN", out string usn)) usn = string.Empty;
- string nt;
- if (!info.Headers.TryGetValue("NT", out nt)) nt = string.Empty;
+ if (!info.Headers.TryGetValue("NT", out string nt)) nt = string.Empty;
// Filter device type
if (usn.IndexOf("WANIPConnection:", StringComparison.OrdinalIgnoreCase) == -1 &&
@@ -141,8 +139,7 @@ namespace Emby.Server.Implementations.EntryPoints
_logger.LogDebug("Found NAT device: " + identifier);
- IPAddress address;
- if (IPAddress.TryParse(info.Location.Host, out address))
+ if (IPAddress.TryParse(info.Location.Host, out var address))
{
// The Handle method doesn't need the port
var endpoint = new IPEndPoint(address, info.Location.Port);
@@ -153,8 +150,7 @@ namespace Emby.Server.Implementations.EntryPoints
{
var localAddressString = await _appHost.GetLocalApiUrl(CancellationToken.None).ConfigureAwait(false);
- Uri uri;
- if (Uri.TryCreate(localAddressString, UriKind.Absolute, out uri))
+ if (Uri.TryCreate(localAddressString, UriKind.Absolute, out var uri))
{
localAddressString = uri.Host;