move ServerReleaseNotes module to simpleStreamHandler
parent
8d2f90a8e2
commit
f955482dfd
|
@ -95,7 +95,7 @@ namespace OpenSim.Region.ClientStack.LindenCaps
|
|||
|
||||
public void RegisterCaps(UUID agent, Caps caps)
|
||||
{
|
||||
string capPath = "/" + UUID.Random().ToString();
|
||||
string capPath = "/" + UUID.Random().ToString() + "/";
|
||||
caps.RegisterSimpleHandler("AgentPreferences",
|
||||
new SimpleStreamHandler(capPath, delegate(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
|
|
|
@ -112,22 +112,18 @@ namespace OpenSim.Region.ClientStack.LindenCaps
|
|||
|
||||
public void RegisterCaps(UUID agentID, Caps caps)
|
||||
{
|
||||
string capUrl = "/CAPS/" + UUID.Random() + "/";
|
||||
|
||||
IRequestHandler ServerReleaseNote = new RestHTTPHandler("GET", capUrl,
|
||||
delegate (Hashtable request)
|
||||
{
|
||||
return ProcessServerReleaseNotes(request, agentID);
|
||||
});
|
||||
caps.RegisterHandler("ServerReleaseNotes", ServerReleaseNote);
|
||||
string capPath = "/" + UUID.Random() + "/";
|
||||
caps.RegisterSimpleHandler("ServerReleaseNotes",
|
||||
new SimpleStreamHandler(capPath, delegate (IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
ProcessServerReleaseNotes(httpResponse);
|
||||
}));
|
||||
}
|
||||
|
||||
private Hashtable ProcessServerReleaseNotes(Hashtable request, UUID agentID)
|
||||
private void ProcessServerReleaseNotes(IOSHttpResponse httpResponse)
|
||||
{
|
||||
Hashtable responsedata = new Hashtable();
|
||||
responsedata["int_response_code"] = HttpStatusCode.Moved;
|
||||
responsedata["str_redirect_location"] = m_ServerReleaseNotesURL;
|
||||
return responsedata;
|
||||
httpResponse.StatusCode = (int)HttpStatusCode.Moved;
|
||||
httpResponse.AddHeader("Location:", m_ServerReleaseNotesURL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue