aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseHttpServer.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-03-10 18:22:46 +0000
committerJustin Clarke Casey2009-03-10 18:22:46 +0000
commitdd28d6ceebdcf7f1c441f4b143d106deb449d5d2 (patch)
tree5f57e4fe50c13f97d0df8d514b588faeaf858a70 /OpenSim/Framework/Servers/BaseHttpServer.cs
parent* Enable test logging for TestSaveOarV0p2 to capture more information the nex... (diff)
downloadopensim-SC-dd28d6ceebdcf7f1c441f4b143d106deb449d5d2.zip
opensim-SC-dd28d6ceebdcf7f1c441f4b143d106deb449d5d2.tar.gz
opensim-SC-dd28d6ceebdcf7f1c441f4b143d106deb449d5d2.tar.bz2
opensim-SC-dd28d6ceebdcf7f1c441f4b143d106deb449d5d2.tar.xz
* minor: reduce some code duplication in BaseHttpServer
Diffstat (limited to 'OpenSim/Framework/Servers/BaseHttpServer.cs')
-rw-r--r--OpenSim/Framework/Servers/BaseHttpServer.cs41
1 files changed, 17 insertions, 24 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs
index 617dcae..16bfbd8 100644
--- a/OpenSim/Framework/Servers/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/BaseHttpServer.cs
@@ -94,17 +94,13 @@ namespace OpenSim.Framework.Servers
94 m_port = port; 94 m_port = port;
95 } 95 }
96 96
97 public BaseHttpServer(uint port, bool ssl) 97 public BaseHttpServer(uint port, bool ssl) : this (port)
98 { 98 {
99 m_ssl = ssl; 99 m_ssl = ssl;
100 m_port = port;
101 } 100 }
102 101
103 public BaseHttpServer(uint port, bool ssl, uint sslport, string CN) 102 public BaseHttpServer(uint port, bool ssl, uint sslport, string CN) : this (port, ssl)
104 { 103 {
105 m_ssl = ssl;
106 m_port = port;
107
108 if (m_ssl) 104 if (m_ssl)
109 { 105 {
110 m_sslport = sslport; 106 m_sslport = sslport;
@@ -139,12 +135,7 @@ namespace OpenSim.Framework.Servers
139 135
140 public bool AddXmlRPCHandler(string method, XmlRpcMethod handler) 136 public bool AddXmlRPCHandler(string method, XmlRpcMethod handler)
141 { 137 {
142 lock (m_rpcHandlers) 138 return AddXmlRPCHandler(method, handler, true);
143 {
144 m_rpcHandlers[method] = handler;
145 m_rpcHandlersKeepAlive[method] = true; // default
146 return true;
147 }
148 } 139 }
149 140
150 public bool AddXmlRPCHandler(string method, XmlRpcMethod handler, bool keepAlive) 141 public bool AddXmlRPCHandler(string method, XmlRpcMethod handler, bool keepAlive)
@@ -152,9 +143,10 @@ namespace OpenSim.Framework.Servers
152 lock (m_rpcHandlers) 143 lock (m_rpcHandlers)
153 { 144 {
154 m_rpcHandlers[method] = handler; 145 m_rpcHandlers[method] = handler;
155 m_rpcHandlersKeepAlive[method] = keepAlive; // default 146 m_rpcHandlersKeepAlive[method] = keepAlive; // default
156 return true;
157 } 147 }
148
149 return true;
158 } 150 }
159 151
160 /// <summary> 152 /// <summary>
@@ -1076,7 +1068,6 @@ namespace OpenSim.Framework.Servers
1076 // to display the form, or process it. 1068 // to display the form, or process it.
1077 // a better way would be nifty. 1069 // a better way would be nifty.
1078 1070
1079
1080 Stream requestStream = request.InputStream; 1071 Stream requestStream = request.InputStream;
1081 1072
1082 Encoding encoding = Encoding.UTF8; 1073 Encoding encoding = Encoding.UTF8;
@@ -1453,8 +1444,7 @@ namespace OpenSim.Framework.Servers
1453 } 1444 }
1454 1445
1455 public void httpServerException(object source, Exception exception) 1446 public void httpServerException(object source, Exception exception)
1456 { 1447 {
1457
1458 m_log.ErrorFormat("[HTTPSERVER]: {0} had an exception {1}", source.ToString(), exception.ToString()); 1448 m_log.ErrorFormat("[HTTPSERVER]: {0} had an exception {1}", source.ToString(), exception.ToString());
1459 /* 1449 /*
1460 if (HTTPDRunning)// && NotSocketErrors > 5) 1450 if (HTTPDRunning)// && NotSocketErrors > 5)
@@ -1495,12 +1485,16 @@ namespace OpenSim.Framework.Servers
1495 m_HTTPHandlers.Remove(path); 1485 m_HTTPHandlers.Remove(path);
1496 return; 1486 return;
1497 } 1487 }
1488
1498 m_HTTPHandlers.Remove(GetHandlerKey(httpMethod, path)); 1489 m_HTTPHandlers.Remove(GetHandlerKey(httpMethod, path));
1499 } 1490 }
1500 1491
1501 // Remove the agent IF it is registered. Intercept the possible 1492 /// <summary>
1502 // exception. 1493 /// Remove the agent IF it is registered. Intercept the possible exception.
1503 1494 /// </summary>
1495 /// <param name="agent"></param>
1496 /// <param name="handler"></param>
1497 /// <returns></returns>
1504 public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler) 1498 public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler)
1505 { 1499 {
1506 try 1500 try
@@ -1517,6 +1511,7 @@ namespace OpenSim.Framework.Servers
1517 1511
1518 return false; 1512 return false;
1519 } 1513 }
1514
1520 public bool RemoveLLSDHandler(string path, LLSDMethod handler) 1515 public bool RemoveLLSDHandler(string path, LLSDMethod handler)
1521 { 1516 {
1522 1517
@@ -1536,7 +1531,6 @@ namespace OpenSim.Framework.Servers
1536 return false; 1531 return false;
1537 } 1532 }
1538 1533
1539
1540 public string GetHTTP404(string host) 1534 public string GetHTTP404(string host)
1541 { 1535 {
1542 string file = Path.Combine(Util.configDir(), "http_404.html"); 1536 string file = Path.Combine(Util.configDir(), "http_404.html");
@@ -1628,6 +1622,5 @@ namespace OpenSim.Framework.Servers
1628 1622
1629 return; 1623 return;
1630 } 1624 }
1631
1632 } 1625 }
1633} 1626} \ No newline at end of file