diff options
| author | LogicalPhallacy <44458166+LogicalPhallacy@users.noreply.github.com> | 2019-01-23 00:31:35 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-23 00:31:35 -0800 |
| commit | 404bd04cbc17dc8c8bf4a5c9aa3ca9c5cd85aa68 (patch) | |
| tree | 3d267c6ceef9439a034c113095e10e4d619e7c70 /Mono.Nat/Upnp/UpnpNatDevice.cs | |
| parent | 8ff89fdc0c30f595a171ffc550f907ef22b6212a (diff) | |
| parent | e05e002b8bb4d13eb2b80b56a0aad8903ddb701e (diff) | |
Merge pull request #8 from jellyfin/master
rebase to latest master
Diffstat (limited to 'Mono.Nat/Upnp/UpnpNatDevice.cs')
| -rw-r--r-- | Mono.Nat/Upnp/UpnpNatDevice.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Mono.Nat/Upnp/UpnpNatDevice.cs b/Mono.Nat/Upnp/UpnpNatDevice.cs index 62539103a..fd408ee63 100644 --- a/Mono.Nat/Upnp/UpnpNatDevice.cs +++ b/Mono.Nat/Upnp/UpnpNatDevice.cs @@ -13,10 +13,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -58,7 +58,7 @@ namespace Mono.Nat.Upnp { if (localAddress == null) { - throw new ArgumentNullException("localAddress"); + throw new ArgumentNullException(nameof(localAddress)); } this.LastSeen = DateTime.Now; @@ -109,8 +109,8 @@ namespace Mono.Nat.Upnp int abortCount = 0; int bytesRead = 0; byte[] buffer = new byte[10240]; - StringBuilder servicesXml = new StringBuilder(); - XmlDocument xmldoc = new XmlDocument(); + var servicesXml = new StringBuilder(); + var xmldoc = new XmlDocument(); using (var s = response.Content) { @@ -144,7 +144,7 @@ namespace Mono.Nat.Upnp } } - XmlNamespaceManager ns = new XmlNamespaceManager(xmldoc.NameTable); + var ns = new XmlNamespaceManager(xmldoc.NameTable); ns.AddNamespace("ns", "urn:schemas-upnp-org:device-1-0"); XmlNodeList nodes = xmldoc.SelectNodes("//*/ns:serviceList", ns); @@ -169,7 +169,7 @@ namespace Mono.Nat.Upnp { if (u.IsAbsoluteUri) { - EndPoint old = hostEndPoint; + var old = hostEndPoint; IPAddress parsedHostIpAddress; if (IPAddress.TryParse(u.Host, out parsedHostIpAddress)) { @@ -228,7 +228,7 @@ namespace Mono.Nat.Upnp public override async Task CreatePortMap(Mapping mapping) { - CreatePortMappingMessage message = new CreatePortMappingMessage(mapping, localAddress, this); + var message = new CreatePortMappingMessage(mapping, localAddress, this); using (await _httpClient.SendAsync(message.Encode(), message.Method).ConfigureAwait(false)) { @@ -237,7 +237,7 @@ namespace Mono.Nat.Upnp public override bool Equals(object obj) { - UpnpNatDevice device = obj as UpnpNatDevice; + var device = obj as UpnpNatDevice; return (device == null) ? false : this.Equals((device)); } |
