TEST**** wingridproxy detection at grid login. Untested possible not

very reliable. Adds some load even on region servers because of code at
 BaseHttpServer.
avinationmerge
UbitUmarov 2014-10-24 02:12:30 +01:00
parent 382df37f80
commit fd79f75ba6
4 changed files with 31 additions and 8 deletions

View File

@ -966,6 +966,19 @@ namespace OpenSim.Framework.Servers.HttpServer
string responseString = String.Empty; string responseString = String.Empty;
XmlRpcRequest xmlRprcRequest = null; 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 try
{ {
xmlRprcRequest = (XmlRpcRequest) (new XmlRpcRequestDeserializer()).Deserialize(requestBody); xmlRprcRequest = (XmlRpcRequest) (new XmlRpcRequestDeserializer()).Deserialize(requestBody);
@ -1023,6 +1036,8 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
xmlRprcRequest.Params.Add(request.Headers.Get(xff)); // Param[3] xmlRprcRequest.Params.Add(request.Headers.Get(xff)); // Param[3]
if (gridproxy)
xmlRprcRequest.Params.Add("gridproxy"); // Param[4]
try try
{ {
xmlRpcResponse = method(xmlRprcRequest, request.RemoteIPEndPoint); xmlRpcResponse = method(xmlRprcRequest, request.RemoteIPEndPoint);

View File

@ -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); //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; 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(); XmlRpcResponse response = new XmlRpcResponse();
response.Value = reply.ToHashtable(); response.Value = reply.ToHashtable();
@ -216,7 +221,7 @@ namespace OpenSim.Server.Handlers.Login
LoginResponse reply = null; LoginResponse reply = null;
reply = m_LocalService.Login(map["first"].AsString(), map["last"].AsString(), map["passwd"].AsString(), startLocation, scopeID, 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(); return reply.ToOSDMap();
} }
@ -259,7 +264,7 @@ namespace OpenSim.Server.Handlers.Login
(sender as WebSocketHttpServerHandler).GetRemoteIPEndpoint(); (sender as WebSocketHttpServerHandler).GetRemoteIPEndpoint();
LoginResponse reply = null; LoginResponse reply = null;
reply = m_LocalService.Login(first, last, passwd, start, scope, version, 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())); sock.SendMessage(OSDParser.SerializeJsonString(reply.ToOSDMap()));
} }

View File

@ -48,7 +48,7 @@ namespace OpenSim.Services.Interfaces
public interface ILoginService public interface ILoginService
{ {
LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, 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);
Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP); Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP);
} }

View File

@ -247,13 +247,16 @@ namespace OpenSim.Services.LLLoginService
} }
public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, 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; bool success = false;
UUID session = UUID.Random(); 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 try
{ {