diff options
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs | 19 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/VersionInfo.cs | 4 |
2 files changed, 19 insertions, 4 deletions
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 c88e0d1..4ae370b 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs | |||
@@ -29,11 +29,11 @@ namespace OpenSim | |||
29 | { | 29 | { |
30 | public class VersionInfo | 30 | public class VersionInfo |
31 | { | 31 | { |
32 | private const string VERSION_NUMBER = "0.7.1"; | 32 | private const string VERSION_NUMBER = "0.7.1CM"; |
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, |