aboutsummaryrefslogtreecommitdiff
path: root/SocketHttpListener/Net/HttpEndPointManager.cs
diff options
context:
space:
mode:
authorAndrew Rabert <6550543+nvllsvm@users.noreply.github.com>2019-01-22 18:13:47 -0500
committerGitHub <noreply@github.com>2019-01-22 18:13:47 -0500
commit28483bdb54be96ae83e0fded097f534d7e26ba1e (patch)
treee7f4b92326417ebf55eecdf68a01d2c3b9e660d7 /SocketHttpListener/Net/HttpEndPointManager.cs
parent920c39454c05e979eabe81877269cd4517a03ccf (diff)
parent8106c8393b711a7e1d40487e3caf2b014decbe28 (diff)
Merge pull request #651 from jellyfin/release-10.1.0
Release 10.1.0
Diffstat (limited to 'SocketHttpListener/Net/HttpEndPointManager.cs')
-rw-r--r--SocketHttpListener/Net/HttpEndPointManager.cs16
1 files changed, 5 insertions, 11 deletions
diff --git a/SocketHttpListener/Net/HttpEndPointManager.cs b/SocketHttpListener/Net/HttpEndPointManager.cs
index 01b5ae9bd..27b4244a6 100644
--- a/SocketHttpListener/Net/HttpEndPointManager.cs
+++ b/SocketHttpListener/Net/HttpEndPointManager.cs
@@ -3,12 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
-using System.Reflection;
-using System.Threading.Tasks;
-using MediaBrowser.Model.IO;
using Microsoft.Extensions.Logging;
-using MediaBrowser.Model.Net;
-using SocketHttpListener.Primitives;
namespace SocketHttpListener.Net
{
@@ -22,7 +17,7 @@ namespace SocketHttpListener.Net
public static void AddListener(ILogger logger, HttpListener listener)
{
- List<string> added = new List<string>();
+ var added = new List<string>();
try
{
lock ((s_ipEndPoints as ICollection).SyncRoot)
@@ -62,14 +57,13 @@ namespace SocketHttpListener.Net
int root = p.IndexOf('/', colon, p.Length - colon);
string portString = p.Substring(colon + 1, root - colon - 1);
- int port;
- if (!int.TryParse(portString, out port) || port <= 0 || port >= 65536)
+ if (!int.TryParse(portString, out var port) || port <= 0 || port >= 65536)
{
throw new HttpListenerException((int)HttpStatusCode.BadRequest, "net_invalid_port");
}
}
- ListenerPrefix lp = new ListenerPrefix(p);
+ var lp = new ListenerPrefix(p);
if (lp.Host != "*" && lp.Host != "+" && Uri.CheckHostName(lp.Host) == UriHostNameType.Unknown)
throw new HttpListenerException((int)HttpStatusCode.BadRequest, "net_listener_host");
@@ -136,7 +130,7 @@ namespace SocketHttpListener.Net
{
try
{
- epl = new HttpEndPointListener(listener, addr, port, secure, listener.Certificate, logger, listener.CryptoProvider, listener.SocketFactory, listener.StreamHelper, listener.TextEncoding, listener.FileSystem, listener.EnvironmentInfo);
+ epl = new HttpEndPointListener(listener, addr, port, secure, listener.Certificate, logger, listener.CryptoProvider, listener.SocketFactory, listener.StreamHelper, listener.FileSystem, listener.EnvironmentInfo);
}
catch (SocketException ex)
{
@@ -184,7 +178,7 @@ namespace SocketHttpListener.Net
private static void RemovePrefixInternal(ILogger logger, string prefix, HttpListener listener)
{
- ListenerPrefix lp = new ListenerPrefix(prefix);
+ var lp = new ListenerPrefix(prefix);
if (lp.Path.IndexOf('%') != -1)
return;