cosmetics, rename a few vars, etc

master
UbitUmarov 2020-03-02 01:32:33 +00:00
parent 904553cdb3
commit 97cb6254ef
7 changed files with 40 additions and 37 deletions

View File

@ -48,7 +48,7 @@ namespace OpenSim.Framework.Servers.HttpServer
public DropMethod Drop; public DropMethod Drop;
public UUID Id; public UUID Id;
public int TimeOutms; public int TimeOutms;
public EventType Type; //public EventType Type;
public enum EventType : int public enum EventType : int
{ {
@ -87,7 +87,7 @@ namespace OpenSim.Framework.Servers.HttpServer
Drop = pDrop; Drop = pDrop;
Id = pId; Id = pId;
TimeOutms = pTimeOutms; TimeOutms = pTimeOutms;
Type = EventType.Poll; //Type = EventType.Poll;
} }
} }
} }

View File

@ -97,23 +97,23 @@ namespace OpenSim.Region.ClientStack.LindenCaps
public void RegisterCaps(UUID agent, Caps caps) public void RegisterCaps(UUID agent, Caps caps)
{ {
UUID capId = UUID.Random(); string capPath = "/CAPS/" + UUID.Random().ToString();
caps.RegisterHandler("AgentPreferences", caps.RegisterHandler("AgentPreferences",
new RestStreamHandler("POST", "/CAPS/" + capId, new RestStreamHandler("POST", capPath,
delegate(string request, string path, string param, delegate(string request, string path, string param,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{ {
return UpdateAgentPreferences(request, path, param, agent); return UpdateAgentPreferences(request, path, param, agent);
})); }));
caps.RegisterHandler("UpdateAgentLanguage", caps.RegisterHandler("UpdateAgentLanguage",
new RestStreamHandler("POST", "/CAPS/" + capId, new RestStreamHandler("POST", capPath,
delegate(string request, string path, string param, delegate(string request, string path, string param,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{ {
return UpdateAgentPreferences(request, path, param, agent); return UpdateAgentPreferences(request, path, param, agent);
})); }));
caps.RegisterHandler("UpdateAgentInformation", caps.RegisterHandler("UpdateAgentInformation",
new RestStreamHandler("POST", "/CAPS/" + capId, new RestStreamHandler("POST", capPath,
delegate(string request, string path, string param, delegate(string request, string path, string param,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{ {

View File

@ -239,13 +239,13 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
m_scene = scene; m_scene = scene;
// x is request id, y is userid
HasEvents = (x, y) => HasEvents = (requestID, agentID) =>
{ {
lock (responses) lock (responses)
{ {
APollResponse response; APollResponse response;
if (responses.TryGetValue(x, out response)) if (responses.TryGetValue(requestID, out response))
{ {
if (m_presence == null) if (m_presence == null)
m_presence = m_scene.GetScenePresence(pId); m_presence = m_scene.GetScenePresence(pId);
@ -260,37 +260,37 @@ namespace OpenSim.Region.ClientStack.Linden
} }
}; };
Drop = (x, y) => Drop = (requestID, y) =>
{ {
lock (responses) lock (responses)
{ {
responses.Remove(x); responses.Remove(requestID);
lock(dropedResponses) lock(dropedResponses)
dropedResponses.Add(x); dropedResponses.Add(requestID);
} }
}; };
GetEvents = (x, y) => GetEvents = (requestID, y) =>
{ {
lock (responses) lock (responses)
{ {
try try
{ {
return responses[x].response; return responses[requestID].response;
} }
finally finally
{ {
responses.Remove(x); responses.Remove(requestID);
} }
} }
}; };
// x is request id, y is request data hashtable // x is request id, y is request data hashtable
Request = (x, y) => Request = (requestID, request) =>
{ {
APollRequest reqinfo = new APollRequest(); APollRequest reqinfo = new APollRequest();
reqinfo.thepoll = this; reqinfo.thepoll = this;
reqinfo.reqID = x; reqinfo.reqID = requestID;
reqinfo.request = y; reqinfo.request = request;
m_queue.Add(reqinfo); m_queue.Add(reqinfo);
}; };
@ -396,7 +396,7 @@ namespace OpenSim.Region.ClientStack.Linden
// Register this as a poll service // Register this as a poll service
PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene); PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene);
args.Type = PollServiceEventArgs.EventType.Texture; //args.Type = PollServiceEventArgs.EventType.Texture;
MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args);
if (handler != null) if (handler != null)
@ -416,7 +416,7 @@ namespace OpenSim.Region.ClientStack.Linden
string capUrl = "/CAPS/" + UUID.Random() + "/"; string capUrl = "/CAPS/" + UUID.Random() + "/";
PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene); PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene);
args.Type = PollServiceEventArgs.EventType.Mesh; //args.Type = PollServiceEventArgs.EventType.Mesh;
MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args);
if (handler != null) if (handler != null)
@ -434,7 +434,7 @@ namespace OpenSim.Region.ClientStack.Linden
string capUrl = "/CAPS/" + UUID.Random() + "/"; string capUrl = "/CAPS/" + UUID.Random() + "/";
PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene); PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene);
args.Type = PollServiceEventArgs.EventType.Mesh2; //args.Type = PollServiceEventArgs.EventType.Mesh2;
MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args);
if (handler != null) if (handler != null)
@ -453,7 +453,7 @@ namespace OpenSim.Region.ClientStack.Linden
string capUrl = "/CAPS/" + UUID.Random() + "/"; string capUrl = "/CAPS/" + UUID.Random() + "/";
PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene); PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene);
args.Type = PollServiceEventArgs.EventType.Asset; //args.Type = PollServiceEventArgs.EventType.Asset;
MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args);
if (handler != null) if (handler != null)

View File

@ -283,7 +283,6 @@ namespace OpenSim.Region.ClientStack.Linden
Hashtable responsedata = new Hashtable(); Hashtable responsedata = new Hashtable();
responsedata["int_response_code"] = 200; responsedata["int_response_code"] = 200;
responsedata["content_type"] = "text/plain"; responsedata["content_type"] = "text/plain";
responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(copy); responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(copy);
return responsedata; return responsedata;

View File

@ -257,39 +257,43 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
m_module = module; m_module = module;
HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; HasEvents = (requestID, y) =>
{
lock (responses)
return responses.ContainsKey(requestID);
};
Drop = (x, y) => Drop = (requestID, y) =>
{ {
lock (responses) lock (responses)
{ {
responses.Remove(x); responses.Remove(requestID);
lock(dropedResponses) lock(dropedResponses)
dropedResponses.Add(x); dropedResponses.Add(requestID);
} }
}; };
GetEvents = (x, y) => GetEvents = (requestID, y) =>
{ {
lock (responses) lock (responses)
{ {
try try
{ {
return responses[x]; return responses[requestID];
} }
finally finally
{ {
responses.Remove(x); responses.Remove(requestID);
} }
} }
}; };
Request = (x, y) => Request = (requestID, request) =>
{ {
APollRequest reqinfo = new APollRequest(); APollRequest reqinfo = new APollRequest();
reqinfo.thepoll = this; reqinfo.thepoll = this;
reqinfo.reqID = x; reqinfo.reqID = requestID;
reqinfo.request = y; reqinfo.request = request;
m_queue.Add(reqinfo); m_queue.Add(reqinfo);
}; };
@ -377,7 +381,7 @@ namespace OpenSim.Region.ClientStack.Linden
// Register this as a poll service // Register this as a poll service
PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(this, capUrl, agentID); PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(this, capUrl, agentID);
args.Type = PollServiceEventArgs.EventType.Inventory; //args.Type = PollServiceEventArgs.EventType.Inventory;
caps.RegisterPollHandler(capName, args); caps.RegisterPollHandler(capName, args);
} }

View File

@ -258,7 +258,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
PollServiceEventArgs args PollServiceEventArgs args
= new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000); = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000);
args.Type = PollServiceEventArgs.EventType.LslHttp; //args.Type = PollServiceEventArgs.EventType.LslHttp;
m_HttpServer.AddPollServiceHTTPHandler(uri, args); m_HttpServer.AddPollServiceHTTPHandler(uri, args);
// m_log.DebugFormat( // m_log.DebugFormat(
@ -316,7 +316,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
PollServiceEventArgs args PollServiceEventArgs args
= new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000); = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000);
args.Type = PollServiceEventArgs.EventType.LslHttp; //args.Type = PollServiceEventArgs.EventType.LslHttp;
m_HttpsServer.AddPollServiceHTTPHandler(uri, args); m_HttpsServer.AddPollServiceHTTPHandler(uri, args);
// m_log.DebugFormat( // m_log.DebugFormat(

View File

@ -331,7 +331,7 @@ namespace OpenSim.Server.Base
int nterms = terms.Length; int nterms = terms.Length;
if (nterms == 0) if (nterms == 0)
return new Dictionary<string, object>(); return new Dictionary<string, object>();
Dictionary<string, object> result = new Dictionary<string, object>(nterms); Dictionary<string, object> result = new Dictionary<string, object>(nterms);
string name; string name;