[Modify] Add it

This commit is contained in:
sta 2016-06-14 15:30:19 +09:00
parent 3351912e99
commit a595ac3642

View File

@ -340,6 +340,32 @@ namespace WebSocketSharp.Net
return bestMatch;
}
private static HttpListener searchHttpListenerFromSpecial (
string path, List<HttpListenerPrefix> prefixes
)
{
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;
}
}
return bestMatch;
}
private static HttpListener searchHttpListenerFromSpecial (
string path, List<HttpListenerPrefix> prefixes, out HttpListenerPrefix prefix
)