diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Capabilities/CapsHandlers.cs | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/OpenSim/Capabilities/CapsHandlers.cs b/OpenSim/Capabilities/CapsHandlers.cs index 890df90..f5a40df 100644 --- a/OpenSim/Capabilities/CapsHandlers.cs +++ b/OpenSim/Capabilities/CapsHandlers.cs | |||
@@ -53,31 +53,15 @@ namespace OpenSim.Framework.Capabilities | |||
53 | /// <param name="httpListener">base HTTP server</param> | 53 | /// <param name="httpListener">base HTTP server</param> |
54 | /// <param name="httpListenerHostname">host name of the HTTP server</param> | 54 | /// <param name="httpListenerHostname">host name of the HTTP server</param> |
55 | /// <param name="httpListenerPort">HTTP port</param> | 55 | /// <param name="httpListenerPort">HTTP port</param> |
56 | public CapsHandlers(BaseHttpServer httpListener, string httpListenerHostname, uint httpListenerPort) | 56 | public CapsHandlers(IHttpServer httpListener, string httpListenerHostname, uint httpListenerPort) |
57 | : this(httpListener,httpListenerHostname,httpListenerPort, false) | 57 | { |
58 | { | ||
59 | } | ||
60 | |||
61 | /// <summary></summary> | ||
62 | /// CapsHandlers is a cap handler container but also takes | ||
63 | /// care of adding and removing cap handlers to and from the | ||
64 | /// supplied BaseHttpServer. | ||
65 | /// </summary> | ||
66 | /// <param name="httpListener">base HTTP server</param> | ||
67 | /// <param name="httpListenerHostname">host name of the HTTP | ||
68 | /// server</param> | ||
69 | /// <param name="httpListenerPort">HTTP port</param> | ||
70 | public CapsHandlers(IHttpServer httpListener, string httpListenerHostname, uint httpListenerPort, bool https) | ||
71 | { | ||
72 | m_httpListener = httpListener; | 58 | m_httpListener = httpListener; |
73 | m_httpListenerHostName = httpListenerHostname; | 59 | m_httpListenerHostName = httpListenerHostname; |
74 | m_httpListenerPort = httpListenerPort; | 60 | m_httpListenerPort = httpListenerPort; |
75 | m_useSSL = https; | 61 | if (httpListener != null && httpListener.UseSSL) |
76 | if (httpListener != null && m_useSSL) | 62 | m_useSSL = true; |
77 | { | 63 | else |
78 | m_httpListenerHostName = httpListener.SSLCommonName; | 64 | m_useSSL = false; |
79 | m_httpListenerPort = httpListener.SSLPort; | ||
80 | } | ||
81 | } | 65 | } |
82 | 66 | ||
83 | /// <summary> | 67 | /// <summary> |
@@ -90,6 +74,7 @@ namespace OpenSim.Framework.Capabilities | |||
90 | lock (m_capsHandlers) | 74 | lock (m_capsHandlers) |
91 | { | 75 | { |
92 | m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[capsName].Path); | 76 | m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[capsName].Path); |
77 | m_httpListener.RemoveStreamHandler("PUT", m_capsHandlers[capsName].Path); | ||
93 | m_httpListener.RemoveStreamHandler("GET", m_capsHandlers[capsName].Path); | 78 | m_httpListener.RemoveStreamHandler("GET", m_capsHandlers[capsName].Path); |
94 | m_capsHandlers.Remove(capsName); | 79 | m_capsHandlers.Remove(capsName); |
95 | } | 80 | } |
@@ -127,9 +112,9 @@ namespace OpenSim.Framework.Capabilities | |||
127 | m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[idx].Path); | 112 | m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[idx].Path); |
128 | m_capsHandlers.Remove(idx); | 113 | m_capsHandlers.Remove(idx); |
129 | } | 114 | } |
130 | 115 | ||
131 | if (null == value) return; | 116 | if (null == value) return; |
132 | 117 | ||
133 | m_capsHandlers[idx] = value; | 118 | m_capsHandlers[idx] = value; |
134 | m_httpListener.AddStreamHandler(value); | 119 | m_httpListener.AddStreamHandler(value); |
135 | } | 120 | } |
@@ -162,7 +147,7 @@ namespace OpenSim.Framework.Capabilities | |||
162 | { | 147 | { |
163 | Hashtable caps = new Hashtable(); | 148 | Hashtable caps = new Hashtable(); |
164 | string protocol = "http://"; | 149 | string protocol = "http://"; |
165 | 150 | ||
166 | if (m_useSSL) | 151 | if (m_useSSL) |
167 | protocol = "https://"; | 152 | protocol = "https://"; |
168 | 153 | ||