]> git.deb.at Git - rhonda/impostor.hazel.git/commitdiff
Fix warnings
authorjs6pak <kubastaron@hotmail.com>
Wed, 31 Mar 2021 11:39:15 +0000 (13:39 +0200)
committerjs6pak <kubastaron@hotmail.com>
Fri, 2 Apr 2021 21:13:37 +0000 (23:13 +0200)
Hazel/NetworkConnection.cs
Hazel/UPnP/UPnPHelper.cs

index 3b07174abb9f3f4a747b8814e050911ea0f85639..3755a090509bf6cb1b07f9af6204c2b0a46d8c8b 100644 (file)
@@ -29,7 +29,9 @@ namespace Impostor.Hazel
         {
             if (IPMode == IPMode.IPv4)
             {
+#pragma warning disable 618
                 return this.EndPoint.Address.Address;
+#pragma warning restore 618
             }
             else
             {
index 5b44e0d15a9bc371a5aa10c0188f6b0f1e96c8ea..d44a7e4322e3ddc1cd4e9e820e0b6ac2ddd69d59 100644 (file)
@@ -281,7 +281,7 @@ namespace Impostor.Hazel.UPnP
                 "</u:DeletePortMapping>", "DeletePortMapping");
                 return true;
             }
-            catch (Exception ex)
+            catch (Exception)
             {
                 // m_peer.LogWarning("UPnP delete forwarding rule failed: " + ex.Message);
                 return false;
@@ -304,7 +304,7 @@ namespace Impostor.Hazel.UPnP
                 string IP = xdoc.SelectSingleNode("//NewExternalIPAddress/text()", nsMgr).Value;
                 return IPAddress.Parse(IP);
             }
-            catch (Exception ex)
+            catch (Exception)
             {
                 // m_peer.LogWarning("Failed to get external IP: " + ex.Message);
                 return null;
@@ -344,4 +344,4 @@ $"<s:Body>{soap}</s:Body>" +
             this.socket.Dispose();
         }
     }
-}
\ No newline at end of file
+}