diff options
Diffstat (limited to 'OpenSim/Framework/Servers/BaseHttpServer.cs')
-rw-r--r-- | OpenSim/Framework/Servers/BaseHttpServer.cs | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index df3b049..cc0c0d0 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs | |||
@@ -41,6 +41,8 @@ namespace OpenSim.Framework.Servers | |||
41 | { | 41 | { |
42 | public class BaseHttpServer | 42 | public class BaseHttpServer |
43 | { | 43 | { |
44 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
44 | protected Thread m_workerThread; | 46 | protected Thread m_workerThread; |
45 | protected HttpListener m_httpListener; | 47 | protected HttpListener m_httpListener; |
46 | protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>(); | 48 | protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>(); |
@@ -296,7 +298,7 @@ namespace OpenSim.Framework.Servers | |||
296 | } | 298 | } |
297 | catch (Exception ex) | 299 | catch (Exception ex) |
298 | { | 300 | { |
299 | MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); | 301 | m_log.Warn("[HTTPD]: Error - " + ex.Message); |
300 | } | 302 | } |
301 | finally | 303 | finally |
302 | { | 304 | { |
@@ -319,7 +321,7 @@ namespace OpenSim.Framework.Servers | |||
319 | LLSD llsdResponse = null; | 321 | LLSD llsdResponse = null; |
320 | 322 | ||
321 | try { llsdRequest = LLSDParser.DeserializeXml(requestBody); } | 323 | try { llsdRequest = LLSDParser.DeserializeXml(requestBody); } |
322 | catch (Exception ex) { MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); } | 324 | catch (Exception ex) { m_log.Warn("[HTTPD]: Error - " + ex.Message); } |
323 | 325 | ||
324 | if (llsdRequest != null && m_llsdHandler != null) | 326 | if (llsdRequest != null && m_llsdHandler != null) |
325 | { | 327 | { |
@@ -348,7 +350,7 @@ namespace OpenSim.Framework.Servers | |||
348 | } | 350 | } |
349 | catch (Exception ex) | 351 | catch (Exception ex) |
350 | { | 352 | { |
351 | MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); | 353 | m_log.Warn("[HTTPD]: Error - " + ex.Message); |
352 | } | 354 | } |
353 | finally | 355 | finally |
354 | { | 356 | { |
@@ -396,7 +398,7 @@ namespace OpenSim.Framework.Servers | |||
396 | 398 | ||
397 | foreach (string headername in rHeaders) | 399 | foreach (string headername in rHeaders) |
398 | { | 400 | { |
399 | //MainLog.Instance.Warn("HEADER", headername + "=" + request.Headers[headername]); | 401 | //m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]); |
400 | headervals[headername] = request.Headers[headername]; | 402 | headervals[headername] = request.Headers[headername]; |
401 | } | 403 | } |
402 | 404 | ||
@@ -407,9 +409,9 @@ namespace OpenSim.Framework.Servers | |||
407 | 409 | ||
408 | if (keysvals.Contains("method")) | 410 | if (keysvals.Contains("method")) |
409 | { | 411 | { |
410 | //MainLog.Instance.Warn("HTTP", "Contains Method"); | 412 | //m_log.Warn("[HTTP]: Contains Method"); |
411 | string method = (string) keysvals["method"]; | 413 | string method = (string) keysvals["method"]; |
412 | //MainLog.Instance.Warn("HTTP", requestBody); | 414 | //m_log.Warn("[HTTP]: " + requestBody); |
413 | GenericHTTPMethod requestprocessor; | 415 | GenericHTTPMethod requestprocessor; |
414 | bool foundHandler = TryGetHTTPHandler(method, out requestprocessor); | 416 | bool foundHandler = TryGetHTTPHandler(method, out requestprocessor); |
415 | if (foundHandler) | 417 | if (foundHandler) |
@@ -422,13 +424,13 @@ namespace OpenSim.Framework.Servers | |||
422 | } | 424 | } |
423 | else | 425 | else |
424 | { | 426 | { |
425 | //MainLog.Instance.Warn("HTTP", "Handler Not Found"); | 427 | //m_log.Warn("[HTTP]: Handler Not Found"); |
426 | SendHTML404(response, host); | 428 | SendHTML404(response, host); |
427 | } | 429 | } |
428 | } | 430 | } |
429 | else | 431 | else |
430 | { | 432 | { |
431 | //MainLog.Instance.Warn("HTTP", "No Method specified"); | 433 | //m_log.Warn("[HTTP]: No Method specified"); |
432 | SendHTML404(response, host); | 434 | SendHTML404(response, host); |
433 | } | 435 | } |
434 | } | 436 | } |
@@ -461,7 +463,7 @@ namespace OpenSim.Framework.Servers | |||
461 | } | 463 | } |
462 | catch (Exception ex) | 464 | catch (Exception ex) |
463 | { | 465 | { |
464 | MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); | 466 | m_log.Warn("[HTTPD]: Error - " + ex.Message); |
465 | } | 467 | } |
466 | finally | 468 | finally |
467 | { | 469 | { |
@@ -488,7 +490,7 @@ namespace OpenSim.Framework.Servers | |||
488 | } | 490 | } |
489 | catch (Exception ex) | 491 | catch (Exception ex) |
490 | { | 492 | { |
491 | MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); | 493 | m_log.Warn("[HTTPD]: Error - " + ex.Message); |
492 | } | 494 | } |
493 | finally | 495 | finally |
494 | { | 496 | { |
@@ -513,7 +515,7 @@ namespace OpenSim.Framework.Servers | |||
513 | } | 515 | } |
514 | catch (Exception ex) | 516 | catch (Exception ex) |
515 | { | 517 | { |
516 | MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); | 518 | m_log.Warn("[HTTPD]: Error - " + ex.Message); |
517 | } | 519 | } |
518 | finally | 520 | finally |
519 | { | 521 | { |
@@ -523,7 +525,7 @@ namespace OpenSim.Framework.Servers | |||
523 | 525 | ||
524 | public void Start() | 526 | public void Start() |
525 | { | 527 | { |
526 | MainLog.Instance.Verbose("HTTPD", "Starting up HTTP Server"); | 528 | m_log.Info("[HTTPD]: Starting up HTTP Server"); |
527 | 529 | ||
528 | m_workerThread = new Thread(new ThreadStart(StartHTTP)); | 530 | m_workerThread = new Thread(new ThreadStart(StartHTTP)); |
529 | m_workerThread.IsBackground = true; | 531 | m_workerThread.IsBackground = true; |
@@ -534,7 +536,7 @@ namespace OpenSim.Framework.Servers | |||
534 | { | 536 | { |
535 | try | 537 | try |
536 | { | 538 | { |
537 | MainLog.Instance.Verbose("HTTPD", "Spawned main thread OK"); | 539 | m_log.Info("[HTTPD]: Spawned main thread OK"); |
538 | m_httpListener = new HttpListener(); | 540 | m_httpListener = new HttpListener(); |
539 | 541 | ||
540 | if (!m_ssl) | 542 | if (!m_ssl) |
@@ -556,7 +558,7 @@ namespace OpenSim.Framework.Servers | |||
556 | } | 558 | } |
557 | catch (Exception e) | 559 | catch (Exception e) |
558 | { | 560 | { |
559 | MainLog.Instance.Warn("HTTPD", "Error - " + e.Message); | 561 | m_log.Warn("[HTTPD]: Error - " + e.Message); |
560 | } | 562 | } |
561 | } | 563 | } |
562 | 564 | ||