aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
diff options
context:
space:
mode:
authorMelanie Thielker2017-01-05 19:07:37 +0000
committerMelanie Thielker2017-01-05 19:07:37 +0000
commitb16abc8166c29585cb76cc55c3bdd76e5833cb4f (patch)
tree6a34f465a74b7a3a6dc00a3d7aa8dcc25ac3e3a5 /OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
parentMake it possible to disable the bakes module in the way it is described in co... (diff)
downloadopensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.zip
opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.gz
opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.bz2
opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.xz
Massive tab and trailing space cleanup
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs46
1 files changed, 23 insertions, 23 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index e431042..fb92b92 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Framework.Servers.HttpServer
58 58
59 /// <summary> 59 /// <summary>
60 /// This is a pending websocket request before it got an sucessful upgrade response. 60 /// This is a pending websocket request before it got an sucessful upgrade response.
61 /// The consumer must call handler.HandshakeAndUpgrade() to signal to the handler to 61 /// The consumer must call handler.HandshakeAndUpgrade() to signal to the handler to
62 /// start the connection and optionally provide an origin authentication method. 62 /// start the connection and optionally provide an origin authentication method.
63 /// </summary> 63 /// </summary>
64 /// <param name="servicepath"></param> 64 /// <param name="servicepath"></param>
@@ -104,7 +104,7 @@ namespace OpenSim.Framework.Servers.HttpServer
104 new Dictionary<string, PollServiceEventArgs>(); 104 new Dictionary<string, PollServiceEventArgs>();
105 105
106 protected Dictionary<string, WebSocketRequestDelegate> m_WebSocketHandlers = 106 protected Dictionary<string, WebSocketRequestDelegate> m_WebSocketHandlers =
107 new Dictionary<string, WebSocketRequestDelegate>(); 107 new Dictionary<string, WebSocketRequestDelegate>();
108 108
109 protected uint m_port; 109 protected uint m_port;
110 protected uint m_sslport; 110 protected uint m_sslport;
@@ -253,7 +253,7 @@ namespace OpenSim.Framework.Servers.HttpServer
253 return new List<string>(m_rpcHandlers.Keys); 253 return new List<string>(m_rpcHandlers.Keys);
254 } 254 }
255 255
256 // JsonRPC 256 // JsonRPC
257 public bool AddJsonRPCHandler(string method, JsonRPCMethod handler) 257 public bool AddJsonRPCHandler(string method, JsonRPCMethod handler)
258 { 258 {
259 lock(jsonRpcHandlers) 259 lock(jsonRpcHandlers)
@@ -459,11 +459,11 @@ namespace OpenSim.Framework.Servers.HttpServer
459 dWebSocketRequestDelegate(req.Url.AbsolutePath, new WebSocketHttpServerHandler(req, context, 8192)); 459 dWebSocketRequestDelegate(req.Url.AbsolutePath, new WebSocketHttpServerHandler(req, context, 8192));
460 return; 460 return;
461 } 461 }
462 462
463 OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); 463 OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context);
464 resp.ReuseContext = true; 464 resp.ReuseContext = true;
465// resp.ReuseContext = false; 465// resp.ReuseContext = false;
466 HandleRequest(req, resp); 466 HandleRequest(req, resp);
467 467
468 // !!!HACK ALERT!!! 468 // !!!HACK ALERT!!!
469 // There seems to be a bug in the underlying http code that makes subsequent requests 469 // There seems to be a bug in the underlying http code that makes subsequent requests
@@ -554,7 +554,7 @@ namespace OpenSim.Framework.Servers.HttpServer
554 LogIncomingToStreamHandler(request, requestHandler); 554 LogIncomingToStreamHandler(request, requestHandler);
555 555
556 response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type. 556 response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type.
557 557
558 if (requestHandler is IStreamedRequestHandler) 558 if (requestHandler is IStreamedRequestHandler)
559 { 559 {
560 IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler; 560 IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler;
@@ -630,16 +630,16 @@ namespace OpenSim.Framework.Servers.HttpServer
630 case "text/html": 630 case "text/html":
631 if (DebugLevel >= 3) 631 if (DebugLevel >= 3)
632 LogIncomingToContentTypeHandler(request); 632 LogIncomingToContentTypeHandler(request);
633 633
634 buffer = HandleHTTPRequest(request, response); 634 buffer = HandleHTTPRequest(request, response);
635 break; 635 break;
636 636
637 case "application/llsd+xml": 637 case "application/llsd+xml":
638 case "application/xml+llsd": 638 case "application/xml+llsd":
639 case "application/llsd+json": 639 case "application/llsd+json":
640 if (DebugLevel >= 3) 640 if (DebugLevel >= 3)
641 LogIncomingToContentTypeHandler(request); 641 LogIncomingToContentTypeHandler(request);
642 642
643 buffer = HandleLLSDRequests(request, response); 643 buffer = HandleLLSDRequests(request, response);
644 break; 644 break;
645 645
@@ -649,7 +649,7 @@ namespace OpenSim.Framework.Servers.HttpServer
649 649
650 buffer = HandleJsonRpcRequests(request, response); 650 buffer = HandleJsonRpcRequests(request, response);
651 break; 651 break;
652 652
653 case "text/xml": 653 case "text/xml":
654 case "application/xml": 654 case "application/xml":
655 case "application/json": 655 case "application/json":
@@ -666,7 +666,7 @@ namespace OpenSim.Framework.Servers.HttpServer
666 { 666 {
667 if (DebugLevel >= 3) 667 if (DebugLevel >= 3)
668 LogIncomingToContentTypeHandler(request); 668 LogIncomingToContentTypeHandler(request);
669 669
670 buffer = HandleLLSDRequests(request, response); 670 buffer = HandleLLSDRequests(request, response);
671 } 671 }
672 // m_log.DebugFormat("[BASE HTTP SERVER]: Checking for HTTP Handler for request {0}", request.RawUrl); 672 // m_log.DebugFormat("[BASE HTTP SERVER]: Checking for HTTP Handler for request {0}", request.RawUrl);
@@ -674,18 +674,18 @@ namespace OpenSim.Framework.Servers.HttpServer
674 { 674 {
675 if (DebugLevel >= 3) 675 if (DebugLevel >= 3)
676 LogIncomingToContentTypeHandler(request); 676 LogIncomingToContentTypeHandler(request);
677 677
678 buffer = HandleHTTPRequest(request, response); 678 buffer = HandleHTTPRequest(request, response);
679 } 679 }
680 else 680 else
681 { 681 {
682 if (DebugLevel >= 3) 682 if (DebugLevel >= 3)
683 LogIncomingToXmlRpcHandler(request); 683 LogIncomingToXmlRpcHandler(request);
684 684
685 // generic login request. 685 // generic login request.
686 buffer = HandleXmlRpcRequests(request, response); 686 buffer = HandleXmlRpcRequests(request, response);
687 } 687 }
688 688
689 break; 689 break;
690 } 690 }
691 } 691 }
@@ -972,7 +972,7 @@ namespace OpenSim.Framework.Servers.HttpServer
972// private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler) 972// private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler)
973// { 973// {
974// agentHandler = null; 974// agentHandler = null;
975// 975//
976// lock (m_agentHandlers) 976// lock (m_agentHandlers)
977// { 977// {
978// foreach (IHttpAgentHandler handler in m_agentHandlers.Values) 978// foreach (IHttpAgentHandler handler in m_agentHandlers.Values)
@@ -1171,7 +1171,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1171 return buffer; 1171 return buffer;
1172 } 1172 }
1173 1173
1174 // JsonRpc (v2.0 only) 1174 // JsonRpc (v2.0 only)
1175 // Batch requests not yet supported 1175 // Batch requests not yet supported
1176 private byte[] HandleJsonRpcRequests(OSHttpRequest request, OSHttpResponse response) 1176 private byte[] HandleJsonRpcRequests(OSHttpRequest request, OSHttpResponse response)
1177 { 1177 {
@@ -1188,7 +1188,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1188 jsonRpcResponse.Error.Code = ErrorCode.InternalError; 1188 jsonRpcResponse.Error.Code = ErrorCode.InternalError;
1189 jsonRpcResponse.Error.Message = e.Message; 1189 jsonRpcResponse.Error.Message = e.Message;
1190 } 1190 }
1191 1191
1192 requestStream.Close(); 1192 requestStream.Close();
1193 1193
1194 if (jsonRpcRequest != null) 1194 if (jsonRpcRequest != null)
@@ -1253,7 +1253,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1253 string responseData = string.Empty; 1253 string responseData = string.Empty;
1254 1254
1255 responseData = jsonRpcResponse.Serialize(); 1255 responseData = jsonRpcResponse.Serialize();
1256 1256
1257 byte[] buffer = Encoding.UTF8.GetBytes(responseData); 1257 byte[] buffer = Encoding.UTF8.GetBytes(responseData);
1258 return buffer; 1258 return buffer;
1259 } 1259 }
@@ -1533,7 +1533,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1533 } 1533 }
1534 } 1534 }
1535 } 1535 }
1536 1536
1537 if (String.IsNullOrEmpty(bestMatch)) 1537 if (String.IsNullOrEmpty(bestMatch))
1538 { 1538 {
1539 llsdHandler = null; 1539 llsdHandler = null;
@@ -1899,8 +1899,8 @@ namespace OpenSim.Framework.Servers.HttpServer
1899 response.SendChunked = false; 1899 response.SendChunked = false;
1900 response.ContentLength64 = buffer.Length; 1900 response.ContentLength64 = buffer.Length;
1901 response.ContentEncoding = Encoding.UTF8; 1901 response.ContentEncoding = Encoding.UTF8;
1902 1902
1903 1903
1904 return buffer; 1904 return buffer;
1905 } 1905 }
1906 1906
@@ -1977,7 +1977,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1977 throw e; 1977 throw e;
1978 } 1978 }
1979 1979
1980 m_requestsProcessedStat 1980 m_requestsProcessedStat
1981 = new Stat( 1981 = new Stat(
1982 "HTTPRequestsServed", 1982 "HTTPRequestsServed",
1983 "Number of inbound HTTP requests processed", 1983 "Number of inbound HTTP requests processed",
@@ -1989,7 +1989,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1989 MeasuresOfInterest.AverageChangeOverTime, 1989 MeasuresOfInterest.AverageChangeOverTime,
1990 stat => stat.Value = RequestNumber, 1990 stat => stat.Value = RequestNumber,
1991 StatVerbosity.Debug); 1991 StatVerbosity.Debug);
1992 1992
1993 StatsManager.RegisterStat(m_requestsProcessedStat); 1993 StatsManager.RegisterStat(m_requestsProcessedStat);
1994 } 1994 }
1995 1995