diff options
Diffstat (limited to '')
5 files changed, 42 insertions, 11 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 21e1e09..5c3cad4 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -280,7 +280,7 @@ namespace OpenSim.Framework.Servers | |||
280 | 280 | ||
281 | EnhanceVersionInformation(); | 281 | EnhanceVersionInformation(); |
282 | 282 | ||
283 | m_log.Info("[STARTUP]: OpenSimulator version: " + m_version + Environment.NewLine); | 283 | m_log.Info("[STARTUP]: Careminster version: " + m_version + Environment.NewLine); |
284 | // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and | 284 | // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and |
285 | // the clr version number doesn't match the project version number under Mono. | 285 | // the clr version number doesn't match the project version number under Mono. |
286 | //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine); | 286 | //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine); |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 1d05b02..953ed85 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -378,6 +378,22 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
378 | /// <param name="response"></param> | 378 | /// <param name="response"></param> |
379 | public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response) | 379 | public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response) |
380 | { | 380 | { |
381 | if (request.HttpMethod == String.Empty) // Can't handle empty requests, not wasting a thread | ||
382 | { | ||
383 | try | ||
384 | { | ||
385 | SendHTML500(response); | ||
386 | } | ||
387 | catch | ||
388 | { | ||
389 | } | ||
390 | |||
391 | return; | ||
392 | } | ||
393 | |||
394 | string requestMethod = request.HttpMethod; | ||
395 | string uriString = request.RawUrl; | ||
396 | |||
381 | string reqnum = "unknown"; | 397 | string reqnum = "unknown"; |
382 | int tickstart = Environment.TickCount; | 398 | int tickstart = Environment.TickCount; |
383 | 399 | ||
@@ -495,7 +511,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
495 | 511 | ||
496 | request.InputStream.Close(); | 512 | request.InputStream.Close(); |
497 | 513 | ||
498 | // HTTP IN support. The script engine taes it from here | 514 | // HTTP IN support. The script engine takes it from here |
499 | // Nothing to worry about for us. | 515 | // Nothing to worry about for us. |
500 | // | 516 | // |
501 | if (buffer == null) | 517 | if (buffer == null) |
@@ -609,9 +625,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
609 | { | 625 | { |
610 | m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw ", e); | 626 | m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw ", e); |
611 | } | 627 | } |
612 | catch (InvalidOperationException e) | 628 | catch (Exception e) |
613 | { | 629 | { |
614 | m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e); | 630 | m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw " + e.ToString()); |
615 | SendHTML500(response); | 631 | SendHTML500(response); |
616 | } | 632 | } |
617 | finally | 633 | finally |
@@ -619,9 +635,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
619 | // Every month or so this will wrap and give bad numbers, not really a problem | 635 | // Every month or so this will wrap and give bad numbers, not really a problem |
620 | // since its just for reporting, 200ms limit can be adjusted | 636 | // since its just for reporting, 200ms limit can be adjusted |
621 | int tickdiff = Environment.TickCount - tickstart; | 637 | int tickdiff = Environment.TickCount - tickstart; |
622 | if (tickdiff > 500) | 638 | if (tickdiff > 3000) |
623 | m_log.InfoFormat( | 639 | m_log.InfoFormat( |
624 | "[BASE HTTP SERVER]: slow request <{0}> for {1} took {2} ms", reqnum, request.RawUrl, tickdiff); | 640 | "[BASE HTTP SERVER]: slow {0} request for {1} from {2} took {3} ms", requestMethod, uriString, request.RemoteIPEndPoint.ToString(), tickdiff); |
625 | } | 641 | } |
626 | } | 642 | } |
627 | 643 | ||
diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs index 41ece86..d5646d0 100644 --- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs +++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs | |||
@@ -83,7 +83,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
83 | } | 83 | } |
84 | catch (Exception e) | 84 | catch (Exception e) |
85 | { | 85 | { |
86 | m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: " + e.ToString(), requestUrl); | 86 | m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: with {1} " + e.ToString(), requestUrl,obj); |
87 | } | 87 | } |
88 | finally | 88 | finally |
89 | { | 89 | { |
diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs index eab463c..077a1e8 100644 --- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs +++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs | |||
@@ -57,11 +57,27 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
57 | /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> | 57 | /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> |
58 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) | 58 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) |
59 | { | 59 | { |
60 | return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 100); | ||
61 | } | ||
62 | /// <summary> | ||
63 | /// Perform a synchronous REST request. | ||
64 | /// </summary> | ||
65 | /// <param name="verb"></param> | ||
66 | /// <param name="requestUrl"></param> | ||
67 | /// <param name="obj"> </param> | ||
68 | /// <param name="timeout"> </param> | ||
69 | /// <returns></returns> | ||
70 | /// | ||
71 | /// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting | ||
72 | /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> | ||
73 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout) | ||
74 | { | ||
60 | Type type = typeof (TRequest); | 75 | Type type = typeof (TRequest); |
61 | TResponse deserial = default(TResponse); | 76 | TResponse deserial = default(TResponse); |
62 | 77 | ||
63 | WebRequest request = WebRequest.Create(requestUrl); | 78 | WebRequest request = WebRequest.Create(requestUrl); |
64 | request.Method = verb; | 79 | request.Method = verb; |
80 | request.Timeout = pTimeout * 1000; | ||
65 | 81 | ||
66 | if ((verb == "POST") || (verb == "PUT")) | 82 | if ((verb == "POST") || (verb == "PUT")) |
67 | { | 83 | { |
@@ -81,7 +97,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
81 | 97 | ||
82 | int length = (int) buffer.Length; | 98 | int length = (int) buffer.Length; |
83 | request.ContentLength = length; | 99 | request.ContentLength = length; |
84 | |||
85 | Stream requestStream = null; | 100 | Stream requestStream = null; |
86 | try | 101 | try |
87 | { | 102 | { |
@@ -103,7 +118,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
103 | { | 118 | { |
104 | using (WebResponse resp = request.GetResponse()) | 119 | using (WebResponse resp = request.GetResponse()) |
105 | { | 120 | { |
106 | if (resp.ContentLength > 0) | 121 | if (resp.ContentLength != 0) |
107 | { | 122 | { |
108 | Stream respStream = resp.GetResponseStream(); | 123 | Stream respStream = resp.GetResponseStream(); |
109 | XmlSerializer deserializer = new XmlSerializer(typeof(TResponse)); | 124 | XmlSerializer deserializer = new XmlSerializer(typeof(TResponse)); |
diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index c9d4c93..ce6ecf8 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs | |||
@@ -33,7 +33,7 @@ namespace OpenSim | |||
33 | private const Flavour VERSION_FLAVOUR = Flavour.Dev; | 33 | private const Flavour VERSION_FLAVOUR = Flavour.Dev; |
34 | 34 | ||
35 | public enum Flavour | 35 | public enum Flavour |
36 | { | 36 | { |
37 | Unknown, | 37 | Unknown, |
38 | Dev, | 38 | Dev, |
39 | RC1, | 39 | RC1, |
@@ -49,7 +49,7 @@ namespace OpenSim | |||
49 | 49 | ||
50 | public static string GetVersionString(string versionNumber, Flavour flavour) | 50 | public static string GetVersionString(string versionNumber, Flavour flavour) |
51 | { | 51 | { |
52 | string versionString = "OpenSim " + versionNumber + " " + flavour; | 52 | string versionString = "Careminster " + versionNumber + " " + flavour; |
53 | return versionString.PadRight(VERSIONINFO_VERSION_LENGTH); | 53 | return versionString.PadRight(VERSIONINFO_VERSION_LENGTH); |
54 | } | 54 | } |
55 | 55 | ||