aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/HypergridService/HGInstantMessageService.cs
diff options
context:
space:
mode:
authorDiva Canto2011-06-07 10:51:12 -0700
committerDiva Canto2011-06-07 10:51:12 -0700
commitf5d82350bb622baa6f49042882e6c5cb49b24cc0 (patch)
tree1a81ac14685a3b826467a2f6c96a9738b9046c42 /OpenSim/Services/HypergridService/HGInstantMessageService.cs
parentMore on the hunt for the slow down on HGFriendsModule. - Don't requests the o... (diff)
downloadopensim-SC_OLD-f5d82350bb622baa6f49042882e6c5cb49b24cc0.zip
opensim-SC_OLD-f5d82350bb622baa6f49042882e6c5cb49b24cc0.tar.gz
opensim-SC_OLD-f5d82350bb622baa6f49042882e6c5cb49b24cc0.tar.bz2
opensim-SC_OLD-f5d82350bb622baa6f49042882e6c5cb49b24cc0.tar.xz
This fixes the crash reported in http://opensimulator.org/mantis/view.php?id=5529 related to sending IMs to foreign friends who are offline. Hopefully.
Diffstat (limited to 'OpenSim/Services/HypergridService/HGInstantMessageService.cs')
-rw-r--r--OpenSim/Services/HypergridService/HGInstantMessageService.cs28
1 files changed, 12 insertions, 16 deletions
diff --git a/OpenSim/Services/HypergridService/HGInstantMessageService.cs b/OpenSim/Services/HypergridService/HGInstantMessageService.cs
index 66cf4de..90a0bf2 100644
--- a/OpenSim/Services/HypergridService/HGInstantMessageService.cs
+++ b/OpenSim/Services/HypergridService/HGInstantMessageService.cs
@@ -185,7 +185,6 @@ namespace OpenSim.Services.HypergridService
185 { 185 {
186 lookupAgent = true; 186 lookupAgent = true;
187 upd = null; 187 upd = null;
188 url = string.Empty;
189 } 188 }
190 } 189 }
191 else 190 else
@@ -221,19 +220,16 @@ namespace OpenSim.Services.HypergridService
221 url = m_UserAgentService.LocateUser(toAgentID); 220 url = m_UserAgentService.LocateUser(toAgentID);
222 } 221 }
223 222
224 if (upd != null || url != string.Empty) 223 // check if we've tried this before..
224 // This is one way to end the recursive loop
225 //
226 if (!firstTime && ((previousLocation is PresenceInfo && upd != null && upd.RegionID == ((PresenceInfo)previousLocation).RegionID) ||
227 (previousLocation is string && upd == null && previousLocation.Equals(url))))
225 { 228 {
226 // check if we've tried this before.. 229 // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message");
227 // This is one way to end the recursive loop 230 m_log.DebugFormat("[HG IM SERVICE]: Fail 2 {0} {1}", previousLocation, url);
228 //
229 if (!firstTime && ((previousLocation is PresenceInfo && upd != null && upd.RegionID == ((PresenceInfo)previousLocation).RegionID) ||
230 (previousLocation is string && upd == null && previousLocation.Equals(url))))
231 {
232 // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message");
233 m_log.DebugFormat("[HG IM SERVICE]: Fail 2 {0} {1}", previousLocation, url);
234 231
235 return false; 232 return false;
236 }
237 } 233 }
238 } 234 }
239 235
@@ -332,10 +328,6 @@ namespace OpenSim.Services.HypergridService
332 else 328 else
333 { 329 {
334 // try again, but lookup user this time. 330 // try again, but lookup user this time.
335 // Warning, this must call the Async version
336 // of this method or we'll be making thousands of threads
337 // The version within the spawned thread is SendGridInstantMessageViaXMLRPCAsync
338 // The version that spawns the thread is SendGridInstantMessageViaXMLRPC
339 331
340 // This is recursive!!!!! 332 // This is recursive!!!!!
341 return TrySendInstantMessage(im, url, false, foreigner); 333 return TrySendInstantMessage(im, url, false, foreigner);
@@ -348,13 +340,17 @@ namespace OpenSim.Services.HypergridService
348 if (m_RestURL != string.Empty && (im.offline != 0) 340 if (m_RestURL != string.Empty && (im.offline != 0)
349 && (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) 341 && (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages)))
350 { 342 {
343 m_log.DebugFormat("[HG IM SERVICE]: Message saved");
351 return SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( 344 return SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>(
352 "POST", m_RestURL + "/SaveMessage/", im); 345 "POST", m_RestURL + "/SaveMessage/", im);
353 346
354 } 347 }
355 348
356 else 349 else
350 {
351 m_log.DebugFormat("[HG IM SERVICE]: No offline IM service, message not saved");
357 return false; 352 return false;
353 }
358 } 354 }
359 } 355 }
360} 356}