diff options
Diffstat (limited to 'Mono.Nat')
| -rw-r--r-- | Mono.Nat/NatUtility.cs | 6 | ||||
| -rw-r--r-- | Mono.Nat/Pmp/PmpNatDevice.cs | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/Mono.Nat/NatUtility.cs b/Mono.Nat/NatUtility.cs index 983e86833..c1983658d 100644 --- a/Mono.Nat/NatUtility.cs +++ b/Mono.Nat/NatUtility.cs @@ -98,16 +98,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; |
