Hopefully fixed the forward slash bug in the gridurl set up

0.1-prestable
MW 2007-04-20 13:44:17 +00:00
parent 9b6a97ae5d
commit 84700807c7
1 changed files with 16 additions and 7 deletions

View File

@ -58,14 +58,23 @@ namespace OpenSim
reqtext += "</Root>"; reqtext += "</Root>";
byte[] reqdata = (new System.Text.ASCIIEncoding()).GetBytes(reqtext); byte[] reqdata = (new System.Text.ASCIIEncoding()).GetBytes(reqtext);
string newpath = "";
if (this.GridURL.EndsWith("/"))
{
newpath = this.GridURL + "sims/";
}
else
{
newpath = this.GridURL + "/sims/";
}
WebRequest GridSaveReq = WebRequest.Create(this.GridURL + "sims/" + this.SimUUID.ToString()); WebRequest GridSaveReq = WebRequest.Create(newpath + this.SimUUID.ToString());
GridSaveReq.Method = "POST"; GridSaveReq.Method = "POST";
GridSaveReq.ContentType = "application/x-www-form-urlencoded"; GridSaveReq.ContentType = "application/x-www-form-urlencoded";
GridSaveReq.ContentLength = reqdata.Length; GridSaveReq.ContentLength = reqdata.Length;
Stream stOut = GridSaveReq.GetRequestStream(); Stream stOut = GridSaveReq.GetRequestStream();
stOut.Write(reqdata,0,reqdata.Length); stOut.Write(reqdata, 0, reqdata.Length);
stOut.Close(); stOut.Close();
WebResponse gridresp = GridSaveReq.GetResponse(); WebResponse gridresp = GridSaveReq.GetResponse();