Merge branch 'master' into htb-throttle

prioritization
Melanie 2009-10-07 03:01:11 +01:00
commit 6f2d183107
2 changed files with 63 additions and 17 deletions

View File

@ -124,9 +124,11 @@ namespace OpenSim.Framework.Communications.Clients
// Let's wait for the response // Let's wait for the response
//m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall"); //m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall");
WebResponse webResponse = null;
StreamReader sr = null;
try try
{ {
WebResponse webResponse = AgentCreateRequest.GetResponse(); webResponse = AgentCreateRequest.GetResponse();
if (webResponse == null) if (webResponse == null)
{ {
m_log.Info("[REST COMMS]: Null reply on DoCreateChildAgentCall post"); m_log.Info("[REST COMMS]: Null reply on DoCreateChildAgentCall post");
@ -134,9 +136,8 @@ namespace OpenSim.Framework.Communications.Clients
else else
{ {
StreamReader sr = new StreamReader(webResponse.GetResponseStream()); sr = new StreamReader(webResponse.GetResponseStream());
string response = sr.ReadToEnd().Trim(); string response = sr.ReadToEnd().Trim();
sr.Close();
m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", response); m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", response);
if (!String.IsNullOrEmpty(response)) if (!String.IsNullOrEmpty(response))
@ -167,6 +168,11 @@ namespace OpenSim.Framework.Communications.Clients
m_log.InfoFormat("[REST COMMS]: exception on reply of DoCreateChildAgentCall {0}", ex.Message); m_log.InfoFormat("[REST COMMS]: exception on reply of DoCreateChildAgentCall {0}", ex.Message);
// ignore, really // ignore, really
} }
finally
{
if (sr != null)
sr.Close();
}
return true; return true;
@ -246,15 +252,17 @@ namespace OpenSim.Framework.Communications.Clients
// Let's wait for the response // Let's wait for the response
//m_log.Info("[REST COMMS]: Waiting for a reply after ChildAgentUpdate"); //m_log.Info("[REST COMMS]: Waiting for a reply after ChildAgentUpdate");
WebResponse webResponse = null;
StreamReader sr = null;
try try
{ {
WebResponse webResponse = ChildUpdateRequest.GetResponse(); webResponse = ChildUpdateRequest.GetResponse();
if (webResponse == null) if (webResponse == null)
{ {
m_log.Info("[REST COMMS]: Null reply on ChilAgentUpdate post"); m_log.Info("[REST COMMS]: Null reply on ChilAgentUpdate post");
} }
StreamReader sr = new StreamReader(webResponse.GetResponseStream()); sr = new StreamReader(webResponse.GetResponseStream());
//reply = sr.ReadToEnd().Trim(); //reply = sr.ReadToEnd().Trim();
sr.ReadToEnd().Trim(); sr.ReadToEnd().Trim();
sr.Close(); sr.Close();
@ -266,6 +274,11 @@ namespace OpenSim.Framework.Communications.Clients
m_log.InfoFormat("[REST COMMS]: exception on reply of ChilAgentUpdate {0}", ex.Message); m_log.InfoFormat("[REST COMMS]: exception on reply of ChilAgentUpdate {0}", ex.Message);
// ignore, really // ignore, really
} }
finally
{
if (sr != null)
sr.Close();
}
return true; return true;
} }
@ -284,6 +297,7 @@ namespace OpenSim.Framework.Communications.Clients
HttpWebResponse webResponse = null; HttpWebResponse webResponse = null;
string reply = string.Empty; string reply = string.Empty;
StreamReader sr = null;
try try
{ {
webResponse = (HttpWebResponse)request.GetResponse(); webResponse = (HttpWebResponse)request.GetResponse();
@ -292,9 +306,8 @@ namespace OpenSim.Framework.Communications.Clients
m_log.Info("[REST COMMS]: Null reply on agent get "); m_log.Info("[REST COMMS]: Null reply on agent get ");
} }
StreamReader sr = new StreamReader(webResponse.GetResponseStream()); sr = new StreamReader(webResponse.GetResponseStream());
reply = sr.ReadToEnd().Trim(); reply = sr.ReadToEnd().Trim();
sr.Close();
//Console.WriteLine("[REST COMMS]: ChilAgentUpdate reply was " + reply); //Console.WriteLine("[REST COMMS]: ChilAgentUpdate reply was " + reply);
@ -305,6 +318,11 @@ namespace OpenSim.Framework.Communications.Clients
// ignore, really // ignore, really
return false; return false;
} }
finally
{
if (sr != null)
sr.Close();
}
if (webResponse.StatusCode == HttpStatusCode.OK) if (webResponse.StatusCode == HttpStatusCode.OK)
{ {
@ -333,6 +351,7 @@ namespace OpenSim.Framework.Communications.Clients
request.Method = "DELETE"; request.Method = "DELETE";
request.Timeout = 10000; request.Timeout = 10000;
StreamReader sr = null;
try try
{ {
WebResponse webResponse = request.GetResponse(); WebResponse webResponse = request.GetResponse();
@ -341,7 +360,7 @@ namespace OpenSim.Framework.Communications.Clients
m_log.Info("[REST COMMS]: Null reply on agent delete "); m_log.Info("[REST COMMS]: Null reply on agent delete ");
} }
StreamReader sr = new StreamReader(webResponse.GetResponseStream()); sr = new StreamReader(webResponse.GetResponseStream());
//reply = sr.ReadToEnd().Trim(); //reply = sr.ReadToEnd().Trim();
sr.ReadToEnd().Trim(); sr.ReadToEnd().Trim();
sr.Close(); sr.Close();
@ -353,6 +372,11 @@ namespace OpenSim.Framework.Communications.Clients
m_log.InfoFormat("[REST COMMS]: exception on reply of agent delete {0}", ex.Message); m_log.InfoFormat("[REST COMMS]: exception on reply of agent delete {0}", ex.Message);
// ignore, really // ignore, really
} }
finally
{
if (sr != null)
sr.Close();
}
return true; return true;
} }
@ -377,6 +401,7 @@ namespace OpenSim.Framework.Communications.Clients
request.Method = "DELETE"; request.Method = "DELETE";
request.Timeout = 10000; request.Timeout = 10000;
StreamReader sr = null;
try try
{ {
WebResponse webResponse = request.GetResponse(); WebResponse webResponse = request.GetResponse();
@ -385,7 +410,7 @@ namespace OpenSim.Framework.Communications.Clients
m_log.Info("[REST COMMS]: Null reply on agent delete "); m_log.Info("[REST COMMS]: Null reply on agent delete ");
} }
StreamReader sr = new StreamReader(webResponse.GetResponseStream()); sr = new StreamReader(webResponse.GetResponseStream());
//reply = sr.ReadToEnd().Trim(); //reply = sr.ReadToEnd().Trim();
sr.ReadToEnd().Trim(); sr.ReadToEnd().Trim();
sr.Close(); sr.Close();
@ -397,6 +422,11 @@ namespace OpenSim.Framework.Communications.Clients
m_log.InfoFormat("[REST COMMS]: exception on reply of agent delete {0}", ex.Message); m_log.InfoFormat("[REST COMMS]: exception on reply of agent delete {0}", ex.Message);
// ignore, really // ignore, really
} }
finally
{
if (sr != null)
sr.Close();
}
return true; return true;
} }
@ -463,6 +493,7 @@ namespace OpenSim.Framework.Communications.Clients
// Let's wait for the response // Let's wait for the response
//m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall"); //m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall");
StreamReader sr = null;
try try
{ {
WebResponse webResponse = ObjectCreateRequest.GetResponse(); WebResponse webResponse = ObjectCreateRequest.GetResponse();
@ -471,10 +502,9 @@ namespace OpenSim.Framework.Communications.Clients
m_log.Info("[REST COMMS]: Null reply on DoCreateObjectCall post"); m_log.Info("[REST COMMS]: Null reply on DoCreateObjectCall post");
} }
StreamReader sr = new StreamReader(webResponse.GetResponseStream()); sr = new StreamReader(webResponse.GetResponseStream());
//reply = sr.ReadToEnd().Trim(); //reply = sr.ReadToEnd().Trim();
sr.ReadToEnd().Trim(); sr.ReadToEnd().Trim();
sr.Close();
//m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", reply); //m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", reply);
} }
@ -483,6 +513,11 @@ namespace OpenSim.Framework.Communications.Clients
m_log.InfoFormat("[REST COMMS]: exception on reply of DoCreateObjectCall {0}", ex.Message); m_log.InfoFormat("[REST COMMS]: exception on reply of DoCreateObjectCall {0}", ex.Message);
// ignore, really // ignore, really
} }
finally
{
if (sr != null)
sr.Close();
}
return true; return true;
@ -542,6 +577,7 @@ namespace OpenSim.Framework.Communications.Clients
// Let's wait for the response // Let's wait for the response
//m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall"); //m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall");
StreamReader sr = null;
try try
{ {
WebResponse webResponse = ObjectCreateRequest.GetResponse(); WebResponse webResponse = ObjectCreateRequest.GetResponse();
@ -550,10 +586,9 @@ namespace OpenSim.Framework.Communications.Clients
m_log.Info("[REST COMMS]: Null reply on DoCreateObjectCall post"); m_log.Info("[REST COMMS]: Null reply on DoCreateObjectCall post");
} }
StreamReader sr = new StreamReader(webResponse.GetResponseStream()); sr = new StreamReader(webResponse.GetResponseStream());
sr.ReadToEnd().Trim(); sr.ReadToEnd().Trim();
sr.ReadToEnd().Trim(); sr.ReadToEnd().Trim();
sr.Close();
//m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", reply); //m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", reply);
@ -563,6 +598,11 @@ namespace OpenSim.Framework.Communications.Clients
m_log.InfoFormat("[REST COMMS]: exception on reply of DoCreateObjectCall {0}", ex.Message); m_log.InfoFormat("[REST COMMS]: exception on reply of DoCreateObjectCall {0}", ex.Message);
// ignore, really // ignore, really
} }
finally
{
if (sr != null)
sr.Close();
}
return true; return true;
@ -630,6 +670,7 @@ namespace OpenSim.Framework.Communications.Clients
// Let's wait for the response // Let's wait for the response
//m_log.Info("[REST COMMS]: Waiting for a reply after DoHelloNeighbourCall"); //m_log.Info("[REST COMMS]: Waiting for a reply after DoHelloNeighbourCall");
StreamReader sr = null;
try try
{ {
WebResponse webResponse = HelloNeighbourRequest.GetResponse(); WebResponse webResponse = HelloNeighbourRequest.GetResponse();
@ -638,10 +679,9 @@ namespace OpenSim.Framework.Communications.Clients
m_log.Info("[REST COMMS]: Null reply on DoHelloNeighbourCall post"); m_log.Info("[REST COMMS]: Null reply on DoHelloNeighbourCall post");
} }
StreamReader sr = new StreamReader(webResponse.GetResponseStream()); sr = new StreamReader(webResponse.GetResponseStream());
//reply = sr.ReadToEnd().Trim(); //reply = sr.ReadToEnd().Trim();
sr.ReadToEnd().Trim(); sr.ReadToEnd().Trim();
sr.Close();
//m_log.InfoFormat("[REST COMMS]: DoHelloNeighbourCall reply was {0} ", reply); //m_log.InfoFormat("[REST COMMS]: DoHelloNeighbourCall reply was {0} ", reply);
} }
@ -650,6 +690,11 @@ namespace OpenSim.Framework.Communications.Clients
m_log.InfoFormat("[REST COMMS]: exception on reply of DoHelloNeighbourCall {0}", ex.Message); m_log.InfoFormat("[REST COMMS]: exception on reply of DoHelloNeighbourCall {0}", ex.Message);
// ignore, really // ignore, really
} }
finally
{
if (sr != null)
sr.Close();
}
return true; return true;

View File

@ -1168,6 +1168,7 @@ namespace OpenSim.Region.Framework.Scenes
private void SendInventoryUpdate(IClientAPI client, InventoryFolderBase folder, bool fetchFolders, bool fetchItems) private void SendInventoryUpdate(IClientAPI client, InventoryFolderBase folder, bool fetchFolders, bool fetchItems)
{ {
m_log.DebugFormat("[AGENT INVENTORY]: Send Inventory Folder {0} Update to {1} {2}", folder.Name, client.FirstName, client.LastName);
InventoryCollection contents = InventoryService.GetFolderContent(client.AgentId, folder.ID); InventoryCollection contents = InventoryService.GetFolderContent(client.AgentId, folder.ID);
client.SendInventoryFolderDetails(client.AgentId, folder.ID, contents.Items, contents.Folders, fetchFolders, fetchItems); client.SendInventoryFolderDetails(client.AgentId, folder.ID, contents.Items, contents.Folders, fetchFolders, fetchItems);
} }