You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by jo...@apache.org on 2010/11/11 04:02:13 UTC

svn commit: r1033807 - /shindig/trunk/features/src/main/javascript/features/rpc/rpc.js

Author: johnh
Date: Thu Nov 11 03:02:12 2010
New Revision: 1033807

URL: http://svn.apache.org/viewvc?rev=1033807&view=rev
Log:
A few additional sibling-call changes to gadgets.rpc, ensuring end-to-end functionality.

Patch provided by Jun Yang.


Modified:
    shindig/trunk/features/src/main/javascript/features/rpc/rpc.js

Modified: shindig/trunk/features/src/main/javascript/features/rpc/rpc.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js?rev=1033807&r1=1033806&r2=1033807&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/rpc/rpc.js (original)
+++ shindig/trunk/features/src/main/javascript/features/rpc/rpc.js Thu Nov 11 03:02:12 2010
@@ -829,7 +829,9 @@ if (!gadgets.rpc) { // make lib resilien
           l: useLegacyProtocol[targetId]
         };
 
-        if (targetId !== '..' && !document.getElementById(targetId)) {
+        if (targetId !== '..' &&
+            parseSiblingId(targetId) == null &&  // sibling never in the document
+            !document.getElementById(targetId)) {
           // The target has been removed from the DOM. Don't even try.
           gadgets.log('WARNING: attempted send to nonexistent frame: ' + targetId);
           return;
@@ -843,7 +845,9 @@ if (!gadgets.rpc) { // make lib resilien
         // Attempt to make call via a cross-domain transport.
         // Retrieve the transport for the given target - if one
         // target is misconfigured, it won't affect the others.
-        var channel = receiverTx[targetId];
+        // In the case of a sibling relay, channel is not found
+        // in the receiverTx map but in the transport itself.
+        var channel = receiverTx[targetId] || transport;
 
         if (!channel) {
           // Not set up yet. Enqueue the rpc for such time as it is.