* Started on converting UserHTTPServer to BaseHttpServer

* Added a 'param' param to the RestMethod
* Added RestHandlerEntry to store more info about the 'rest' handler
This commit is contained in:
lbsa71
2007-04-11 14:14:19 +00:00
parent 348b765aed
commit 08d5d10d62
10 changed files with 178 additions and 172 deletions

View File

@@ -97,6 +97,12 @@ namespace OpenGridServices.UserServer
MainConsole.Instance.WriteLine("Main.cs:Startup() - Starting HTTP process");
_httpd = new UserHTTPServer();
_httpd.AddXmlRPCHandler("login_to_simulator", _profilemanager.XmlRpcLoginMethod);
_httpd.AddRestHandler( "DELETE", "/usersessions/", _profilemanager.RestDeleteUserSessionMethod );
_httpd.Start();
}

View File

@@ -51,6 +51,10 @@ namespace OpenGridServices.UserServer
public HttpListener Listener;
public UserHTTPServer() : base( 8002 )
{
}
public void Start()
{
MainConsole.Instance.WriteLine("Starting up HTTP Server");
HTTPD = new Thread(new ThreadStart(StartHTTP));
@@ -89,21 +93,13 @@ namespace OpenGridServices.UserServer
switch (req_type)
{
case "usersessions":
LLUUID sessionid = new LLUUID(rest_params[2]); // get usersessions/sessionid
string param = rest_params[2];
string result = "";
if (www_req.HttpMethod == "DELETE")
{
foreach (libsecondlife.LLUUID UUID in OpenUser_Main.userserver._profilemanager.UserProfiles.Keys)
{
if (OpenUser_Main.userserver._profilemanager.UserProfiles[UUID].CurrentSessionID == sessionid)
{
OpenUser_Main.userserver._profilemanager.UserProfiles[UUID].CurrentSessionID = null;
OpenUser_Main.userserver._profilemanager.UserProfiles[UUID].CurrentSecureSessionID = null;
OpenUser_Main.userserver._profilemanager.UserProfiles[UUID].Circuits.Clear();
}
}
result = OpenUser_Main.userserver._profilemanager.RestDeleteUserSessionMethod( null, null, param );
}
return "OK";
return result;
}
return "";