diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-08-09 15:56:38 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-08-09 15:56:38 -0400 |
| commit | 40442f887ba717ae47620b152315f21b252fe049 (patch) | |
| tree | 340be082fd2296f19aed17b24b22b5095e3815a7 /Mono.Nat | |
| parent | 52aeb3c40b3e2f0fdc377ac7c793714add2be0ef (diff) | |
consolidate emby.server.core into emby.server.implementations
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; |
