mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
we can speedup some not simple StreamHandler a bit
This commit is contained in:
@@ -981,14 +981,16 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler)
|
||||
{
|
||||
if(m_streamHandlers.TryGetValue(handlerKey, out streamHandler))
|
||||
return true;
|
||||
|
||||
string bestMatch = null;
|
||||
|
||||
lock (m_streamHandlers)
|
||||
{
|
||||
foreach (string pattern in m_streamHandlers.Keys)
|
||||
{
|
||||
if ((handlerKey == pattern)
|
||||
|| (handlerKey.StartsWith(pattern) && (HANDLER_SEPARATORS.IndexOf(handlerKey[pattern.Length]) >= 0)))
|
||||
if (handlerKey.StartsWith(pattern) && (HANDLER_SEPARATORS.IndexOf(handlerKey[pattern.Length]) >= 0))
|
||||
{
|
||||
if (String.IsNullOrEmpty(bestMatch) || pattern.Length > bestMatch.Length)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user