aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs146
-rw-r--r--OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs22
-rw-r--r--OpenSim/Framework/Servers/MainServer.cs6
3 files changed, 87 insertions, 87 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 05c2d53..8c29ad4 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -82,7 +82,7 @@ namespace OpenSim.Framework.Servers.HttpServer
82 protected Dictionary<string, LLSDMethod> m_llsdHandlers = new Dictionary<string, LLSDMethod>(); 82 protected Dictionary<string, LLSDMethod> m_llsdHandlers = new Dictionary<string, LLSDMethod>();
83 protected Dictionary<string, IRequestHandler> m_streamHandlers = new Dictionary<string, IRequestHandler>(); 83 protected Dictionary<string, IRequestHandler> m_streamHandlers = new Dictionary<string, IRequestHandler>();
84 protected Dictionary<string, GenericHTTPMethod> m_HTTPHandlers = new Dictionary<string, GenericHTTPMethod>(); 84 protected Dictionary<string, GenericHTTPMethod> m_HTTPHandlers = new Dictionary<string, GenericHTTPMethod>();
85 protected Dictionary<string, IHttpAgentHandler> m_agentHandlers = new Dictionary<string, IHttpAgentHandler>(); 85// protected Dictionary<string, IHttpAgentHandler> m_agentHandlers = new Dictionary<string, IHttpAgentHandler>();
86 protected Dictionary<string, PollServiceEventArgs> m_pollHandlers = 86 protected Dictionary<string, PollServiceEventArgs> m_pollHandlers =
87 new Dictionary<string, PollServiceEventArgs>(); 87 new Dictionary<string, PollServiceEventArgs>();
88 88
@@ -260,29 +260,29 @@ namespace OpenSim.Framework.Servers.HttpServer
260 return new List<string>(m_pollHandlers.Keys); 260 return new List<string>(m_pollHandlers.Keys);
261 } 261 }
262 262
263 // Note that the agent string is provided simply to differentiate 263// // Note that the agent string is provided simply to differentiate
264 // the handlers - it is NOT required to be an actual agent header 264// // the handlers - it is NOT required to be an actual agent header
265 // value. 265// // value.
266 public bool AddAgentHandler(string agent, IHttpAgentHandler handler) 266// public bool AddAgentHandler(string agent, IHttpAgentHandler handler)
267 { 267// {
268 lock (m_agentHandlers) 268// lock (m_agentHandlers)
269 { 269// {
270 if (!m_agentHandlers.ContainsKey(agent)) 270// if (!m_agentHandlers.ContainsKey(agent))
271 { 271// {
272 m_agentHandlers.Add(agent, handler); 272// m_agentHandlers.Add(agent, handler);
273 return true; 273// return true;
274 } 274// }
275 } 275// }
276 276//
277 //must already have a handler for that path so return false 277// //must already have a handler for that path so return false
278 return false; 278// return false;
279 } 279// }
280 280//
281 public List<string> GetAgentHandlerKeys() 281// public List<string> GetAgentHandlerKeys()
282 { 282// {
283 lock (m_agentHandlers) 283// lock (m_agentHandlers)
284 return new List<string>(m_agentHandlers.Keys); 284// return new List<string>(m_agentHandlers.Keys);
285 } 285// }
286 286
287 public bool AddLLSDHandler(string path, LLSDMethod handler) 287 public bool AddLLSDHandler(string path, LLSDMethod handler)
288 { 288 {
@@ -438,22 +438,22 @@ namespace OpenSim.Framework.Servers.HttpServer
438 438
439 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); 439 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true);
440 440
441 // This is the REST agent interface. We require an agent to properly identify 441// // This is the REST agent interface. We require an agent to properly identify
442 // itself. If the REST handler recognizes the prefix it will attempt to 442// // itself. If the REST handler recognizes the prefix it will attempt to
443 // satisfy the request. If it is not recognizable, and no damage has occurred 443// // satisfy the request. If it is not recognizable, and no damage has occurred
444 // the request can be passed through to the other handlers. This is a low 444// // the request can be passed through to the other handlers. This is a low
445 // probability event; if a request is matched it is normally expected to be 445// // probability event; if a request is matched it is normally expected to be
446 // handled 446// // handled
447 IHttpAgentHandler agentHandler; 447// IHttpAgentHandler agentHandler;
448 448//
449 if (TryGetAgentHandler(request, response, out agentHandler)) 449// if (TryGetAgentHandler(request, response, out agentHandler))
450 { 450// {
451 if (HandleAgentRequest(agentHandler, request, response)) 451// if (HandleAgentRequest(agentHandler, request, response))
452 { 452// {
453 requestEndTick = Environment.TickCount; 453// requestEndTick = Environment.TickCount;
454 return; 454// return;
455 } 455// }
456 } 456// }
457 457
458 //response.KeepAlive = true; 458 //response.KeepAlive = true;
459 response.SendChunked = false; 459 response.SendChunked = false;
@@ -830,24 +830,24 @@ namespace OpenSim.Framework.Servers.HttpServer
830 } 830 }
831 } 831 }
832 832
833 private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler) 833// private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler)
834 { 834// {
835 agentHandler = null; 835// agentHandler = null;
836 836//
837 lock (m_agentHandlers) 837// lock (m_agentHandlers)
838 { 838// {
839 foreach (IHttpAgentHandler handler in m_agentHandlers.Values) 839// foreach (IHttpAgentHandler handler in m_agentHandlers.Values)
840 { 840// {
841 if (handler.Match(request, response)) 841// if (handler.Match(request, response))
842 { 842// {
843 agentHandler = handler; 843// agentHandler = handler;
844 return true; 844// return true;
845 } 845// }
846 } 846// }
847 } 847// }
848 848//
849 return false; 849// return false;
850 } 850// }
851 851
852 /// <summary> 852 /// <summary>
853 /// Try all the registered xmlrpc handlers when an xmlrpc request is received. 853 /// Try all the registered xmlrpc handlers when an xmlrpc request is received.
@@ -1772,21 +1772,21 @@ namespace OpenSim.Framework.Servers.HttpServer
1772 m_pollHandlers.Remove(path); 1772 m_pollHandlers.Remove(path);
1773 } 1773 }
1774 1774
1775 public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler) 1775// public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler)
1776 { 1776// {
1777 lock (m_agentHandlers) 1777// lock (m_agentHandlers)
1778 { 1778// {
1779 IHttpAgentHandler foundHandler; 1779// IHttpAgentHandler foundHandler;
1780 1780//
1781 if (m_agentHandlers.TryGetValue(agent, out foundHandler) && foundHandler == handler) 1781// if (m_agentHandlers.TryGetValue(agent, out foundHandler) && foundHandler == handler)
1782 { 1782// {
1783 m_agentHandlers.Remove(agent); 1783// m_agentHandlers.Remove(agent);
1784 return true; 1784// return true;
1785 } 1785// }
1786 } 1786// }
1787 1787//
1788 return false; 1788// return false;
1789 } 1789// }
1790 1790
1791 public void RemoveXmlRPCHandler(string method) 1791 public void RemoveXmlRPCHandler(string method)
1792 { 1792 {
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs
index db58f6f..0bd3aae 100644
--- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs
@@ -41,10 +41,10 @@ namespace OpenSim.Framework.Servers.HttpServer
41 uint Port { get; } 41 uint Port { get; }
42 bool UseSSL { get; } 42 bool UseSSL { get; }
43 43
44 // Note that the agent string is provided simply to differentiate 44// // Note that the agent string is provided simply to differentiate
45 // the handlers - it is NOT required to be an actual agent header 45// // the handlers - it is NOT required to be an actual agent header
46 // value. 46// // value.
47 bool AddAgentHandler(string agent, IHttpAgentHandler handler); 47// bool AddAgentHandler(string agent, IHttpAgentHandler handler);
48 48
49 /// <summary> 49 /// <summary>
50 /// Add a handler for an HTTP request. 50 /// Add a handler for an HTTP request.
@@ -106,13 +106,13 @@ namespace OpenSim.Framework.Servers.HttpServer
106 106
107 bool SetDefaultLLSDHandler(DefaultLLSDMethod handler); 107 bool SetDefaultLLSDHandler(DefaultLLSDMethod handler);
108 108
109 /// <summary> 109// /// <summary>
110 /// Remove the agent if it is registered. 110// /// Remove the agent if it is registered.
111 /// </summary> 111// /// </summary>
112 /// <param name="agent"></param> 112// /// <param name="agent"></param>
113 /// <param name="handler"></param> 113// /// <param name="handler"></param>
114 /// <returns></returns> 114// /// <returns></returns>
115 bool RemoveAgentHandler(string agent, IHttpAgentHandler handler); 115// bool RemoveAgentHandler(string agent, IHttpAgentHandler handler);
116 116
117 /// <summary> 117 /// <summary>
118 /// Remove an HTTP handler 118 /// Remove an HTTP handler
diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs
index 72f9cce..4b61b18 100644
--- a/OpenSim/Framework/Servers/MainServer.cs
+++ b/OpenSim/Framework/Servers/MainServer.cs
@@ -231,9 +231,9 @@ namespace OpenSim.Framework.Servers
231 foreach (String s in httpServer.GetHTTPHandlerKeys()) 231 foreach (String s in httpServer.GetHTTPHandlerKeys())
232 handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty)); 232 handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty));
233 233
234 handlers.AppendFormat("* Agent:\n"); 234// handlers.AppendFormat("* Agent:\n");
235 foreach (String s in httpServer.GetAgentHandlerKeys()) 235// foreach (String s in httpServer.GetAgentHandlerKeys())
236 handlers.AppendFormat("\t{0}\n", s); 236// handlers.AppendFormat("\t{0}\n", s);
237 237
238 handlers.AppendFormat("* LLSD:\n"); 238 handlers.AppendFormat("* LLSD:\n");
239 foreach (String s in httpServer.GetLLSDHandlerKeys()) 239 foreach (String s in httpServer.GetLLSDHandlerKeys())