we can speedup some not simple StreamHandler a bit
parent
07caee4956
commit
bac6890391
|
@ -981,14 +981,16 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
|
|
||||||
private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler)
|
private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler)
|
||||||
{
|
{
|
||||||
|
if(m_streamHandlers.TryGetValue(handlerKey, out streamHandler))
|
||||||
|
return true;
|
||||||
|
|
||||||
string bestMatch = null;
|
string bestMatch = null;
|
||||||
|
|
||||||
lock (m_streamHandlers)
|
lock (m_streamHandlers)
|
||||||
{
|
{
|
||||||
foreach (string pattern in m_streamHandlers.Keys)
|
foreach (string pattern in m_streamHandlers.Keys)
|
||||||
{
|
{
|
||||||
if ((handlerKey == pattern)
|
if (handlerKey.StartsWith(pattern) && (HANDLER_SEPARATORS.IndexOf(handlerKey[pattern.Length]) >= 0))
|
||||||
|| (handlerKey.StartsWith(pattern) && (HANDLER_SEPARATORS.IndexOf(handlerKey[pattern.Length]) >= 0)))
|
|
||||||
{
|
{
|
||||||
if (String.IsNullOrEmpty(bestMatch) || pattern.Length > bestMatch.Length)
|
if (String.IsNullOrEmpty(bestMatch) || pattern.Length > bestMatch.Length)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue