aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
diff options
context:
space:
mode:
authorAndrew Rabert <6550543+nvllsvm@users.noreply.github.com>2019-01-22 18:13:47 -0500
committerGitHub <noreply@github.com>2019-01-22 18:13:47 -0500
commit28483bdb54be96ae83e0fded097f534d7e26ba1e (patch)
treee7f4b92326417ebf55eecdf68a01d2c3b9e660d7 /Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
parent920c39454c05e979eabe81877269cd4517a03ccf (diff)
parent8106c8393b711a7e1d40487e3caf2b014decbe28 (diff)
Merge pull request #651 from jellyfin/release-10.1.0
Release 10.1.0
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs')
-rw-r--r--Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs20
1 files changed, 8 insertions, 12 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
index 6cd867921..8755ee3a7 100644
--- a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
+++ b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
@@ -1,7 +1,8 @@
-using System;
+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;
@@ -227,7 +223,7 @@ namespace Emby.Server.Implementations.EntryPoints
{
if (_disposed)
{
- throw new ObjectDisposedException("PortMapper");
+ throw new ObjectDisposedException(GetType().Name);
}
// On some systems the device discovered event seems to fire repeatedly