From fd79f75ba6766e1edc196a73dd05fc5f806f82b2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 24 Oct 2014 02:12:30 +0100 Subject: TEST**** wingridproxy detection at grid login. Untested possible not very reliable. Adds some load even on region servers because of code at BaseHttpServer. --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 15 +++++++++++++++ OpenSim/Server/Handlers/Login/LLLoginHandlers.cs | 11 ++++++++--- OpenSim/Services/Interfaces/ILoginService.cs | 4 ++-- OpenSim/Services/LLLoginService/LLLoginService.cs | 9 ++++++--- 4 files changed, 31 insertions(+), 8 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 7841f47..799ab80 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -966,6 +966,19 @@ namespace OpenSim.Framework.Servers.HttpServer string responseString = String.Empty; XmlRpcRequest xmlRprcRequest = null; + bool gridproxy = false; + if (requestBody.Contains("encoding=\"utf-8")) + { + int channelindx = -1; + int optionsindx = requestBody.IndexOf(">options<"); + if(optionsindx >0) + { + channelindx = requestBody.IndexOf(">channel<"); + if (optionsindx < channelindx) + gridproxy = true; + } + } + try { xmlRprcRequest = (XmlRpcRequest) (new XmlRpcRequestDeserializer()).Deserialize(requestBody); @@ -1023,6 +1036,8 @@ namespace OpenSim.Framework.Servers.HttpServer } xmlRprcRequest.Params.Add(request.Headers.Get(xff)); // Param[3] + if (gridproxy) + xmlRprcRequest.Params.Add("gridproxy"); // Param[4] try { xmlRpcResponse = method(xmlRprcRequest, request.RemoteIPEndPoint); diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs index f2a5678..5d672c3 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs @@ -132,8 +132,13 @@ namespace OpenSim.Server.Handlers.Login //m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion); + + bool LibOMVclient = false; + if (request.Params.Count > 4 && (string)request.Params[4] == "gridproxy") + LibOMVclient = true; + LoginResponse reply = null; - reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, clientVersion, channel, mac, id0, remoteClient); + reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, clientVersion, channel, mac, id0, remoteClient, LibOMVclient); XmlRpcResponse response = new XmlRpcResponse(); response.Value = reply.ToHashtable(); @@ -216,7 +221,7 @@ namespace OpenSim.Server.Handlers.Login LoginResponse reply = null; reply = m_LocalService.Login(map["first"].AsString(), map["last"].AsString(), map["passwd"].AsString(), startLocation, scopeID, - map["version"].AsString(), map["channel"].AsString(), map["mac"].AsString(), map["id0"].AsString(), remoteClient); + map["version"].AsString(), map["channel"].AsString(), map["mac"].AsString(), map["id0"].AsString(), remoteClient,false); return reply.ToOSDMap(); } @@ -259,7 +264,7 @@ namespace OpenSim.Server.Handlers.Login (sender as WebSocketHttpServerHandler).GetRemoteIPEndpoint(); LoginResponse reply = null; reply = m_LocalService.Login(first, last, passwd, start, scope, version, - channel, mac, id0, endPoint); + channel, mac, id0, endPoint,false); sock.SendMessage(OSDParser.SerializeJsonString(reply.ToOSDMap())); } diff --git a/OpenSim/Services/Interfaces/ILoginService.cs b/OpenSim/Services/Interfaces/ILoginService.cs index ee9b0b1..7c44cd8 100644 --- a/OpenSim/Services/Interfaces/ILoginService.cs +++ b/OpenSim/Services/Interfaces/ILoginService.cs @@ -47,8 +47,8 @@ namespace OpenSim.Services.Interfaces public interface ILoginService { - LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, - string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP); + LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, + string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP, bool LibOMVclient); Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP); } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index ed62c43..1c1c9b0 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -247,13 +247,16 @@ namespace OpenSim.Services.LLLoginService } public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, - string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP) + string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP, bool LibOMVclient) { bool success = false; UUID session = UUID.Random(); + if (clientVersion.Contains("Radegast")) + LibOMVclient = false; - m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}", - firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0); + + m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}, Possible LibOMVGridProxy: {8} ", + firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0, LibOMVclient.ToString()); try { -- cgit v1.1