Implement IOSHttpRequest and IOSHttpResponse http interfaces and use instead of OSHttpRequest/OSHttpResponse.

This is required for the substitution of different HTTP servers or the newer HttpServer.dll without having to commit to a particular implementation.
This is also required to write regression tests that involve the HTTP layer.
If you need to recompile, all you need to do is replace OSHttpRequest/OSHttpResponse references with IOSHttpRequest/IOSHttpResponse.
This commit is contained in:
Justin Clark-Casey (justincc)
2011-12-05 20:44:20 +00:00
parent 37889eb3fa
commit 4567555c49
56 changed files with 383 additions and 103 deletions

View File

@@ -54,8 +54,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
m_FriendsModule = fmodule;
}
public override byte[] Handle(string path, Stream requestData,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
public override byte[] Handle(
string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
StreamReader sr = new StreamReader(requestData);
string body = sr.ReadToEnd();

View File

@@ -1421,7 +1421,7 @@ namespace OpenSim.Region.CoreModules.World.Land
caps.RegisterHandler("RemoteParcelRequest",
new RestStreamHandler("POST", capsBase + remoteParcelRequestPath,
delegate(string request, string path, string param,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return RemoteParcelRequest(request, path, param, agentID, caps);
}));
@@ -1429,7 +1429,7 @@ namespace OpenSim.Region.CoreModules.World.Land
caps.RegisterHandler("ParcelPropertiesUpdate",
new RestStreamHandler("POST", "/CAPS/" + parcelCapID,
delegate(string request, string path, string param,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return ProcessPropertiesUpdate(request, path, param, agentID, caps);
}));

View File

@@ -293,7 +293,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
/// <param name="httpResponse"></param>
/// <returns></returns>
protected string HandleObjectMediaMessage(
string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
// m_log.DebugFormat("[MOAP]: Got ObjectMedia path [{0}], raw request [{1}]", path, request);
@@ -474,7 +474,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
/// <param name="httpResponse">/param>
/// <returns></returns>
protected string HandleObjectMediaNavigateMessage(
string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
// m_log.DebugFormat("[MOAP]: Got ObjectMediaNavigate request [{0}]", request);

View File

@@ -193,7 +193,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
caps.RegisterHandler("MapLayer",
new RestStreamHandler("POST", capsBase + m_mapLayerPath,
delegate(string request, string path, string param,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return MapLayerRequest(request, path, param,
agentID, caps);