From b16abc8166c29585cb76cc55c3bdd76e5833cb4f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 5 Jan 2017 19:07:37 +0000 Subject: Massive tab and trailing space cleanup --- OpenSim/Framework/WebUtil.cs | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'OpenSim/Framework/WebUtil.cs') diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index f927e69..12f58fe 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -247,7 +247,7 @@ namespace OpenSim.Framework request.MaximumAutomaticRedirections = 10; request.ReadWriteTimeout = timeout / 4; request.Headers[OSHeaderRequestID] = reqnum.ToString(); - + // If there is some input, write it into the request if (data != null) { @@ -261,7 +261,7 @@ namespace OpenSim.Framework byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); request.ContentType = rpc ? "application/json-rpc" : "application/json"; - + if (compressed) { request.Headers["X-Content-Encoding"] = "gzip"; // can't set "Content-Encoding" because old OpenSims fail if they get an unrecognized Content-Encoding @@ -294,7 +294,7 @@ namespace OpenSim.Framework requestStream.Write(buffer, 0, buffer.Length); //Send it } } - + // capture how much time was spent writing, this may seem silly // but with the number concurrent requests, this often blocks tickdata = Util.EnvironmentTickCountSubtract(tickstart); @@ -354,7 +354,7 @@ namespace OpenSim.Framework reqnum, tickdiff, tickdata); } } - + m_log.DebugFormat( "[LOGHTTP]: JSON-RPC request {0} {1} to {2} FAILED: {3}", reqnum, method, url, errorMessage); @@ -378,7 +378,7 @@ namespace OpenSim.Framework result["success"] = OSD.FromBoolean(true); result["_RawResult"] = OSD.FromString(response); result["_Result"] = new OSDMap(); - + if (response.Equals("true",System.StringComparison.OrdinalIgnoreCase)) return result; @@ -389,7 +389,7 @@ namespace OpenSim.Framework return result; } - try + try { OSD responseOSD = OSDParser.Deserialize(response); if (responseOSD.Type == OSDType.Map) @@ -403,10 +403,10 @@ namespace OpenSim.Framework // don't need to treat this as an error... we're just guessing anyway // m_log.DebugFormat("[WEB UTIL] couldn't decode <{0}>: {1}",response,e.Message); } - + return result; } - + #endregion JSONRequest #region FormRequest @@ -419,7 +419,7 @@ namespace OpenSim.Framework { return ServiceFormRequest(url,data, 30000); } - + public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout) { lock (EndPointLock(url)) @@ -436,7 +436,7 @@ namespace OpenSim.Framework if (DebugLevel >= 3) m_log.DebugFormat("[LOGHTTP]: HTTP OUT {0} ServiceForm '{1}' to {2}", reqnum, method, url); - + string errorMessage = "unknown error"; int tickstart = Util.EnvironmentTickCount(); int tickdata = 0; @@ -451,7 +451,7 @@ namespace OpenSim.Framework request.MaximumAutomaticRedirections = 10; request.ReadWriteTimeout = timeout / 4; request.Headers[OSHeaderRequestID] = reqnum.ToString(); - + if (data != null) { queryString = BuildQueryString(data); @@ -460,7 +460,7 @@ namespace OpenSim.Framework LogOutgoingDetail("SEND", reqnum, queryString); byte[] buffer = System.Text.Encoding.UTF8.GetBytes(queryString); - + request.ContentLength = buffer.Length; request.ContentType = "application/x-www-form-urlencoded"; using (Stream requestStream = request.GetRequestStream()) @@ -538,7 +538,7 @@ namespace OpenSim.Framework } #endregion FormRequest - + #region Uri /// @@ -591,7 +591,7 @@ namespace OpenSim.Framework } /// - /// Appends a query string to a Uri that may or may not have existing + /// Appends a query string to a Uri that may or may not have existing /// query parameters /// /// Uri to append the query to @@ -643,7 +643,7 @@ namespace OpenSim.Framework } /// - /// + /// /// /// /// @@ -662,12 +662,12 @@ namespace OpenSim.Framework #region Stream /// - /// Copies the contents of one stream to another, starting at the + /// Copies the contents of one stream to another, starting at the /// current position of each stream /// - /// The stream to copy from, at the position + /// The stream to copy from, at the position /// where copying should begin - /// The stream to copy to, at the position where + /// The stream to copy to, at the position where /// bytes should be written /// The maximum bytes to copy /// The total number of bytes copied @@ -811,7 +811,7 @@ namespace OpenSim.Framework /// /// /// - /// The response. If there was an internal exception or the request timed out, + /// The response. If there was an internal exception or the request timed out, /// then the default(TResponse) is returned. /// public static void MakeRequest(string verb, @@ -909,7 +909,7 @@ namespace OpenSim.Framework // If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't // documented in MSDN using (WebResponse response = request.EndGetResponse(res2)) - { + { try { using (Stream respStream = response.GetResponseStream()) @@ -930,7 +930,7 @@ namespace OpenSim.Framework if (e.Response is HttpWebResponse) { using (HttpWebResponse httpResponse = (HttpWebResponse)e.Response) - { + { if (httpResponse.StatusCode != HttpStatusCode.NotFound) { // We don't appear to be handling any other status codes, so log these feailures to that @@ -955,7 +955,7 @@ namespace OpenSim.Framework "[ASYNC REQUEST]: Request {0} {1} failed with exception {2}{3}", verb, requestUrl, e.Message, e.StackTrace); } - + // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString()); try @@ -968,7 +968,7 @@ namespace OpenSim.Framework "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}{3}", verb, requestUrl, e.Message, e.StackTrace); } - + }, null); } @@ -997,7 +997,7 @@ namespace OpenSim.Framework } } finally - { + { if (buffer != null) buffer.Dispose(); } @@ -1168,7 +1168,7 @@ namespace OpenSim.Framework /// Request timeout in milliseconds. Timeout.Infinite indicates no timeout. If 0 is passed then the default HttpWebRequest timeout is used (100 seconds) /// /// - /// The response. If there was an internal exception or the request timed out, + /// The response. If there was an internal exception or the request timed out, /// then the default(TResponse) is returned. /// public static TResponse MakeRequest(string verb, string requestUrl, TRequest obj, int pTimeout) @@ -1191,7 +1191,7 @@ namespace OpenSim.Framework /// /// /// - /// The response. If there was an internal exception or the request timed out, + /// The response. If there was an internal exception or the request timed out, /// then the default(TResponse) is returned. /// public static TResponse MakeRequest(string verb, string requestUrl, TRequest obj, int pTimeout, int maxConnections) @@ -1210,7 +1210,7 @@ namespace OpenSim.Framework /// /// /// - /// The response. If there was an internal exception or the request timed out, + /// The response. If there was an internal exception or the request timed out, /// then the default(TResponse) is returned. /// public static TResponse MakeRequest(string verb, string requestUrl, TRequest obj, int pTimeout, int maxConnections, IServiceAuth auth) @@ -1375,7 +1375,7 @@ namespace OpenSim.Framework return deserial; } - + public static class XMLResponseHelper { public static TResponse LogAndDeserialize(int reqnum, Stream respStream, long contentLength) @@ -1400,7 +1400,7 @@ namespace OpenSim.Framework } } - + public static class XMLRPCRequester { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -1444,7 +1444,7 @@ namespace OpenSim.Framework { m_log.Error("Error parsing XML-RPC response", e); } - + if (Resp.IsFault) { m_log.DebugFormat( -- cgit v1.1