diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/ApplicationPlugins/Rest/RestPlugin.cs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs index 0e54f4d..05ea956 100644 --- a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs +++ b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs | |||
@@ -23,7 +23,7 @@ | |||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | 29 | using System; |
@@ -54,7 +54,7 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
54 | { | 54 | { |
55 | #region properties | 55 | #region properties |
56 | 56 | ||
57 | protected static readonly log4net.ILog m_log = | 57 | protected static readonly log4net.ILog m_log = |
58 | log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 58 | log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
59 | 59 | ||
60 | private IConfig _config; // Configuration source: Rest Plugins | 60 | private IConfig _config; // Configuration source: Rest Plugins |
@@ -100,8 +100,8 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
100 | /// </summary> | 100 | /// </summary> |
101 | public bool IsEnabled | 101 | public bool IsEnabled |
102 | { | 102 | { |
103 | get | 103 | get |
104 | { | 104 | { |
105 | return (null != _pluginConfig) && _pluginConfig.GetBoolean("enabled", false); | 105 | return (null != _pluginConfig) && _pluginConfig.GetBoolean("enabled", false); |
106 | } | 106 | } |
107 | } | 107 | } |
@@ -109,7 +109,7 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
109 | /// <summary> | 109 | /// <summary> |
110 | /// OpenSimMain application | 110 | /// OpenSimMain application |
111 | /// </summary> | 111 | /// </summary> |
112 | public OpenSimMain App | 112 | public OpenSimMain App |
113 | { | 113 | { |
114 | get { return _app; } | 114 | get { return _app; } |
115 | } | 115 | } |
@@ -117,7 +117,7 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
117 | /// <summary> | 117 | /// <summary> |
118 | /// RPC server | 118 | /// RPC server |
119 | /// </summary> | 119 | /// </summary> |
120 | public BaseHttpServer HttpServer | 120 | public BaseHttpServer HttpServer |
121 | { | 121 | { |
122 | get { return _httpd; } | 122 | get { return _httpd; } |
123 | } | 123 | } |
@@ -171,7 +171,7 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
171 | return; | 171 | return; |
172 | } | 172 | } |
173 | 173 | ||
174 | if (!_config.GetBoolean("enabled", false)) | 174 | if (!_config.GetBoolean("enabled", false)) |
175 | { | 175 | { |
176 | m_log.WarnFormat("{0} Rest Plugins are disabled", MsgID); | 176 | m_log.WarnFormat("{0} Rest Plugins are disabled", MsgID); |
177 | return; | 177 | return; |
@@ -184,10 +184,10 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
184 | _godkey = _config.GetString("god_key", String.Empty); | 184 | _godkey = _config.GetString("god_key", String.Empty); |
185 | // Retrive prefix if any. | 185 | // Retrive prefix if any. |
186 | _prefix = _config.GetString("prefix", "/admin"); | 186 | _prefix = _config.GetString("prefix", "/admin"); |
187 | 187 | ||
188 | // Get plugin specific config | 188 | // Get plugin specific config |
189 | _pluginConfig = openSim.ConfigSource.Configs[ConfigName]; | 189 | _pluginConfig = openSim.ConfigSource.Configs[ConfigName]; |
190 | 190 | ||
191 | m_log.InfoFormat("{0} Rest Plugins Enabled", MsgID); | 191 | m_log.InfoFormat("{0} Rest Plugins Enabled", MsgID); |
192 | } | 192 | } |
193 | catch (Exception e) | 193 | catch (Exception e) |
@@ -200,7 +200,7 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
200 | // not possible for the openSim pointer to be null. However | 200 | // not possible for the openSim pointer to be null. However |
201 | // were the implementation to be changed, this could | 201 | // were the implementation to be changed, this could |
202 | // result in a silent initialization failure. Harmless | 202 | // result in a silent initialization failure. Harmless |
203 | // except for lack of function and lack of any | 203 | // except for lack of function and lack of any |
204 | // diagnostic indication as to why. The same is true if | 204 | // diagnostic indication as to why. The same is true if |
205 | // the HTTP server reference is bad. | 205 | // the HTTP server reference is bad. |
206 | // We should at least issue a message... | 206 | // We should at least issue a message... |
@@ -214,7 +214,7 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
214 | 214 | ||
215 | public void AddRestStreamHandler(string httpMethod, string path, RestMethod method) | 215 | public void AddRestStreamHandler(string httpMethod, string path, RestMethod method) |
216 | { | 216 | { |
217 | if (!path.StartsWith(_prefix)) | 217 | if (!path.StartsWith(_prefix)) |
218 | { | 218 | { |
219 | path = String.Format("{0}{1}", _prefix, path); | 219 | path = String.Format("{0}{1}", _prefix, path); |
220 | } | 220 | } |
@@ -226,7 +226,7 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
226 | m_log.DebugFormat("{0} Added REST handler {1} {2}", MsgID, httpMethod, path); | 226 | m_log.DebugFormat("{0} Added REST handler {1} {2}", MsgID, httpMethod, path); |
227 | } | 227 | } |
228 | 228 | ||
229 | 229 | ||
230 | public bool VerifyGod(string key) | 230 | public bool VerifyGod(string key) |
231 | { | 231 | { |
232 | if (String.IsNullOrEmpty(key)) return false; | 232 | if (String.IsNullOrEmpty(key)) return false; |