diff options
-rw-r--r-- | OpenSim/Framework/Servers/BaseHttpServer.cs | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 361f895..617dcae 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs | |||
@@ -499,26 +499,29 @@ namespace OpenSim.Framework.Servers | |||
499 | { | 499 | { |
500 | string bestMatch = null; | 500 | string bestMatch = null; |
501 | 501 | ||
502 | foreach (string pattern in m_streamHandlers.Keys) | 502 | lock (m_streamHandlers) |
503 | { | 503 | { |
504 | if (handlerKey.StartsWith(pattern)) | 504 | foreach (string pattern in m_streamHandlers.Keys) |
505 | { | 505 | { |
506 | if (String.IsNullOrEmpty(bestMatch) || pattern.Length > bestMatch.Length) | 506 | if (handlerKey.StartsWith(pattern)) |
507 | { | 507 | { |
508 | bestMatch = pattern; | 508 | if (String.IsNullOrEmpty(bestMatch) || pattern.Length > bestMatch.Length) |
509 | { | ||
510 | bestMatch = pattern; | ||
511 | } | ||
509 | } | 512 | } |
510 | } | 513 | } |
511 | } | 514 | |
512 | 515 | if (String.IsNullOrEmpty(bestMatch)) | |
513 | if (String.IsNullOrEmpty(bestMatch)) | 516 | { |
514 | { | 517 | streamHandler = null; |
515 | streamHandler = null; | 518 | return false; |
516 | return false; | 519 | } |
517 | } | 520 | else |
518 | else | 521 | { |
519 | { | 522 | streamHandler = m_streamHandlers[bestMatch]; |
520 | streamHandler = m_streamHandlers[bestMatch]; | 523 | return true; |
521 | return true; | 524 | } |
522 | } | 525 | } |
523 | } | 526 | } |
524 | 527 | ||
@@ -1482,7 +1485,7 @@ namespace OpenSim.Framework.Servers | |||
1482 | 1485 | ||
1483 | //m_log.DebugFormat("[BASE HTTP SERVER]: Removing handler key {0}", handlerKey); | 1486 | //m_log.DebugFormat("[BASE HTTP SERVER]: Removing handler key {0}", handlerKey); |
1484 | 1487 | ||
1485 | m_streamHandlers.Remove(handlerKey); | 1488 | lock (m_streamHandlers) m_streamHandlers.Remove(handlerKey); |
1486 | } | 1489 | } |
1487 | 1490 | ||
1488 | public void RemoveHTTPHandler(string httpMethod, string path) | 1491 | public void RemoveHTTPHandler(string httpMethod, string path) |