aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-02 16:54:03 -0700
committerJohn Hurliman2009-10-02 16:54:03 -0700
commit3ab6c8965247755d1865a4dbb937ab57e9f553b2 (patch)
tree42ce2c7373c95100cdf24ffeae74fc7c624deeac
parent* Removed code that is no longer used with Melanie's queue callback optimization (diff)
parentMerge branch 'diva-textures-osgrid' of ssh://diva@opensimulator.org/var/git/o... (diff)
downloadopensim-SC_OLD-3ab6c8965247755d1865a4dbb937ab57e9f553b2.zip
opensim-SC_OLD-3ab6c8965247755d1865a4dbb937ab57e9f553b2.tar.gz
opensim-SC_OLD-3ab6c8965247755d1865a4dbb937ab57e9f553b2.tar.bz2
opensim-SC_OLD-3ab6c8965247755d1865a4dbb937ab57e9f553b2.tar.xz
Merge branch 'diva-textures-osgrid' of ssh://opensimulator.org/var/git/opensim into diva-textures-osgrid
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs26
1 files changed, 20 insertions, 6 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs b/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs
index fe69ad3..48e1370 100644
--- a/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs
+++ b/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs
@@ -91,24 +91,31 @@ namespace OpenSim.Framework.Servers.HttpServer
91 Stream requestStream = request.EndGetRequestStream(res); 91 Stream requestStream = request.EndGetRequestStream(res);
92 92
93 requestStream.Write(buffer.ToArray(), 0, length); 93 requestStream.Write(buffer.ToArray(), 0, length);
94 requestStream.Close();
94 95
95 request.BeginGetResponse(delegate(IAsyncResult ar) 96 request.BeginGetResponse(delegate(IAsyncResult ar)
96 { 97 {
97 response = request.EndGetResponse(ar); 98 response = request.EndGetResponse(ar);
98 99 Stream respStream = null;
99 try 100 try
100 { 101 {
101 deserial = (TResponse) deserializer.Deserialize( 102 respStream = response.GetResponseStream();
102 response.GetResponseStream()); 103 deserial = (TResponse)deserializer.Deserialize(
104 respStream);
103 } 105 }
104 catch (System.InvalidOperationException) 106 catch (System.InvalidOperationException)
105 { 107 {
106 } 108 }
109 finally
110 {
111 respStream.Close();
112 response.Close();
113 }
107 114
108 action(deserial); 115 action(deserial);
109 }, null); 116 }, null);
110 }, null); 117 }, null);
111 118
112 return; 119 return;
113 } 120 }
114 121
@@ -119,14 +126,21 @@ namespace OpenSim.Framework.Servers.HttpServer
119 // If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't 126 // If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't
120 // documented in MSDN 127 // documented in MSDN
121 response = request.EndGetResponse(res2); 128 response = request.EndGetResponse(res2);
122 129
130 Stream respStream = null;
123 try 131 try
124 { 132 {
125 deserial = (TResponse)deserializer.Deserialize(response.GetResponseStream()); 133 respStream = response.GetResponseStream();
134 deserial = (TResponse)deserializer.Deserialize(respStream);
126 } 135 }
127 catch (System.InvalidOperationException) 136 catch (System.InvalidOperationException)
128 { 137 {
129 } 138 }
139 finally
140 {
141 respStream.Close();
142 response.Close();
143 }
130 } 144 }
131 catch (WebException e) 145 catch (WebException e)
132 { 146 {