aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/HttpServer
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs40
1 files changed, 27 insertions, 13 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 31af44c..1d5b426 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -53,6 +53,8 @@ namespace OpenSim.Framework.Servers.HttpServer
53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
54 private HttpServerLogWriter httpserverlog = new HttpServerLogWriter(); 54 private HttpServerLogWriter httpserverlog = new HttpServerLogWriter();
55 55
56 public int DebugLevel { get; set; }
57
56 private volatile int NotSocketErrors = 0; 58 private volatile int NotSocketErrors = 0;
57 public volatile bool HTTPDRunning = false; 59 public volatile bool HTTPDRunning = false;
58 60
@@ -79,11 +81,6 @@ namespace OpenSim.Framework.Servers.HttpServer
79 81
80 private PollServiceRequestManager m_PollServiceManager; 82 private PollServiceRequestManager m_PollServiceManager;
81 83
82 /// <summary>
83 /// Control the printing of certain debug messages.
84 /// </summary>
85 public int DebugLevel { get; set; }
86
87 public uint SSLPort 84 public uint SSLPort
88 { 85 {
89 get { return m_sslport; } 86 get { return m_sslport; }
@@ -450,7 +447,7 @@ namespace OpenSim.Framework.Servers.HttpServer
450 447
451 if (TryGetStreamHandler(handlerKey, out requestHandler)) 448 if (TryGetStreamHandler(handlerKey, out requestHandler))
452 { 449 {
453 if (DebugLevel >= 1) 450 if (DebugLevel >= 3)
454 m_log.DebugFormat( 451 m_log.DebugFormat(
455 "[BASE HTTP SERVER]: Found stream handler for {0} {1} {2} {3}", 452 "[BASE HTTP SERVER]: Found stream handler for {0} {1} {2} {3}",
456 request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description); 453 request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description);
@@ -531,7 +528,7 @@ namespace OpenSim.Framework.Servers.HttpServer
531 case null: 528 case null:
532 case "text/html": 529 case "text/html":
533 530
534 if (DebugLevel >= 1) 531 if (DebugLevel >= 3)
535 m_log.DebugFormat( 532 m_log.DebugFormat(
536 "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", 533 "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
537 request.ContentType, request.HttpMethod, request.Url.PathAndQuery); 534 request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
@@ -543,7 +540,7 @@ namespace OpenSim.Framework.Servers.HttpServer
543 case "application/xml+llsd": 540 case "application/xml+llsd":
544 case "application/llsd+json": 541 case "application/llsd+json":
545 542
546 if (DebugLevel >= 1) 543 if (DebugLevel >= 3)
547 m_log.DebugFormat( 544 m_log.DebugFormat(
548 "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", 545 "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
549 request.ContentType, request.HttpMethod, request.Url.PathAndQuery); 546 request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
@@ -564,7 +561,7 @@ namespace OpenSim.Framework.Servers.HttpServer
564 //m_log.Info("[Debug BASE HTTP SERVER]: Checking for LLSD Handler"); 561 //m_log.Info("[Debug BASE HTTP SERVER]: Checking for LLSD Handler");
565 if (DoWeHaveALLSDHandler(request.RawUrl)) 562 if (DoWeHaveALLSDHandler(request.RawUrl))
566 { 563 {
567 if (DebugLevel >= 1) 564 if (DebugLevel >= 3)
568 m_log.DebugFormat( 565 m_log.DebugFormat(
569 "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", 566 "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
570 request.ContentType, request.HttpMethod, request.Url.PathAndQuery); 567 request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
@@ -574,7 +571,7 @@ namespace OpenSim.Framework.Servers.HttpServer
574 // m_log.DebugFormat("[BASE HTTP SERVER]: Checking for HTTP Handler for request {0}", request.RawUrl); 571 // m_log.DebugFormat("[BASE HTTP SERVER]: Checking for HTTP Handler for request {0}", request.RawUrl);
575 else if (DoWeHaveAHTTPHandler(request.RawUrl)) 572 else if (DoWeHaveAHTTPHandler(request.RawUrl))
576 { 573 {
577 if (DebugLevel >= 1) 574 if (DebugLevel >= 3)
578 m_log.DebugFormat( 575 m_log.DebugFormat(
579 "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", 576 "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
580 request.ContentType, request.HttpMethod, request.Url.PathAndQuery); 577 request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
@@ -583,8 +580,7 @@ namespace OpenSim.Framework.Servers.HttpServer
583 } 580 }
584 else 581 else
585 { 582 {
586 583 if (DebugLevel >= 3)
587 if (DebugLevel >= 1)
588 m_log.DebugFormat( 584 m_log.DebugFormat(
589 "[BASE HTTP SERVER]: Assuming a generic XMLRPC request for {0} {1}", 585 "[BASE HTTP SERVER]: Assuming a generic XMLRPC request for {0} {1}",
590 request.HttpMethod, request.Url.PathAndQuery); 586 request.HttpMethod, request.Url.PathAndQuery);
@@ -793,8 +789,23 @@ namespace OpenSim.Framework.Servers.HttpServer
793 { 789 {
794 xmlRprcRequest = (XmlRpcRequest) (new XmlRpcRequestDeserializer()).Deserialize(requestBody); 790 xmlRprcRequest = (XmlRpcRequest) (new XmlRpcRequestDeserializer()).Deserialize(requestBody);
795 } 791 }
796 catch (XmlException) 792 catch (XmlException e)
797 { 793 {
794 if (DebugLevel >= 1)
795 {
796 if (DebugLevel >= 2)
797 m_log.Warn(
798 string.Format(
799 "[BASE HTTP SERVER]: Got XMLRPC request with invalid XML from {0}. XML was '{1}'. Sending blank response. Exception ",
800 request.RemoteIPEndPoint, requestBody),
801 e);
802 else
803 {
804 m_log.WarnFormat(
805 "[BASE HTTP SERVER]: Got XMLRPC request with invalid XML from {0}, length {1}. Sending blank response.",
806 request.RemoteIPEndPoint, requestBody.Length);
807 }
808 }
798 } 809 }
799 810
800 if (xmlRprcRequest != null) 811 if (xmlRprcRequest != null)
@@ -1570,6 +1581,9 @@ namespace OpenSim.Framework.Servers.HttpServer
1570 1581
1571 private void StartHTTP() 1582 private void StartHTTP()
1572 { 1583 {
1584 m_log.InfoFormat(
1585 "[BASE HTTP SERVER]: Starting {0} server on port {1}", UseSSL ? "HTTPS" : "HTTP", Port);
1586
1573 try 1587 try
1574 { 1588 {
1575 //m_httpListener = new HttpListener(); 1589 //m_httpListener = new HttpListener();