When LLSD handlers are not found, the server should return a 404 instead of a valid response saying 'No handler registered for LLSD Requests'

cpu-performance
Diva Canto 2013-07-22 21:45:57 -07:00
parent 01561166aa
commit 9c1ec98415
2 changed files with 6 additions and 1 deletions

View File

@ -1189,6 +1189,7 @@ namespace OpenSim.Framework.Servers.HttpServer
OSD llsdResponse = null; OSD llsdResponse = null;
bool LegacyLLSDLoginLibOMV = (requestBody.Contains("passwd") && requestBody.Contains("mac") && requestBody.Contains("viewer_digest")); bool LegacyLLSDLoginLibOMV = (requestBody.Contains("passwd") && requestBody.Contains("mac") && requestBody.Contains("viewer_digest"));
bool nohandler = false;
if (requestBody.Length == 0) if (requestBody.Length == 0)
// Get Request // Get Request
@ -1227,17 +1228,19 @@ namespace OpenSim.Framework.Servers.HttpServer
{ {
// Oops, no handler for this.. give em the failed message // Oops, no handler for this.. give em the failed message
llsdResponse = GenerateNoLLSDHandlerResponse(); llsdResponse = GenerateNoLLSDHandlerResponse();
nohandler = true;
} }
} }
} }
else else
{ {
llsdResponse = GenerateNoLLSDHandlerResponse(); llsdResponse = GenerateNoLLSDHandlerResponse();
nohandler = true;
} }
byte[] buffer = new byte[0]; byte[] buffer = new byte[0];
if (llsdResponse.ToString() == "shutdown404!") if (llsdResponse.ToString() == "shutdown404!" || nohandler)
{ {
response.ContentType = "text/plain"; response.ContentType = "text/plain";
response.StatusCode = 404; response.StatusCode = 404;

View File

@ -1627,6 +1627,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
bool ready = false; bool ready = false;
while (!ready && count-- > 0) while (!ready && count-- > 0)
{ {
// Let's make sure there is an active client attached to a scene presence,
// otherwise there won't be any handlers for this packet
if (m_scene.TryGetClient(endPoint, out client) && client.IsActive && client.SceneAgent != null) if (m_scene.TryGetClient(endPoint, out client) && client.IsActive && client.SceneAgent != null)
{ {
LLClientView llClientView = (LLClientView)client; LLClientView llClientView = (LLClientView)client;