mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
* Updated C# WebServer to the latest available source download (r19869) and applied a few mods from the old version (now up on opensim-libs (VS 3.5 project).
* Made various changes to BaseHttpServer to accommodate the new interfaces. * This version has been significantly re-architected and may fail in unusual and insidious ways. * Please pay attention to any errors you get and post a Mantis if you can reproduce an issue with the HTTPServer. I'm including the pdb and having the http server compiled in debug for a few weeks so that when an error occurs, it'll print the pertenant data. * Once again, this is the full C# WebServer, not the lite branch that is included in LibOMV (we need SSL!)
This commit is contained in:
@@ -46,6 +46,10 @@ namespace OpenSim.Framework.Servers.Tests
|
||||
public class TestHttpClientContext: IHttpClientContext
|
||||
{
|
||||
private bool _secured;
|
||||
public bool IsSecured
|
||||
{
|
||||
get { return _secured; }
|
||||
}
|
||||
public bool Secured
|
||||
{
|
||||
get { return _secured; }
|
||||
@@ -62,10 +66,19 @@ namespace OpenSim.Framework.Servers.Tests
|
||||
public void Respond(string body) {}
|
||||
public void Send(byte[] buffer) {}
|
||||
public void Send(byte[] buffer, int offset, int size) {}
|
||||
public void Respond(string httpVersion, HttpStatusCode statusCode, string reason, string body, string contentType) {}
|
||||
|
||||
public event EventHandler<DisconnectedEventArgs> Disconnected = delegate { };
|
||||
/// <summary>
|
||||
/// A request have been received in the context.
|
||||
/// </summary>
|
||||
public event EventHandler<RequestEventArgs> RequestReceived = delegate { };
|
||||
|
||||
}
|
||||
|
||||
public class TestHttpRequest: IHttpRequest
|
||||
{
|
||||
private string _uriPath;
|
||||
public bool BodyIsComplete
|
||||
{
|
||||
get { return true; }
|
||||
@@ -183,6 +196,24 @@ namespace OpenSim.Framework.Servers.Tests
|
||||
|
||||
return clone;
|
||||
}
|
||||
public IHttpResponse CreateResponse(IHttpClientContext context)
|
||||
{
|
||||
return new HttpResponse(context, this);
|
||||
}
|
||||
/// <summary>
|
||||
/// Path and query (will be merged with the host header) and put in Uri
|
||||
/// </summary>
|
||||
/// <see cref="Uri"/>
|
||||
public string UriPath
|
||||
{
|
||||
get { return _uriPath; }
|
||||
set
|
||||
{
|
||||
_uriPath = value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class TestHttpResponse: IHttpResponse
|
||||
|
||||
Reference in New Issue
Block a user