aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs
diff options
context:
space:
mode:
authorDiva Canto2011-12-04 10:10:09 -0800
committerDiva Canto2011-12-04 10:10:09 -0800
commita2d98c72930594da2cd8056adf1e2be942051843 (patch)
treeb622e99dbb9e481565c3fdda7b3f86f3bdf2e0f2 /OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs
parentHG: Renamed one method (diff)
downloadopensim-SC-a2d98c72930594da2cd8056adf1e2be942051843.zip
opensim-SC-a2d98c72930594da2cd8056adf1e2be942051843.tar.gz
opensim-SC-a2d98c72930594da2cd8056adf1e2be942051843.tar.bz2
opensim-SC-a2d98c72930594da2cd8056adf1e2be942051843.tar.xz
HG: Added HEAD method to Helo service. This is the preferred method, but its wide use will have to wait a few releases. So the sims are still calling GET for now.
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs34
1 files changed, 33 insertions, 1 deletions
diff --git a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs
index 39baa32..4accea1 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs
@@ -45,9 +45,11 @@ namespace OpenSim.Server.Handlers.Hypergrid
45 base(config, server, configName) 45 base(config, server, configName)
46 { 46 {
47 server.AddStreamHandler(new HeloServerGetHandler("opensim-robust")); 47 server.AddStreamHandler(new HeloServerGetHandler("opensim-robust"));
48 server.AddStreamHandler(new HeloServerHeadHandler("opensim-robust"));
48 } 49 }
49 } 50 }
50 51
52 [Obsolete]
51 public class HeloServerGetHandler : BaseStreamHandler 53 public class HeloServerGetHandler : BaseStreamHandler
52 { 54 {
53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 55 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -68,7 +70,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
68 70
69 private byte[] OKResponse(OSHttpResponse httpResponse) 71 private byte[] OKResponse(OSHttpResponse httpResponse)
70 { 72 {
71 m_log.Debug("[HELO]: hi, I was called"); 73 m_log.Debug("[HELO]: hi, GET was called");
72 httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType); 74 httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType);
73 httpResponse.StatusCode = (int)HttpStatusCode.OK; 75 httpResponse.StatusCode = (int)HttpStatusCode.OK;
74 httpResponse.StatusDescription = "OK"; 76 httpResponse.StatusDescription = "OK";
@@ -76,4 +78,34 @@ namespace OpenSim.Server.Handlers.Hypergrid
76 } 78 }
77 79
78 } 80 }
81
82 public class HeloServerHeadHandler : BaseStreamHandler
83 {
84 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
85
86 private string m_HandlersType;
87
88 public HeloServerHeadHandler(string handlersType) :
89 base("HEAD", "/helo")
90 {
91 m_HandlersType = handlersType;
92 }
93
94 public override byte[] Handle(string path, Stream requestData,
95 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
96 {
97 return OKResponse(httpResponse);
98 }
99
100 private byte[] OKResponse(OSHttpResponse httpResponse)
101 {
102 m_log.Debug("[HELO]: hi, HEAD was called");
103 httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType);
104 httpResponse.StatusCode = (int)HttpStatusCode.OK;
105 httpResponse.StatusDescription = "OK";
106 return new byte[0];
107 }
108
109 }
110
79} 111}