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 2009/08/25 10:14:17 UTC

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

Author: johnh
Date: Tue Aug 25 08:14:17 2009
New Revision: 807516

URL: http://svn.apache.org/viewvc?rev=807516&view=rev
Log:
Use fallbackTransport (logging transport) on a per-gadget basis. This prevents initialization failure of a single gadget from killing rpc across all gadgets.

transport.init(...) failure continues to affect global rpc function.


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

Modified: incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js?rev=807516&r1=807515&r2=807516&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js Tue Aug 25 08:14:17 2009
@@ -341,8 +341,8 @@
       window.setTimeout(function() { setupFrame(frameId, token) },
                         SETUP_FRAME_TIMEOUT);
     } else {
-      // Fail: fall back.
-      transport = fallbackTransport;
+      // Fail: fall back for this gadget.
+      receiverTx[frameId] = fallbackTransport;
       setup[frameId] = true;
     }
   }
@@ -438,7 +438,7 @@
       // gadget -> container communication. Running here ensures
       // that relayUri info will be available.
       if (transport.setup('..') === false) {
-        transport = fallbackTransport;
+        receiverTx['..'] = fallbackTransport;
       }
     }
 
@@ -561,7 +561,9 @@
       }
 
       // Attempt to make call via a cross-domain transport.
-      var channel = useEarlyQueueing ? receiverTx[targetId] : transport;
+      // Retrieve the transport for the given target - if one
+      // target is misconfigured, it won't affect the others.
+      var channel = receiverTx[targetId] ? receiverTx[targetId] : transport;
 
       if (!channel) {
         // Not set up yet. Enqueue the rpc for such time as it is.
@@ -581,7 +583,7 @@
 
       if (channel.call(targetId, from, rpc) === false) {
         // Fall back to IFPC. This behavior may be removed as IFPC is as well.
-        transport = fallbackTransport;
+        receiverTx[targetId] = fallbackTransport;
         transport.call(targetId, from, rpc);
       }
     },