diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 90ab982..971c0b7 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -908,15 +908,6 @@ namespace OpenSim.Framework | |||
908 | } | 908 | } |
909 | } | 909 | } |
910 | 910 | ||
911 | public class SynchronousRestObjectPoster | ||
912 | { | ||
913 | [Obsolete] | ||
914 | public static TResponse BeginPostObject<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) | ||
915 | { | ||
916 | return SynchronousRestObjectRequester.MakeRequest<TRequest, TResponse>(verb, requestUrl, obj); | ||
917 | } | ||
918 | } | ||
919 | |||
920 | public class SynchronousRestObjectRequester | 911 | public class SynchronousRestObjectRequester |
921 | { | 912 | { |
922 | private static readonly ILog m_log = | 913 | private static readonly ILog m_log = |
@@ -989,9 +980,6 @@ namespace OpenSim.Framework | |||
989 | { | 980 | { |
990 | using (HttpWebResponse resp = (HttpWebResponse)request.GetResponse()) | 981 | using (HttpWebResponse resp = (HttpWebResponse)request.GetResponse()) |
991 | { | 982 | { |
992 | if (resp.StatusCode == HttpStatusCode.NotFound) | ||
993 | return deserial; | ||
994 | |||
995 | if (resp.ContentLength != 0) | 983 | if (resp.ContentLength != 0) |
996 | { | 984 | { |
997 | Stream respStream = resp.GetResponseStream(); | 985 | Stream respStream = resp.GetResponseStream(); |
@@ -1001,9 +989,19 @@ namespace OpenSim.Framework | |||
1001 | } | 989 | } |
1002 | else | 990 | else |
1003 | m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb); | 991 | m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb); |
1004 | |||
1005 | } | 992 | } |
1006 | } | 993 | } |
994 | catch (WebException e) | ||
995 | { | ||
996 | HttpWebResponse hwr = (HttpWebResponse)e.Response; | ||
997 | |||
998 | if (hwr != null && hwr.StatusCode == HttpStatusCode.NotFound) | ||
999 | return deserial; | ||
1000 | else | ||
1001 | m_log.ErrorFormat( | ||
1002 | "[SynchronousRestObjectRequester]: WebException {0} {1} {2} {3}", | ||
1003 | requestUrl, typeof(TResponse).ToString(), e.Message, e.StackTrace); | ||
1004 | } | ||
1007 | catch (System.InvalidOperationException) | 1005 | catch (System.InvalidOperationException) |
1008 | { | 1006 | { |
1009 | // This is what happens when there is invalid XML | 1007 | // This is what happens when there is invalid XML |