[asterisk-scf-commits] asterisk-scf/integration/bridging.git branch "retry_deux" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Apr 12 12:44:31 CDT 2012


branch "retry_deux" has been updated
       via  9e272ccc9084f8a4aabdf1e172ad204a454bfba7 (commit)
      from  937db791a5ae711b267c9ea3b36d372b78993bb3 (commit)

Summary of changes:
 src/BridgeImpl.cpp                     |   12 ++++++----
 src/BridgeImpl.h                       |   13 ++++++-----
 src/BridgeManagerImpl.cpp              |   36 +++++++++++++++++--------------
 src/BridgeReplicatorStateListenerI.cpp |    1 +
 4 files changed, 35 insertions(+), 27 deletions(-)


- Log -----------------------------------------------------------------
commit 9e272ccc9084f8a4aabdf1e172ad204a454bfba7
Author: Brent Eagles <beagles at digium.com>
Date:   Thu Apr 12 15:13:21 2012 -0230

    Fixed a couple of silly bugs. One where the amd callback wasn't being set
    with the new getContext usage and another where I forgot to set the
    initiating operation context for bridge creation.

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 4858b23..bf715cf 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -2634,15 +2634,17 @@ BridgeListenerStateItemPtr BridgeImpl::createFirstListenerUpdate(const BridgeLis
 
 IceUtil::Handle<AsteriskSCF::BridgeService::BridgeServant>
 AsteriskSCF::BridgeService::BridgeServant::create(const string& name, const Ice::ObjectAdapterPtr& objectAdapter,
-        const vector<BridgeListenerPrx>& listeners,
-        const AsteriskSCF::BridgeService::BridgeListenerMgrPtr& listenerMgr,
-        const AsteriskSCF::Replication::BridgeService::V1::PartyIdHooksPtr& partyIdHooks,
-        const ReplicatorSmartPrx& replicator,
-        const Logger& logger)
+    const vector<BridgeListenerPrx>& listeners,
+    const AsteriskSCF::BridgeService::BridgeListenerMgrPtr& listenerMgr,
+    const AsteriskSCF::Replication::BridgeService::V1::PartyIdHooksPtr& partyIdHooks,
+    const ReplicatorSmartPrx& replicator,
+    const AsteriskSCF::System::V1::OperationContextPtr& originatingContext,
+    const Logger& logger)
 {
     BridgeStateItemPtr state(new AsteriskSCF::Replication::BridgeService::V1::BridgeStateItem);
     state->runningState = Running;
     state->serial = SerialCounterStart;
+    state->originatingContext = originatingContext;
 
     //
     // FWIW: there does not seem to be any way to alter the set once
diff --git a/src/BridgeImpl.h b/src/BridgeImpl.h
index afa2205..3b26505 100644
--- a/src/BridgeImpl.h
+++ b/src/BridgeImpl.h
@@ -145,12 +145,13 @@ public:
      *
      **/
     static IceUtil::Handle<BridgeServant> create(const std::string& name,
-            const Ice::ObjectAdapterPtr& objectAdapter,
-            const std::vector<AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx>& listeners,
-            const AsteriskSCF::BridgeService::BridgeListenerMgrPtr& listenerMgr,
-            const AsteriskSCF::Replication::BridgeService::V1::PartyIdHooksPtr& partyIdHooks,
-            const ReplicatorSmartPrx& replicator, 
-            const AsteriskSCF::System::Logging::Logger& logger);
+        const Ice::ObjectAdapterPtr& objectAdapter,
+        const std::vector<AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx>& listeners,
+        const AsteriskSCF::BridgeService::BridgeListenerMgrPtr& listenerMgr,
+        const AsteriskSCF::Replication::BridgeService::V1::PartyIdHooksPtr& partyIdHooks,
+        const ReplicatorSmartPrx& replicator,
+        const AsteriskSCF::System::V1::OperationContextPtr& originatingContext,
+        const AsteriskSCF::System::Logging::Logger& logger);
 
     /**
      * 
diff --git a/src/BridgeManagerImpl.cpp b/src/BridgeManagerImpl.cpp
index 952b366..94f39ed 100755
--- a/src/BridgeManagerImpl.cpp
+++ b/src/BridgeManagerImpl.cpp
@@ -258,6 +258,7 @@ void BridgeManagerImpl::createBridge_async(const AMD_BridgeManager_createBridgeP
     // cookie was inserted via replication. 
     // 
     bool replicaRetry = data.first && (data.second->callbackCount() == 0);
+    data.second->addCB(callback);
 
     //
     // If we've figured that we are replica retry or we weren't in the
@@ -368,7 +369,7 @@ void BridgeManagerImpl::createBridge_async(const AMD_BridgeManager_createBridgeP
                     // creation hooks.
                     //
                     bridge = BridgeServant::create(stringId, mAdapter, listeners, mgr, 
-                        mPartyIdExtensionPoint->getHooks(), mReplicationContext->getReplicator(), mLogger);
+                        mPartyIdExtensionPoint->getHooks(), mReplicationContext->getReplicator(), context, mLogger);
 
                     Ice::Identity id = mAdapter->getCommunicator()->stringToIdentity(stringId);
                     
@@ -826,29 +827,32 @@ void BridgeManagerImpl::createBridgeReplica(const BridgeStateItemPtr& state)
 {
     std::pair<bool, CreateBridgeContextDataPtr> data(
         getContextSync<CreateBridgeContextDataPtr>(mOperationCache, state->originatingContext));
-
-    assert(data.second);
-    mLogger(Trace) << FUNLOG;
-    boost::unique_lock<boost::shared_mutex> lock(mLock);
-    Ice::Identity id(mAdapter->getCommunicator()->stringToIdentity(state->bridgeId));
-    BridgePrx prx(BridgePrx::uncheckedCast(mAdapter->createProxy(id)));
-    BridgeListenerMgrPtr mgr(new BridgeListenerMgr(mAdapter->getCommunicator(), state->bridgeId, prx));
+    BridgePrx prx;
+    {
+        assert(data.second);
+        mLogger(Trace) << FUNLOG;
+        boost::unique_lock<boost::shared_mutex> lock(mLock);
+        Ice::Identity id(mAdapter->getCommunicator()->stringToIdentity(state->bridgeId));
+        BridgePrx prx(BridgePrx::uncheckedCast(mAdapter->createProxy(id)));
+        BridgeListenerMgrPtr mgr(new BridgeListenerMgr(mAdapter->getCommunicator(), state->bridgeId, prx));
     
-    BridgeServantPtr bridge = BridgeServant::create(mAdapter, mgr, mReplicationContext->getReplicator(), mLogger, state);
-    Ice::ObjectPrx obj = mAdapter->add(bridge, id);
+        BridgeServantPtr bridge = BridgeServant::create(mAdapter, mgr, mReplicationContext->getReplicator(), mLogger, state);
+        Ice::ObjectPrx obj = mAdapter->add(bridge, id);
     
-    mLogger(Info) << ": creating bridge replica " << obj->ice_toString() << "." ;
-    BridgeInfo info;
-    info.servant = bridge;
-    info.proxy = BridgePrx::uncheckedCast(obj);
-    mBridges.push_back(info);
+        mLogger(Info) << ": creating bridge replica " << obj->ice_toString() << "." ;
+        BridgeInfo info;
+        info.servant = bridge;
+        info.proxy = BridgePrx::uncheckedCast(obj);
+        prx = info.proxy;
+        mBridges.push_back(info);
+    }
 
     //
     // While we have a result for any subsequent createBridge_async
     // requests, we need to make sure that the entire operation
     // completes. createBridge_async needs to take special care here. 
     //
-    data.second->setResult(info.proxy);
+    data.second->setResult(prx);
 }
     
 void BridgeManagerImpl::removeBridge(const string& bridgeId)
diff --git a/src/BridgeReplicatorStateListenerI.cpp b/src/BridgeReplicatorStateListenerI.cpp
index 44169ea..b6390ba 100644
--- a/src/BridgeReplicatorStateListenerI.cpp
+++ b/src/BridgeReplicatorStateListenerI.cpp
@@ -157,6 +157,7 @@ public:
     {
         for (ReplicatedStateItemSeq::const_iterator i = items.begin(); i != items.end(); ++i)
         {
+            assert(*i);
             mLogger(Trace) << " received update " << (*i)->serial << " for " << (*i)->key << " (a " <<
                 (*i)->ice_id() << ")";
             ReplicatedStateItemPtr existingItem;

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list