no need for stream hanlder description
parent
9d08f8307e
commit
a3cd0cbfcb
|
@ -92,7 +92,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
public interface ISimpleStreamHandler
|
public interface ISimpleStreamHandler
|
||||||
{
|
{
|
||||||
string Name { get; }
|
string Name { get; }
|
||||||
string Description { get; }
|
|
||||||
string Path { get; }
|
string Path { get; }
|
||||||
|
|
||||||
int RequestsReceived { get; }
|
int RequestsReceived { get; }
|
||||||
|
|
|
@ -43,14 +43,14 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
|
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
|
|
||||||
public string Description { get; private set; }
|
protected SimpleBaseRequestHandler(string path)
|
||||||
|
{
|
||||||
protected SimpleBaseRequestHandler(string path) : this(path, null, null) { }
|
Name = null;
|
||||||
|
m_path = path;
|
||||||
protected SimpleBaseRequestHandler(string path, string name, string description)
|
}
|
||||||
|
protected SimpleBaseRequestHandler(string path, string name)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
Description = description;
|
|
||||||
m_path = path;
|
m_path = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,12 +78,5 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
|
|
||||||
return path.StartsWith(Path);
|
return path.StartsWith(Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string[] SplitParams(string path)
|
|
||||||
{
|
|
||||||
string param = GetParam(path);
|
|
||||||
|
|
||||||
return param.Split(new char[] { '/', '?', '&' }, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -43,28 +43,32 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
protected IServiceAuth m_Auth;
|
protected IServiceAuth m_Auth;
|
||||||
protected SimpleStreamMethod m_processRequest;
|
protected SimpleStreamMethod m_processRequest;
|
||||||
|
|
||||||
public SimpleStreamHandler(string path) : base(path, null, null) { }
|
public SimpleStreamHandler(string path) : base(path) { }
|
||||||
public SimpleStreamHandler(string path, string name, string description) : base(path, name, description) { }
|
public SimpleStreamHandler(string path, string name) : base(path, name) { }
|
||||||
|
|
||||||
public SimpleStreamHandler(string path, SimpleStreamMethod processRequest) : base(path, null, null)
|
public SimpleStreamHandler(string path, SimpleStreamMethod processRequest) : base(path)
|
||||||
|
{
|
||||||
|
m_processRequest = processRequest;
|
||||||
|
}
|
||||||
|
public SimpleStreamHandler(string path, SimpleStreamMethod processRequest, string name) : base(path, name)
|
||||||
{
|
{
|
||||||
m_processRequest = processRequest;
|
m_processRequest = processRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleStreamHandler(string path, IServiceAuth auth) : base(path, null, null)
|
public SimpleStreamHandler(string path, IServiceAuth auth) : base(path)
|
||||||
{
|
{
|
||||||
m_Auth = auth;
|
m_Auth = auth;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleStreamHandler(string path, IServiceAuth auth, SimpleStreamMethod processRequest)
|
public SimpleStreamHandler(string path, IServiceAuth auth, SimpleStreamMethod processRequest)
|
||||||
: base(path, null, null)
|
: base(path)
|
||||||
{
|
{
|
||||||
m_Auth = auth;
|
m_Auth = auth;
|
||||||
m_processRequest = processRequest;
|
m_processRequest = processRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleStreamHandler(string path, IServiceAuth auth, SimpleStreamMethod processRequest, string name, string description)
|
public SimpleStreamHandler(string path, IServiceAuth auth, SimpleStreamMethod processRequest, string name)
|
||||||
: base(path, name, description)
|
: base(path, name)
|
||||||
{
|
{
|
||||||
m_Auth = auth;
|
m_Auth = auth;
|
||||||
m_processRequest = processRequest;
|
m_processRequest = processRequest;
|
||||||
|
|
|
@ -831,7 +831,7 @@ namespace OpenSim
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class SimStatusHandler : SimpleStreamHandler
|
public class SimStatusHandler : SimpleStreamHandler
|
||||||
{
|
{
|
||||||
public SimStatusHandler() : base("/simstatus", "SimStatus", "Simulator Status") {}
|
public SimStatusHandler() : base("/simstatus", "SimStatus") {}
|
||||||
|
|
||||||
protected override void ProcessRequest(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
protected override void ProcessRequest(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||||
{
|
{
|
||||||
|
@ -850,7 +850,7 @@ namespace OpenSim
|
||||||
OpenSimBase m_opensim;
|
OpenSimBase m_opensim;
|
||||||
|
|
||||||
public XSimStatusHandler(OpenSimBase sim)
|
public XSimStatusHandler(OpenSimBase sim)
|
||||||
: base("/" + Util.SHA1Hash(sim.osSecret), "XSimStatus", "Simulator XStatus")
|
: base("/" + Util.SHA1Hash(sim.osSecret), "XSimStatus")
|
||||||
{
|
{
|
||||||
m_opensim = sim;
|
m_opensim = sim;
|
||||||
}
|
}
|
||||||
|
@ -882,7 +882,7 @@ namespace OpenSim
|
||||||
OpenSimBase m_opensim;
|
OpenSimBase m_opensim;
|
||||||
|
|
||||||
public UXSimStatusHandler(OpenSimBase sim)
|
public UXSimStatusHandler(OpenSimBase sim)
|
||||||
: base("/" + sim.userStatsURI, "UXSimStatus", "Simulator UXStatus")
|
: base("/" + sim.userStatsURI, "UXSimStatus")
|
||||||
{
|
{
|
||||||
m_opensim = sim;
|
m_opensim = sim;
|
||||||
}
|
}
|
||||||
|
@ -908,7 +908,7 @@ namespace OpenSim
|
||||||
public class SimRobotsHandler : SimpleStreamHandler
|
public class SimRobotsHandler : SimpleStreamHandler
|
||||||
{
|
{
|
||||||
private readonly byte[] binmsg;
|
private readonly byte[] binmsg;
|
||||||
public SimRobotsHandler() : base("/robots.txt", "SimRobots.txt", "Simulator Robots.txt")
|
public SimRobotsHandler() : base("/robots.txt", "SimRobots")
|
||||||
{
|
{
|
||||||
binmsg = Util.UTF8.GetBytes("# go away\nUser-agent: *\nDisallow: /\n");
|
binmsg = Util.UTF8.GetBytes("# go away\nUser-agent: *\nDisallow: /\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue