aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ThirdParty
diff options
context:
space:
mode:
authorlbsa712008-09-08 14:30:35 +0000
committerlbsa712008-09-08 14:30:35 +0000
commit8388fe0669f9d140028d1925284491b21a09a1bf (patch)
tree80c7729bef9b88a371c3f561322a97faf262ade6 /ThirdParty
parentMantis #2144 (diff)
downloadopensim-SC_OLD-8388fe0669f9d140028d1925284491b21a09a1bf.zip
opensim-SC_OLD-8388fe0669f9d140028d1925284491b21a09a1bf.tar.gz
opensim-SC_OLD-8388fe0669f9d140028d1925284491b21a09a1bf.tar.bz2
opensim-SC_OLD-8388fe0669f9d140028d1925284491b21a09a1bf.tar.xz
* some if inversions and added {}'s for readability
Diffstat (limited to 'ThirdParty')
-rw-r--r--ThirdParty/3Di/LoadBalancer/TcpServer.cs8
-rw-r--r--ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs60
2 files changed, 34 insertions, 34 deletions
diff --git a/ThirdParty/3Di/LoadBalancer/TcpServer.cs b/ThirdParty/3Di/LoadBalancer/TcpServer.cs
index fd5e9e2..376c0a5 100644
--- a/ThirdParty/3Di/LoadBalancer/TcpServer.cs
+++ b/ThirdParty/3Di/LoadBalancer/TcpServer.cs
@@ -159,14 +159,14 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
159 159
160 state.ms_ptr.Seek(0, SeekOrigin.End); 160 state.ms_ptr.Seek(0, SeekOrigin.End);
161 // call loadbarancer function 161 // call loadbarancer function
162 if (PacketHandler != null) 162 if (PacketHandler == null)
163 { 163 {
164 //MainLog.Instance.Verbose("TCPSERVER", "calling PacketHandler"); 164 //MainLog.Instance.Verbose("TCPSERVER", "PacketHandler not found");
165 PacketHandler(state.header, packet);
166 } 165 }
167 else 166 else
168 { 167 {
169 //MainLog.Instance.Verbose("TCPSERVER", "PacketHandler not found"); 168 //MainLog.Instance.Verbose("TCPSERVER", "calling PacketHandler");
169 PacketHandler(state.header, packet);
170 } 170 }
171 171
172 int read_size = state.header.numbytes + TcpClient.internalPacketHeaderSize; 172 int read_size = state.header.numbytes + TcpClient.internalPacketHeaderSize;
diff --git a/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs b/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs
index e65e7e5..a1476fa 100644
--- a/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs
+++ b/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs
@@ -396,36 +396,7 @@ namespace OpenSim.ApplicationPlugins.RegionProxy
396 //m_log.ErrorFormat("[PROXY] Got message from {0} in thread {1}, size {2}", senderEP, sd.clientEP, numBytes); 396 //m_log.ErrorFormat("[PROXY] Got message from {0} in thread {1}, size {2}", senderEP, sd.clientEP, numBytes);
397 EndPoint client = proxy_map.GetClient(senderEP); 397 EndPoint client = proxy_map.GetClient(senderEP);
398 398
399 if (client != null) 399 if (client == null)
400 {
401 try
402 {
403 client = ProxyCodec.DecodeProxyMessage(buffer, ref numBytes);
404 try
405 {
406 // This message comes from a region object, forward it to the its client
407 sd.server.SendTo(buffer, numBytes, SocketFlags.None, client);
408 //m_log.InfoFormat("[PROXY] Sending region message from {0} to {1}, size {2}", senderEP, client, numBytes);
409 }
410 catch (Exception e)
411 {
412 OpenPort(sd); // reopen the port just in case
413 m_log.ErrorFormat("[PROXY] Failed sending region message from {0} to {1}", senderEP, client);
414 m_log.Error("[PROXY]" + e.Message);
415 m_log.Error("[PROXY]" + e.StackTrace);
416 return;
417 }
418 }
419 catch (Exception e)
420 {
421 OpenPort(sd); // reopen the port just in case
422 m_log.ErrorFormat("[PROXY] Failed decoding region message from {0}", senderEP);
423 m_log.Error("[PROXY]" + e.Message);
424 m_log.Error("[PROXY]" + e.StackTrace);
425 return;
426 }
427 }
428 else
429 { 400 {
430 // This message comes from a client object, forward it to the the region(s) 401 // This message comes from a client object, forward it to the the region(s)
431 ProxyCodec.EncodeProxyMessage(buffer, ref numBytes, senderEP); 402 ProxyCodec.EncodeProxyMessage(buffer, ref numBytes, senderEP);
@@ -454,6 +425,35 @@ namespace OpenSim.ApplicationPlugins.RegionProxy
454 } 425 }
455 } 426 }
456 } 427 }
428 else
429 {
430 try
431 {
432 client = ProxyCodec.DecodeProxyMessage(buffer, ref numBytes);
433 try
434 {
435 // This message comes from a region object, forward it to the its client
436 sd.server.SendTo(buffer, numBytes, SocketFlags.None, client);
437 //m_log.InfoFormat("[PROXY] Sending region message from {0} to {1}, size {2}", senderEP, client, numBytes);
438 }
439 catch (Exception e)
440 {
441 OpenPort(sd); // reopen the port just in case
442 m_log.ErrorFormat("[PROXY] Failed sending region message from {0} to {1}", senderEP, client);
443 m_log.Error("[PROXY]" + e.Message);
444 m_log.Error("[PROXY]" + e.StackTrace);
445 return;
446 }
447 }
448 catch (Exception e)
449 {
450 OpenPort(sd); // reopen the port just in case
451 m_log.ErrorFormat("[PROXY] Failed decoding region message from {0}", senderEP);
452 m_log.Error("[PROXY]" + e.Message);
453 m_log.Error("[PROXY]" + e.StackTrace);
454 return;
455 }
456 }
457 } 457 }
458 458
459 #region Nested type: ProxyMap 459 #region Nested type: ProxyMap