* Tweaked WebUtil.PostToService() to help debug an object disposed exception

prebuild-update
John Hurliman 2010-07-29 14:39:08 -07:00
parent 696b6c727f
commit 550c3572a1
1 changed files with 4 additions and 3 deletions

View File

@ -139,8 +139,9 @@ namespace OpenSim.Framework
request.ContentLength = requestData.Length; request.ContentLength = requestData.Length;
request.ContentType = "application/x-www-form-urlencoded"; request.ContentType = "application/x-www-form-urlencoded";
using (Stream requestStream = request.GetRequestStream()) Stream requestStream = request.GetRequestStream();
requestStream.Write(requestData, 0, requestData.Length); requestStream.Write(requestData, 0, requestData.Length);
requestStream.Close();
using (WebResponse response = request.GetResponse()) using (WebResponse response = request.GetResponse())
{ {
@ -169,7 +170,7 @@ namespace OpenSim.Framework
} }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Warn("POST to URL " + url + " failed: " + ex.Message); m_log.Warn("POST to URL " + url + " failed: " + ex);
errorMessage = ex.Message; errorMessage = ex.Message;
} }