Add known identity informatio nto log message if an exception is thrown during LLUDPServer.HandleUseCircuitCode()

iar_mods
Justin Clark-Casey (justincc) 2012-02-16 01:25:54 +00:00
parent c0760f9f91
commit df960d5767
1 changed files with 53 additions and 36 deletions

View File

@ -903,20 +903,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void HandleUseCircuitCode(object o) private void HandleUseCircuitCode(object o)
{ {
// DateTime startTime = DateTime.Now; IPEndPoint remoteEndPoint;
IClientAPI client;
try
{
// DateTime startTime = DateTime.Now;
object[] array = (object[])o; object[] array = (object[])o;
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0]; UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1]; UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint); m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint; remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
AuthenticateResponse sessionInfo; AuthenticateResponse sessionInfo;
if (IsClientAuthorized(uccp, out sessionInfo)) if (IsClientAuthorized(uccp, out sessionInfo))
{ {
// Begin the process of adding the client to the simulator // Begin the process of adding the client to the simulator
IClientAPI client client
= AddClient( = AddClient(
uccp.CircuitCode.Code, uccp.CircuitCode.Code,
uccp.CircuitCode.ID, uccp.CircuitCode.ID,
@ -942,8 +947,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
// m_log.DebugFormat( // m_log.DebugFormat(
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", // "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); // buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[LLUDPSERVER]: UseCircuitCode handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}",
remoteEndPoint != null ? remoteEndPoint.ToString() : "n/a",
client != null ? client.Name : "unknown",
client != null ? client.AgentId : "unknown",
e.Message,
e.StackTrace);
}
} }
/// <summary> /// <summary>