diff options
Diffstat (limited to 'Mono.Nat')
| -rw-r--r-- | Mono.Nat/NatUtility.cs | 7 | ||||
| -rw-r--r-- | Mono.Nat/Pmp/PmpNatDevice.cs | 3 | ||||
| -rw-r--r-- | Mono.Nat/Pmp/Searchers/PmpSearcher.cs | 1 | ||||
| -rw-r--r-- | Mono.Nat/Upnp/Upnp.cs | 1 |
4 files changed, 4 insertions, 8 deletions
diff --git a/Mono.Nat/NatUtility.cs b/Mono.Nat/NatUtility.cs index 983e86833..b9efd9bbd 100644 --- a/Mono.Nat/NatUtility.cs +++ b/Mono.Nat/NatUtility.cs @@ -30,7 +30,6 @@ using System; using System.Net; using System.Net.Sockets; using System.Threading; -using System.Linq; using System.Collections.Generic; using System.IO; using System.Net.NetworkInformation; @@ -98,16 +97,14 @@ namespace Mono.Nat { try { - var enabledProtocols = EnabledProtocols.ToList(); - - if (enabledProtocols.Contains(PmpSearcher.Instance.Protocol)) + if (EnabledProtocols.Contains(PmpSearcher.Instance.Protocol)) { await Receive(PmpSearcher.Instance, PmpSearcher.sockets).ConfigureAwait(false); } foreach (ISearcher s in controllers) { - if (s.NextSearch < DateTime.Now && enabledProtocols.Contains(s.Protocol)) + if (s.NextSearch < DateTime.Now && EnabledProtocols.Contains(s.Protocol)) { Log("Searching for: {0}", s.GetType().Name); s.Search(); diff --git a/Mono.Nat/Pmp/PmpNatDevice.cs b/Mono.Nat/Pmp/PmpNatDevice.cs index 10ebbdc2c..fb45b365b 100644 --- a/Mono.Nat/Pmp/PmpNatDevice.cs +++ b/Mono.Nat/Pmp/PmpNatDevice.cs @@ -31,6 +31,7 @@ using System.Net.Sockets; using System.Threading; using System.Collections.Generic; using System.Threading.Tasks; +using MediaBrowser.Model.Extensions; namespace Mono.Nat.Pmp { @@ -86,7 +87,7 @@ namespace Mono.Nat.Pmp try { - byte[] buffer = package.ToArray(); + byte[] buffer = package.ToArray(package.Count); int attempt = 0; int delay = PmpConstants.RetryDelay; diff --git a/Mono.Nat/Pmp/Searchers/PmpSearcher.cs b/Mono.Nat/Pmp/Searchers/PmpSearcher.cs index 4a8a90412..def50fb72 100644 --- a/Mono.Nat/Pmp/Searchers/PmpSearcher.cs +++ b/Mono.Nat/Pmp/Searchers/PmpSearcher.cs @@ -36,7 +36,6 @@ using System.Net; using Mono.Nat.Pmp; using System.Net.NetworkInformation; using System.Net.Sockets; -using System.Linq; using System.Threading.Tasks; namespace Mono.Nat diff --git a/Mono.Nat/Upnp/Upnp.cs b/Mono.Nat/Upnp/Upnp.cs index 38d949250..e9321f874 100644 --- a/Mono.Nat/Upnp/Upnp.cs +++ b/Mono.Nat/Upnp/Upnp.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; |
