Merge branch 'master' into careminster

avinationmerge
Melanie 2012-05-08 00:07:18 +01:00
commit 05634907e9
3 changed files with 38 additions and 47 deletions

View File

@ -356,7 +356,7 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[BASE HTTP SERVER]: OnRequest() failed with {0}{1}", e.Message, e.StackTrace); m_log.Error(String.Format("[BASE HTTP SERVER]: OnRequest() failed: {0} ", e.Message), e);
} }
} }
@ -551,11 +551,11 @@ namespace OpenSim.Framework.Servers.HttpServer
catch (SocketException e) catch (SocketException e)
{ {
// This has to be here to prevent a Linux/Mono crash // This has to be here to prevent a Linux/Mono crash
m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
} }
catch (IOException e) catch (IOException e)
{ {
m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}. ", e.Message), e);
} }
return; return;
@ -658,15 +658,15 @@ namespace OpenSim.Framework.Servers.HttpServer
// //
// An alternative may be to turn off all response write exceptions on the HttpListener, but let's go // An alternative may be to turn off all response write exceptions on the HttpListener, but let's go
// with the minimum first // with the minimum first
m_log.WarnFormat("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e); m_log.Warn(String.Format("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux ", e.Message), e);
} }
catch (IOException e) catch (IOException e)
{ {
m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}{1}", e.Message, e.StackTrace); m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.Message), e);
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}{1}", e.Message, e.StackTrace); m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.Message), e);
SendHTML500(response); SendHTML500(response);
} }
finally finally
@ -933,11 +933,11 @@ namespace OpenSim.Framework.Servers.HttpServer
catch (SocketException e) catch (SocketException e)
{ {
// This has to be here to prevent a Linux/Mono crash // This has to be here to prevent a Linux/Mono crash
m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
} }
catch (IOException e) catch (IOException e)
{ {
m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0} ", e.Message), e);
} }
} }
return; return;
@ -970,11 +970,11 @@ namespace OpenSim.Framework.Servers.HttpServer
catch (SocketException e) catch (SocketException e)
{ {
// This has to be here to prevent a Linux/Mono crash // This has to be here to prevent a Linux/Mono crash
m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
} }
catch (IOException e) catch (IOException e)
{ {
m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0} ", e.Message), e);
} }
} }
} }
@ -1085,12 +1085,12 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
catch (IOException e) catch (IOException e)
{ {
m_log.WarnFormat("[BASE HTTP SERVER]: LLSD IOException {0}.", e); m_log.Warn(String.Format("[BASE HTTP SERVER]: LLSD IOException {0} ", e.Message), e);
} }
catch (SocketException e) catch (SocketException e)
{ {
// This has to be here to prevent a Linux/Mono crash // This has to be here to prevent a Linux/Mono crash
m_log.WarnFormat("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux.", e); m_log.Warn(String.Format("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
} }
} }
} }
@ -1342,8 +1342,8 @@ namespace OpenSim.Framework.Servers.HttpServer
catch (SocketException f) catch (SocketException f)
{ {
// This has to be here to prevent a Linux/Mono crash // This has to be here to prevent a Linux/Mono crash
m_log.WarnFormat( m_log.Warn(
"[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", f); String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", f.Message), f);
} }
} }
catch(Exception) catch(Exception)
@ -1661,11 +1661,11 @@ namespace OpenSim.Framework.Servers.HttpServer
catch (SocketException e) catch (SocketException e)
{ {
// This has to be here to prevent a Linux/Mono crash // This has to be here to prevent a Linux/Mono crash
m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
} }
catch (IOException e) catch (IOException e)
{ {
m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0} ", e.Message), e);
} }
} }
} }
@ -1702,7 +1702,7 @@ namespace OpenSim.Framework.Servers.HttpServer
catch (SocketException e) catch (SocketException e)
{ {
// This has to be here to prevent a Linux/Mono crash // This has to be here to prevent a Linux/Mono crash
m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
} }
} }
} }
@ -1738,7 +1738,7 @@ namespace OpenSim.Framework.Servers.HttpServer
catch (SocketException e) catch (SocketException e)
{ {
// This has to be here to prevent a Linux/Mono crash // This has to be here to prevent a Linux/Mono crash
m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); m_log.Warn(String.Format("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
} }
} }
} }
@ -1817,7 +1817,7 @@ namespace OpenSim.Framework.Servers.HttpServer
public void httpServerException(object source, Exception exception) public void httpServerException(object source, Exception exception)
{ {
m_log.ErrorFormat("[BASE HTTP SERVER]: {0} had an exception {1}", source.ToString(), exception.ToString()); m_log.Error(String.Format("[BASE HTTP SERVER]: {0} had an exception: {1} ", source.ToString(), exception.Message), exception);
/* /*
if (HTTPDRunning)// && NotSocketErrors > 5) if (HTTPDRunning)// && NotSocketErrors > 5)
{ {

View File

@ -448,30 +448,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
/// Find the client for a ID /// Find the client for a ID
/// </summary> /// </summary>
public IClientAPI LocateClientObject(UUID agentID) public IClientAPI LocateClientObject(UUID agentID)
{
Scene scene = GetClientScene(agentID);
if (scene != null)
{
ScenePresence presence = scene.GetScenePresence(agentID);
if (presence != null)
return presence.ControllingClient;
}
return null;
}
/// <summary>
/// Find the scene for an agent
/// </summary>
private Scene GetClientScene(UUID agentId)
{ {
lock (m_Scenes) lock (m_Scenes)
{ {
foreach (Scene scene in m_Scenes) foreach (Scene scene in m_Scenes)
{ {
ScenePresence presence = scene.GetScenePresence(agentId); ScenePresence presence = scene.GetScenePresence(agentID);
if (presence != null && !presence.IsChildAgent) if (presence != null && !presence.IsChildAgent)
return scene; return presence.ControllingClient;
} }
} }
@ -498,7 +482,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
Util.FireAndForget( Util.FireAndForget(
delegate delegate
{ {
m_log.DebugFormat("[FRIENDS MODULE]: Notifying {0} friends", friendList.Count); m_log.DebugFormat(
"[FRIENDS MODULE]: Notifying {0} friends of {1} of online status {2}",
friendList.Count, agentID, online);
// Notify about this user status // Notify about this user status
StatusNotify(friendList, agentID, online); StatusNotify(friendList, agentID, online);
} }
@ -515,7 +502,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{ {
// Try local // Try local
if (LocalStatusNotification(userID, friendID, online)) if (LocalStatusNotification(userID, friendID, online))
return; continue;
// The friend is not here [as root]. Let's forward. // The friend is not here [as root]. Let's forward.
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
@ -523,11 +510,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{ {
PresenceInfo friendSession = null; PresenceInfo friendSession = null;
foreach (PresenceInfo pinfo in friendSessions) foreach (PresenceInfo pinfo in friendSessions)
{
if (pinfo.RegionID != UUID.Zero) // let's guard against sessions-gone-bad if (pinfo.RegionID != UUID.Zero) // let's guard against sessions-gone-bad
{ {
friendSession = pinfo; friendSession = pinfo;
break; break;
} }
}
if (friendSession != null) if (friendSession != null)
{ {

View File

@ -128,6 +128,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public const string GridInfoServiceConfigSectionName = "GridInfoService";
internal IScriptEngine m_ScriptEngine; internal IScriptEngine m_ScriptEngine;
internal ILSL_Api m_LSL_Api = null; // get a reference to the LSL API so we can call methods housed there internal ILSL_Api m_LSL_Api = null; // get a reference to the LSL API so we can call methods housed there
internal SceneObjectPart m_host; internal SceneObjectPart m_host;
@ -2041,8 +2043,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
string nick = String.Empty; string nick = String.Empty;
IConfigSource config = m_ScriptEngine.ConfigSource; IConfigSource config = m_ScriptEngine.ConfigSource;
if (config.Configs["GridInfo"] != null) if (config.Configs[GridInfoServiceConfigSectionName] != null)
nick = config.Configs["GridInfo"].GetString("gridnick", nick); nick = config.Configs[GridInfoServiceConfigSectionName].GetString("gridnick", nick);
if (String.IsNullOrEmpty(nick)) if (String.IsNullOrEmpty(nick))
nick = GridUserInfo(InfoType.Nick); nick = GridUserInfo(InfoType.Nick);
@ -2058,8 +2060,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
string name = String.Empty; string name = String.Empty;
IConfigSource config = m_ScriptEngine.ConfigSource; IConfigSource config = m_ScriptEngine.ConfigSource;
if (config.Configs["GridInfo"] != null) if (config.Configs[GridInfoServiceConfigSectionName] != null)
name = config.Configs["GridInfo"].GetString("gridname", name); name = config.Configs[GridInfoServiceConfigSectionName].GetString("gridname", name);
if (String.IsNullOrEmpty(name)) if (String.IsNullOrEmpty(name))
name = GridUserInfo(InfoType.Name); name = GridUserInfo(InfoType.Name);
@ -2075,8 +2077,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
string loginURI = String.Empty; string loginURI = String.Empty;
IConfigSource config = m_ScriptEngine.ConfigSource; IConfigSource config = m_ScriptEngine.ConfigSource;
if (config.Configs["GridInfo"] != null) if (config.Configs[GridInfoServiceConfigSectionName] != null)
loginURI = config.Configs["GridInfo"].GetString("login", loginURI); loginURI = config.Configs[GridInfoServiceConfigSectionName].GetString("login", loginURI);
if (String.IsNullOrEmpty(loginURI)) if (String.IsNullOrEmpty(loginURI))
loginURI = GridUserInfo(InfoType.Login); loginURI = GridUserInfo(InfoType.Login);
@ -2123,8 +2125,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
string retval = String.Empty; string retval = String.Empty;
IConfigSource config = m_ScriptEngine.ConfigSource; IConfigSource config = m_ScriptEngine.ConfigSource;
if (config.Configs["GridInfo"] != null) if (config.Configs[GridInfoServiceConfigSectionName] != null)
retval = config.Configs["GridInfo"].GetString(key, retval); retval = config.Configs[GridInfoServiceConfigSectionName].GetString(key, retval);
if (String.IsNullOrEmpty(retval)) if (String.IsNullOrEmpty(retval))
retval = GridUserInfo(InfoType.Custom, key); retval = GridUserInfo(InfoType.Custom, key);