From 4567555c49cb560dd6f109bbfec42086af3de56f Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 5 Dec 2011 20:44:20 +0000
Subject: 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.
---
OpenSim/Region/Application/OpenSimBase.cs | 6 +++---
OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 6 +++---
OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs | 4 ++--
OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 4 ++--
OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | 4 ++--
OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 2 +-
OpenSim/Region/DataSnapshot/DataRequestHandler.cs | 2 +-
OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs | 2 +-
.../Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 6 +++---
.../OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | 6 +++---
.../OptionalModules/World/WorldView/WorldViewRequestHandler.cs | 2 +-
OpenSim/Region/UserStatistics/WebStatsModule.cs | 2 +-
12 files changed, 23 insertions(+), 23 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 0a78df2..bae44ee 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -718,7 +718,7 @@ namespace OpenSim
public class SimStatusHandler : IStreamedRequestHandler
{
public byte[] Handle(string path, Stream request,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return Util.UTF8.GetBytes("OK");
}
@@ -755,7 +755,7 @@ namespace OpenSim
}
public byte[] Handle(string path, Stream request,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest));
}
@@ -796,7 +796,7 @@ namespace OpenSim
}
public byte[] Handle(string path, Stream request,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest));
}
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 98dda36..2347cf2 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -223,7 +223,7 @@ namespace OpenSim.Region.ClientStack.Linden
/// HTTP response header object
///
public string SeedCapRequest(string request, string path, string param,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
// m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
@@ -256,7 +256,7 @@ namespace OpenSim.Region.ClientStack.Linden
/// HTTP response header object
///
public string ScriptTaskInventory(string request, string path, string param,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
try
{
@@ -685,7 +685,7 @@ namespace OpenSim.Region.ClientStack.Linden
///
///
public string NoteCardAgentInventory(string request, string path, string param,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
//m_log.Debug("[CAPS]: NoteCardAgentInventory Request in region: " + m_regionName + "\n" + request);
//m_log.Debug("[CAPS]: NoteCardAgentInventory Request is: " + request);
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs
index 1b53a42..637beef 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs
@@ -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();
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 2117827..94bba83 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -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);
}));
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
index 898ca4a..5239f50 100644
--- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
+++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
@@ -293,7 +293,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
///
///
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>
///
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);
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 95c727f..9b0e2ff 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -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);
diff --git a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs
index a505999..b760454 100644
--- a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs
+++ b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs
@@ -74,7 +74,7 @@ namespace OpenSim.Region.DataSnapshot
}
public string OnDiscoveryAttempt(string request, string path, string param,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
//Very static for now, flexible enough to add new formats
LLSDDiscoveryResponse llsd_response = new LLSDDiscoveryResponse();
diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
index 4578236..6c5685c 100644
--- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
+++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Scenes
osXStatsURI = Util.SHA1Hash(regionInfo.osSecret);
}
- public byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ public byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return Util.UTF8.GetBytes(Report());
}
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index a5bba4f..5323a95 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -309,7 +309,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
caps.RegisterHandler("ProvisionVoiceAccountRequest",
new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath,
delegate(string request, string path, string param,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return ProvisionVoiceAccountRequest(scene, request, path, param,
agentID, caps);
@@ -317,7 +317,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
caps.RegisterHandler("ParcelVoiceInfoRequest",
new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath,
delegate(string request, string path, string param,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return ParcelVoiceInfoRequest(scene, request, path, param,
agentID, caps);
@@ -325,7 +325,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
caps.RegisterHandler("ChatSessionRequest",
new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath,
delegate(string request, string path, string param,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return ChatSessionRequest(scene, request, path, param,
agentID, caps);
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
index 534bf92..70e2f7e 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
@@ -421,7 +421,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
caps.RegisterHandler("ProvisionVoiceAccountRequest",
new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath,
delegate(string request, string path, string param,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return ProvisionVoiceAccountRequest(scene, request, path, param,
agentID, caps);
@@ -429,7 +429,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
caps.RegisterHandler("ParcelVoiceInfoRequest",
new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath,
delegate(string request, string path, string param,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return ParcelVoiceInfoRequest(scene, request, path, param,
agentID, caps);
@@ -437,7 +437,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
caps.RegisterHandler("ChatSessionRequest",
new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath,
delegate(string request, string path, string param,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return ChatSessionRequest(scene, request, path, param,
agentID, caps);
diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs
index f47d9c7..550b5d4 100644
--- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs
+++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView
}
public override byte[] Handle(string path, Stream requestData,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
httpResponse.ContentType = "image/jpeg";
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index 0251ee8..fca9fd0 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -306,7 +306,7 @@ namespace OpenSim.Region.UserStatistics
caps.RegisterHandler("ViewerStats",
new RestStreamHandler("POST", capsPath,
delegate(string request, string path, string param,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
+ IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return ViewerStatsReport(request, path, param,
agentID, caps);
--
cgit v1.1