From cc53580ba4bb688baf75159d728c03ccfc568aec Mon Sep 17 00:00:00 2001 From: gareth Date: Thu, 12 Apr 2007 18:34:17 +0000 Subject: aaaaaaarrrrrrrrrggggghhhhhhhh why oh why? --- OpenSim.RegionServer/RegionInfo.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'OpenSim.RegionServer') diff --git a/OpenSim.RegionServer/RegionInfo.cs b/OpenSim.RegionServer/RegionInfo.cs index 1256b50..9958f1a 100644 --- a/OpenSim.RegionServer/RegionInfo.cs +++ b/OpenSim.RegionServer/RegionInfo.cs @@ -54,19 +54,23 @@ namespace OpenSim reqtext += "" + this.RegionLocY.ToString() + ""; reqtext += "1"; reqtext += ""; + + byte[] reqdata = (new System.Text.ASCIIEncoding()).GetBytes(reqtext); WebRequest GridSaveReq = WebRequest.Create(this.GridURL + "sims/" + this.SimUUID.ToString()); GridSaveReq.Method = "POST"; - GridSaveReq.ContentType = "text/plaintext"; - GridSaveReq.ContentLength = reqtext.Length; + GridSaveReq.ContentType = "application/x-www-form-urlencoded"; + GridSaveReq.ContentLength = reqdata.Length; - StreamWriter stOut = new StreamWriter(GridSaveReq.GetRequestStream(), System.Text.Encoding.ASCII); - stOut.Write(reqtext); + Stream stOut = GridSaveReq.GetRequestStream(); + stOut.Write(reqdata,0,reqdata.Length); stOut.Close(); - StreamReader stIn = new StreamReader(GridSaveReq.GetResponse().GetResponseStream()); + WebResponse gridresp = GridSaveReq.GetResponse(); + StreamReader stIn = new StreamReader(gridresp.GetResponseStream()); string GridResponse = stIn.ReadToEnd(); stIn.Close(); + gridresp.Close(); OpenSim.Framework.Console.MainConsole.Instance.WriteLine("RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse); } -- cgit v1.1