[Modify] Add it

This commit is contained in:
sta 2016-06-07 14:55:58 +09:00
parent aa7ffde7ac
commit b02b6f25e0

View File

@ -369,6 +369,35 @@ namespace WebSocketSharp.Net
return bestMatch;
}
private static HttpListener searchHttpListenerFromSpecial (
string path, List<HttpListenerPrefix> prefixes, out HttpListenerPrefix prefix
)
{
prefix = null;
if (prefixes == null)
return null;
HttpListener bestMatch = null;
var bestLen = -1;
foreach (var pref in prefixes) {
var prefPath = pref.Path;
var len = prefPath.Length;
if (len < bestLen)
continue;
if (path.StartsWith (prefPath)) {
bestLen = len;
bestMatch = pref.Listener;
prefix = pref;
}
}
return bestMatch;
}
#endregion
#region Internal Methods