From 6ef9d4da901a346c232458317cca6268da888e2e Mon Sep 17 00:00:00 2001
From: Jeff Ames
Date: Mon, 18 Aug 2008 00:39:10 +0000
Subject: Formatting cleanup.
---
OpenSim/Framework/Servers/BaseHttpServer.cs | 4 +-
OpenSim/Framework/Servers/BaseOpenSimServer.cs | 46 +++++++--------
OpenSim/Framework/Servers/OSHttpHandler.cs | 16 ++---
OpenSim/Framework/Servers/OSHttpHttpHandler.cs | 10 ++--
OpenSim/Framework/Servers/OSHttpRequest.cs | 22 -------
OpenSim/Framework/Servers/OSHttpRequestPump.cs | 39 ++++++-------
OpenSim/Framework/Servers/OSHttpRequestQueue.cs | 6 +-
OpenSim/Framework/Servers/OSHttpResponse.cs | 74 ++++++++++++------------
OpenSim/Framework/Servers/OSHttpServer.cs | 8 +--
OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs | 28 ++++-----
OpenSim/Framework/Servers/RestSessionService.cs | 4 +-
11 files changed, 117 insertions(+), 140 deletions(-)
(limited to 'OpenSim/Framework/Servers')
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs
index 952fb31..c3bd085 100644
--- a/OpenSim/Framework/Servers/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/BaseHttpServer.cs
@@ -172,7 +172,7 @@ namespace OpenSim.Framework.Servers
OSHttpResponse response = new OSHttpResponse(context.Response);
// This is the REST agent interface. We require an agent to properly identify
- // itself. If the REST handler recognizes the prefix it will attempt to
+ // itself. If the REST handler recognizes the prefix it will attempt to
// satisfy the request. If it is not recognizable, and no damage has occurred
// the request can be passed through to the other handlers. This is a low
// probability event; if a request is matched it is normally expected to be
@@ -650,7 +650,7 @@ namespace OpenSim.Framework.Servers
}
response.AddHeader("Content-type", contentType);
-
+
byte[] buffer;
if (!contentType.Contains("image"))
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index e901b68..33081b9 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -89,7 +89,7 @@ namespace OpenSim.Framework.Servers
m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics);
m_periodicDiagnosticsTimer.Enabled = true;
-
+
// Add ourselves to thread monitoring. This thread will go on to become the console listening thread
Thread.CurrentThread.Name = "ConsoleThread";
ThreadTracker.Add(Thread.CurrentThread);
@@ -102,15 +102,15 @@ namespace OpenSim.Framework.Servers
{
StringBuilder sb = new StringBuilder("DIAGNOSTICS\n\n");
sb.Append(GetUptimeReport());
-
+
if (m_stats != null)
{
sb.Append(m_stats.Report());
}
-
+
m_log.Debug(sb);
}
-
+
///
/// Return a report about the uptime of this server
///
@@ -120,10 +120,10 @@ namespace OpenSim.Framework.Servers
StringBuilder sb = new StringBuilder(String.Format("Time now is {0}\n", DateTime.Now));
sb.Append(String.Format("Server has been running since {0}, {1}\n", m_startuptime.DayOfWeek, m_startuptime));
sb.Append(String.Format("That is an elapsed time of {0}\n", DateTime.Now - m_startuptime));
-
+
return sb.ToString();
}
-
+
///
/// Set the level of log notices being echoed to the console
///
@@ -133,7 +133,7 @@ namespace OpenSim.Framework.Servers
ILoggerRepository repository = LogManager.GetRepository();
IAppender[] appenders = repository.GetAppenders();
OpenSimAppender consoleAppender = null;
-
+
foreach (IAppender appender in appenders)
{
if (appender.Name == "Console")
@@ -142,13 +142,13 @@ namespace OpenSim.Framework.Servers
break;
}
}
-
+
if (null == consoleAppender)
{
Notice("No appender named Console found (see the log4net config file for this executable)!");
return;
}
-
+
if (setParams.Length > 0)
{
Level consoleLevel = repository.LevelMap[setParams[0]];
@@ -160,12 +160,12 @@ namespace OpenSim.Framework.Servers
"{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF",
setParams[0]));
}
-
+
// If there is no threshold set then the threshold is effectively everything.
Level thresholdLevel
= (null != consoleAppender.Threshold ? consoleAppender.Threshold : log4net.Core.Level.All);
-
- Notice(String.Format("Console log level is {0}", thresholdLevel));
+
+ Notice(String.Format("Console log level is {0}", thresholdLevel));
}
///
@@ -203,7 +203,7 @@ namespace OpenSim.Framework.Servers
Notice("");
Notice("quit - equivalent to shutdown.");
- Notice("set log level [level] - change the console logging level only. For example, off or debug.");
+ Notice("set log level [level] - change the console logging level only. For example, off or debug.");
Notice("show info - show server information (e.g. startup path).");
if (m_stats != null)
@@ -219,7 +219,7 @@ namespace OpenSim.Framework.Servers
case "set":
Set(cmdparams);
break;
-
+
case "show":
if (cmdparams.Length > 0)
{
@@ -232,8 +232,8 @@ namespace OpenSim.Framework.Servers
Shutdown();
break;
}
- }
-
+ }
+
///
/// Set an OpenSim parameter
///
@@ -245,15 +245,15 @@ namespace OpenSim.Framework.Servers
// Temporary while we only have one command which takes at least two parameters
if (setArgs.Length < 2)
return;
-
+
if (setArgs[0] == "log" && setArgs[1] == "level")
{
string[] setParams = new string[setArgs.Length - 2];
Array.Copy(setArgs, 2, setParams, 0, setArgs.Length - 2);
-
- SetConsoleLogLevel(setParams);
+
+ SetConsoleLogLevel(setParams);
}
- }
+ }
///
/// Outputs to the console information about the region
@@ -276,7 +276,7 @@ namespace OpenSim.Framework.Servers
Notice(m_stats.Report());
}
break;
-
+
case "threads":
List threads = ThreadTracker.GetThreads();
if (threads == null)
@@ -291,7 +291,7 @@ namespace OpenSim.Framework.Servers
Notice("ID: " + t.ManagedThreadId.ToString() + ", Name: " + t.Name + ", Alive: " + t.IsAlive.ToString() + ", Pri: " + t.Priority.ToString() + ", State: " + t.ThreadState.ToString());
}
}
- break;
+ break;
case "uptime":
Notice(GetUptimeReport());
@@ -301,7 +301,7 @@ namespace OpenSim.Framework.Servers
Notice("Version: " + m_version);
break;
}
- }
+ }
///
/// Console output is only possible if a console has been established.
diff --git a/OpenSim/Framework/Servers/OSHttpHandler.cs b/OpenSim/Framework/Servers/OSHttpHandler.cs
index 66fff3e..838f29a 100644
--- a/OpenSim/Framework/Servers/OSHttpHandler.cs
+++ b/OpenSim/Framework/Servers/OSHttpHandler.cs
@@ -72,21 +72,21 @@ namespace OpenSim.Framework.Servers
/// Regular expression used to match against method of
/// the incoming HTTP request. If you want to match any string
/// either use '.*' or null. To match on the empty string use
- /// '^$'.
+ /// '^$'.
///
public virtual Regex Method
{
get { return _method; }
}
protected Regex _method;
-
+
///
/// Regular expression used to match against path of the
/// incoming HTTP request. If you want to match any string
/// either use '.*' or null. To match on the emtpy string use
/// '^$'.
///
- public virtual Regex Path
+ public virtual Regex Path
{
get { return _path; }
}
@@ -97,7 +97,7 @@ namespace OpenSim.Framework.Servers
/// allowing us to match on URI query fields.
///
public virtual Dictionary Query
- {
+ {
get { return _query; }
}
protected Dictionary _query;
@@ -107,7 +107,7 @@ namespace OpenSim.Framework.Servers
/// allowing us to match on HTTP header fields.
///
public virtual Dictionary Headers
- {
+ {
get { return _headers; }
}
protected Dictionary _headers;
@@ -137,7 +137,7 @@ namespace OpenSim.Framework.Servers
/// null or content type
/// regex
/// null or IP address regex
- public OSHttpHandler(Regex method, Regex path, Dictionary query,
+ public OSHttpHandler(Regex method, Regex path, Dictionary query,
Dictionary headers, Regex contentType, Regex whitelist)
{
_method = method;
@@ -155,7 +155,7 @@ namespace OpenSim.Framework.Servers
///
/// Process an incoming OSHttpRequest that matched our
- /// requirements.
+ /// requirements.
///
///
/// OSHttpHandlerResult.Pass if we are after all not
@@ -180,4 +180,4 @@ namespace OpenSim.Framework.Servers
return sw.ToString();
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Framework/Servers/OSHttpHttpHandler.cs b/OpenSim/Framework/Servers/OSHttpHttpHandler.cs
index 66120c3..e08df85 100644
--- a/OpenSim/Framework/Servers/OSHttpHttpHandler.cs
+++ b/OpenSim/Framework/Servers/OSHttpHttpHandler.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Framework.Servers
/// null or dictionary with header
/// regexs
/// null or IP address whitelist
- public OSHttpHttpHandler(GenericHTTPMethod handler, Regex method, Regex path,
+ public OSHttpHttpHandler(GenericHTTPMethod handler, Regex method, Regex path,
Dictionary query,
Dictionary headers, Regex whitelist)
: base(method, path, query, headers, new Regex(@"^text/html", RegexOptions.IgnoreCase | RegexOptions.Compiled),
@@ -71,7 +71,7 @@ namespace OpenSim.Framework.Servers
/// Instantiate an HTTP handler.
///
/// a GenericHTTPMethod
- public OSHttpHttpHandler(GenericHTTPMethod handler)
+ public OSHttpHttpHandler(GenericHTTPMethod handler)
: this(handler, new Regex(@"^GET$", RegexOptions.IgnoreCase | RegexOptions.Compiled), null, null, null, null)
{
}
@@ -79,7 +79,7 @@ namespace OpenSim.Framework.Servers
///
/// Invoked by OSHttpRequestPump.
///
- public override OSHttpHandlerResult Process(OSHttpRequest request)
+ public override OSHttpHandlerResult Process(OSHttpRequest request)
{
// call handler method
Hashtable responseData = _handler(request.Query);
@@ -110,7 +110,7 @@ namespace OpenSim.Framework.Servers
}
response.AddHeader("Content-type", contentType);
-
+
byte[] buffer;
if (!contentType.Contains("image"))
@@ -142,4 +142,4 @@ namespace OpenSim.Framework.Servers
return OSHttpHandlerResult.Done;
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Framework/Servers/OSHttpRequest.cs b/OpenSim/Framework/Servers/OSHttpRequest.cs
index 0a82a04..01e71c8 100644
--- a/OpenSim/Framework/Servers/OSHttpRequest.cs
+++ b/OpenSim/Framework/Servers/OSHttpRequest.cs
@@ -38,42 +38,35 @@ namespace OpenSim.Framework.Servers
{
public class OSHttpRequest
{
-
-
public string[] AcceptTypes
{
get { return _acceptTypes; }
}
private string[] _acceptTypes;
-
public Encoding ContentEncoding
{
get { return _contentEncoding; }
}
private Encoding _contentEncoding;
-
public long ContentLength
{
get { return _contentLength64; }
}
private long _contentLength64;
-
public long ContentLength64
{
get { return ContentLength; }
}
-
public string ContentType
{
get { return _contentType; }
}
private string _contentType;
-
// public CookieCollection Cookies
// {
// get { return _cookies; }
@@ -92,63 +85,54 @@ namespace OpenSim.Framework.Servers
}
private string _httpMethod;
-
public Stream InputStream
{
get { return _inputStream; }
}
private Stream _inputStream;
-
// public bool IsSecureConnection
// {
// get { return _isSecureConnection; }
// }
// private bool _isSecureConnection;
-
// public bool IsAuthenticated
// {
// get { return _isAuthenticated; }
// }
// private bool _isAuthenticated;
-
public bool HasEntityBody
{
get { return _hasbody; }
}
private bool _hasbody;
-
public bool KeepAlive
{
get { return _keepAlive; }
}
private bool _keepAlive;
-
public string RawUrl
{
get { return _rawUrl; }
}
private string _rawUrl;
-
public Uri Url
{
get { return _url; }
}
private Uri _url;
-
public string UserAgent
{
get { return _userAgent; }
}
private string _userAgent;
-
public NameValueCollection QueryString
{
get { return _queryString; }
@@ -161,28 +145,24 @@ namespace OpenSim.Framework.Servers
}
private Hashtable _query;
-
public IPEndPoint RemoteIPEndPoint
{
get { return _ipEndPoint; }
}
private IPEndPoint _ipEndPoint;
-
internal HttpRequest HttpRequest
{
get { return _request; }
}
private HttpRequest _request;
-
internal HttpClientContext HttpClientContext
{
get { return _context; }
}
private HttpClientContext _context;
-
///
/// Internal whiteboard for handlers to store temporary stuff
/// into.
@@ -193,12 +173,10 @@ namespace OpenSim.Framework.Servers
}
private Dictionary _whiteboard = new Dictionary();
-
public OSHttpRequest()
{
}
-
public OSHttpRequest(HttpListenerRequest req)
{
_acceptTypes = req.AcceptTypes;
diff --git a/OpenSim/Framework/Servers/OSHttpRequestPump.cs b/OpenSim/Framework/Servers/OSHttpRequestPump.cs
index 8d4dc0d..b4270b3 100644
--- a/OpenSim/Framework/Servers/OSHttpRequestPump.cs
+++ b/OpenSim/Framework/Servers/OSHttpRequestPump.cs
@@ -39,7 +39,6 @@ using System.Threading;
using log4net;
using HttpServer;
-
namespace OpenSim.Framework.Servers
{
///
@@ -58,13 +57,12 @@ namespace OpenSim.Framework.Servers
protected Thread _engine;
private int _id;
-
+
public string EngineID
{
get { return String.Format("{0} pump {1}", _server.EngineID, _id); }
}
-
public OSHttpRequestPump(OSHttpServer server, OSHttpRequestQueue queue, int id)
{
_server = server;
@@ -77,7 +75,6 @@ namespace OpenSim.Framework.Servers
_engine.Start();
ThreadTracker.Add(_engine);
-
}
public static OSHttpRequestPump[] Pumps(OSHttpServer server, OSHttpRequestQueue queue, int poolSize)
@@ -104,21 +101,22 @@ namespace OpenSim.Framework.Servers
public void Engine()
{
OSHttpRequest req = null;
-
+
while (true)
{
- try {
+ try
+ {
// dequeue an OSHttpRequest from OSHttpServer's
- // request queue
+ // request queue
req = _queue.Dequeue();
-
+
// get a copy of the list of registered handlers
List handlers = _server.OSHttpHandlers;
-
+
// prune list and have it sorted from most
// specific to least specific
handlers = MatchHandlers(req, handlers);
-
+
// process req: we try each handler in turn until
// we are either out of handlers or get back a
// Pass or Done
@@ -126,18 +124,18 @@ namespace OpenSim.Framework.Servers
foreach (OSHttpHandler h in handlers)
{
rc = h.Process(req);
-
+
// Pass: handler did not process the request,
// try next handler
if (OSHttpHandlerResult.Pass == rc) continue;
// Handled: handler has processed the request
if (OSHttpHandlerResult.Done == rc) break;
-
+
// hmm, something went wrong
throw new Exception(String.Format("[{0}] got unexpected OSHttpHandlerResult {1}", EngineID, rc));
}
-
+
if (OSHttpHandlerResult.Unprocessed == rc)
{
_log.InfoFormat("[{0}] OSHttpHandler: no handler registered for {1}", EngineID, req);
@@ -190,7 +188,7 @@ namespace OpenSim.Framework.Servers
if (null != remote)
{
Match epm = h.IPEndPointWhitelist.Match(remote.ToString());
- if (!epm.Success)
+ if (!epm.Success)
{
scoredHandlers.Remove(h);
continue;
@@ -201,7 +199,7 @@ namespace OpenSim.Framework.Servers
if (null != h.Method)
{
Match m = h.Method.Match(req.HttpMethod);
- if (!m.Success)
+ if (!m.Success)
{
scoredHandlers.Remove(h);
continue;
@@ -213,7 +211,7 @@ namespace OpenSim.Framework.Servers
if (null != h.Path)
{
Match m = h.Path.Match(req.RawUrl);
- if (!m.Success)
+ if (!m.Success)
{
scoredHandlers.Remove(h);
continue;
@@ -272,14 +270,15 @@ namespace OpenSim.Framework.Servers
{
return 0;
}
-
+
// does the content of collection[tag] match
// the supplied regex?
Match cm = regexs[tag].Match(collection[tag]);
- if (!cm.Success) {
+ if (!cm.Success)
+ {
return 0;
}
-
+
// ok: matches
matched++;
continue;
@@ -288,7 +287,7 @@ namespace OpenSim.Framework.Servers
return matched;
}
- [ConditionalAttribute("DEBUGGING")]
+ [ConditionalAttribute("DEBUGGING")]
private void LogDumpHandlerList(List l)
{
_log.DebugFormat("[{0}] OSHttpHandlerList dump:", EngineID);
diff --git a/OpenSim/Framework/Servers/OSHttpRequestQueue.cs b/OpenSim/Framework/Servers/OSHttpRequestQueue.cs
index f6f1829..94f7b32 100644
--- a/OpenSim/Framework/Servers/OSHttpRequestQueue.cs
+++ b/OpenSim/Framework/Servers/OSHttpRequestQueue.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Framework.Servers
{
private object _syncObject = new object();
- new public void Enqueue(OSHttpRequest req)
+ new public void Enqueue(OSHttpRequest req)
{
lock (_syncObject)
{
@@ -48,7 +48,7 @@ namespace OpenSim.Framework.Servers
Monitor.Pulse(_syncObject);
}
}
-
+
new public OSHttpRequest Dequeue()
{
OSHttpRequest req = null;
@@ -65,4 +65,4 @@ namespace OpenSim.Framework.Servers
return req;
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Framework/Servers/OSHttpResponse.cs b/OpenSim/Framework/Servers/OSHttpResponse.cs
index eb7e400..21d1e2b 100644
--- a/OpenSim/Framework/Servers/OSHttpResponse.cs
+++ b/OpenSim/Framework/Servers/OSHttpResponse.cs
@@ -56,15 +56,15 @@ namespace OpenSim.Framework.Servers
///
///
/// Setting this property will also set IsContentTypeSet to
- /// true.
+ /// true.
///
public string ContentType
{
- get
- {
+ get
+ {
if (HttpServer)
return _httpResponse.ContentType;
- else
+ else
return _httpListenerResponse.ContentType;
}
set
@@ -100,11 +100,11 @@ namespace OpenSim.Framework.Servers
///
public long ContentLength
{
- get
- {
+ get
+ {
if (HttpServer)
return _httpResponse.ContentLength;
- else
+ else
return _httpListenerResponse.ContentLength64;
}
set
@@ -130,11 +130,11 @@ namespace OpenSim.Framework.Servers
///
public Encoding ContentEncoding
{
- get
- {
+ get
+ {
if (HttpServer)
return _httpResponse.Encoding;
- else
+ else
return _httpListenerResponse.ContentEncoding;
}
@@ -142,7 +142,7 @@ namespace OpenSim.Framework.Servers
{
if (HttpServer)
_httpResponse.Encoding = value;
- else
+ else
_httpListenerResponse.ContentEncoding = value;
}
}
@@ -152,8 +152,8 @@ namespace OpenSim.Framework.Servers
///
public WebHeaderCollection Headers
{
- get
- {
+ get
+ {
if (HttpServer)
return null;
else
@@ -166,10 +166,10 @@ namespace OpenSim.Framework.Servers
///
public bool KeepAlive
{
- get
- {
+ get
+ {
if (HttpServer)
- return _httpResponse.Connection == ConnectionType.KeepAlive;
+ return _httpResponse.Connection == ConnectionType.KeepAlive;
else
return _httpListenerResponse.KeepAlive;
}
@@ -178,7 +178,7 @@ namespace OpenSim.Framework.Servers
{
if (HttpServer)
_httpResponse.Connection = ConnectionType.KeepAlive;
- else
+ else
_httpListenerResponse.KeepAlive = value;
}
}
@@ -191,8 +191,8 @@ namespace OpenSim.Framework.Servers
///
public Stream OutputStream
{
- get
- {
+ get
+ {
if (HttpServer)
return _httpResponse.Body;
else
@@ -205,10 +205,10 @@ namespace OpenSim.Framework.Servers
///
public Stream Body
{
- get
- {
+ get
+ {
if (HttpServer)
- return _httpResponse.Body;
+ return _httpResponse.Body;
throw new Exception("[OSHttpResponse] mixed .NET and HttpServer access");
}
}
@@ -228,18 +228,18 @@ namespace OpenSim.Framework.Servers
}
}
-
+
///
/// Chunk transfers.
///
public bool SendChunked
{
- get
- {
+ get
+ {
if (HttpServer)
return _httpResponse.Chunked;
else
- return _httpListenerResponse.SendChunked;
+ return _httpListenerResponse.SendChunked;
}
set
@@ -256,12 +256,12 @@ namespace OpenSim.Framework.Servers
///
public int StatusCode
{
- get
- {
+ get
+ {
if (HttpServer)
return (int)_httpResponse.Status;
- else
- return _httpListenerResponse.StatusCode;
+ else
+ return _httpListenerResponse.StatusCode;
}
set
@@ -279,12 +279,12 @@ namespace OpenSim.Framework.Servers
///
public string StatusDescription
{
- get
- {
+ get
+ {
if (HttpServer)
return _httpResponse.Reason;
else
- return _httpListenerResponse.StatusDescription;
+ return _httpListenerResponse.StatusDescription;
}
set
@@ -331,7 +331,7 @@ namespace OpenSim.Framework.Servers
/// object.
/// Incoming OSHttpRequest to which we are
- /// replying
+ /// replying
public OSHttpResponse(OSHttpRequest req)
{
_httpResponse = new HttpResponse(req.HttpClientContext, req.HttpRequest);
@@ -343,7 +343,7 @@ namespace OpenSim.Framework.Servers
/// string containing the header field
/// name
/// string containing the header field
- /// value
+ /// value
public void AddHeader(string key, string value)
{
if (HttpServer)
@@ -361,8 +361,8 @@ namespace OpenSim.Framework.Servers
{
_httpResponse.Body.Flush();
_httpResponse.Send();
- }
- else
+ }
+ else
{
OutputStream.Close();
}
diff --git a/OpenSim/Framework/Servers/OSHttpServer.cs b/OpenSim/Framework/Servers/OSHttpServer.cs
index e0d26ff..40f4229 100644
--- a/OpenSim/Framework/Servers/OSHttpServer.cs
+++ b/OpenSim/Framework/Servers/OSHttpServer.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Framework.Servers
get { return _isSecure; }
}
- public int QueueSize
+ public int QueueSize
{
get { return _pumps.Length; }
}
@@ -91,7 +91,7 @@ namespace OpenSim.Framework.Servers
protected List _httpHandlers = new List();
public List OSHttpHandlers
{
- get
+ get
{
lock (_httpHandlers)
{
@@ -175,7 +175,7 @@ namespace OpenSim.Framework.Servers
_listener.RequestHandler += OnHttpRequest;
_listener.Start(QueueSize);
_log.InfoFormat("[{0}] HTTP server started", EngineID);
-
+
lock (_syncObject) Monitor.Wait(_syncObject);
}
catch (Exception ex)
@@ -196,7 +196,7 @@ namespace OpenSim.Framework.Servers
/// and regular expressions to match against header values
public void AddHandler(OSHttpHandler handler)
{
- lock (_httpHandlers)
+ lock (_httpHandlers)
{
if (_httpHandlers.Contains(handler))
{
diff --git a/OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs b/OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs
index f3f056a..996e5dc 100644
--- a/OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs
+++ b/OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs
@@ -54,16 +54,16 @@ namespace OpenSim.Framework.Servers
protected bool XmlRpcMethodMatch(OSHttpRequest req)
{
XmlRpcRequest xmlRpcRequest = null;
-
+
// check whether req is already reified
// if not: reify (and post to whiteboard)
- try
+ try
{
if (req.Whiteboard.ContainsKey("xmlrequest"))
{
xmlRpcRequest = req.Whiteboard["xmlrequest"] as XmlRpcRequest;
}
- else
+ else
{
StreamReader body = new StreamReader(req.InputStream);
string requestBody = body.ReadToEnd();
@@ -76,22 +76,22 @@ namespace OpenSim.Framework.Servers
_log.ErrorFormat("[OSHttpXmlRpcHandler] failed to deserialize XmlRpcRequest from {0}", req.ToString());
return false;
}
-
+
// check against methodName
- if ((null != xmlRpcRequest)
- && !String.IsNullOrEmpty(xmlRpcRequest.MethodName)
+ if ((null != xmlRpcRequest)
+ && !String.IsNullOrEmpty(xmlRpcRequest.MethodName)
&& xmlRpcRequest.MethodName == _methodName)
{
_log.DebugFormat("[OSHttpXmlRpcHandler] located handler {0} for {1}", _methodName, req.ToString());
return true;
}
-
+
return false;
}
// contains handler for processing XmlRpc Request
private XmlRpcMethod _handler;
-
+
// contains XmlRpc method name
private string _methodName;
@@ -112,9 +112,9 @@ namespace OpenSim.Framework.Servers
/// can be null, in which case they are not taken into account
/// when the handler is being looked up.
///
- public OSHttpXmlRpcHandler(XmlRpcMethod handler, string methodName, Regex path,
+ public OSHttpXmlRpcHandler(XmlRpcMethod handler, string methodName, Regex path,
Dictionary headers, Regex whitelist)
- : base(new Regex(@"^POST$", RegexOptions.IgnoreCase | RegexOptions.Compiled), path, null, headers,
+ : base(new Regex(@"^POST$", RegexOptions.IgnoreCase | RegexOptions.Compiled), path, null, headers,
new Regex(@"^(text|application)/xml", RegexOptions.IgnoreCase | RegexOptions.Compiled),
whitelist)
{
@@ -138,7 +138,7 @@ namespace OpenSim.Framework.Servers
///
/// Invoked by OSHttpRequestPump.
///
- public override OSHttpHandlerResult Process(OSHttpRequest request)
+ public override OSHttpHandlerResult Process(OSHttpRequest request)
{
XmlRpcResponse xmlRpcResponse;
string responseString;
@@ -148,13 +148,13 @@ namespace OpenSim.Framework.Servers
OSHttpResponse resp = new OSHttpResponse(request);
- try
+ try
{
// reified XmlRpcRequest must still be on the whiteboard
XmlRpcRequest xmlRpcRequest = request.Whiteboard["xmlrequest"] as XmlRpcRequest;
xmlRpcResponse = _handler(xmlRpcRequest);
responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse);
-
+
resp.ContentType = "text/xml";
byte[] buffer = Encoding.UTF8.GetBytes(responseString);
@@ -176,4 +176,4 @@ namespace OpenSim.Framework.Servers
return OSHttpHandlerResult.Done;
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Framework/Servers/RestSessionService.cs b/OpenSim/Framework/Servers/RestSessionService.cs
index 1ed349f..1cfb425 100644
--- a/OpenSim/Framework/Servers/RestSessionService.cs
+++ b/OpenSim/Framework/Servers/RestSessionService.cs
@@ -151,7 +151,7 @@ namespace OpenSim.Framework.Servers
private CheckIdentityMethod m_smethod;
public RestDeserialiseSecureHandler(
- string httpMethod, string path,
+ string httpMethod, string path,
RestDeserialiseMethod method, CheckIdentityMethod smethod)
: base(httpMethod, path)
{
@@ -196,7 +196,7 @@ namespace OpenSim.Framework.Servers
///
///
private RestDeserialiseMethod m_method;
-
+
///
/// The method used to check whether a request is trusted.
///
--
cgit v1.1