[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "sip-configuration-refactor" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu May 12 09:36:47 CDT 2011


branch "sip-configuration-refactor" has been updated
       via  b93e702fc1d052914fc9e0637bcc5013547cf7eb (commit)
      from  66e5749ebbdb3b8efa2e0facb8c93f5c718f4c33 (commit)

Summary of changes:
 src/SipConfiguration.cpp |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit b93e702fc1d052914fc9e0637bcc5013547cf7eb
Author: Brent Eagles <beagles at digium.com>
Date:   Thu May 12 12:06:07 2011 -0230

    Fix replacement bug in update operation.

diff --git a/src/SipConfiguration.cpp b/src/SipConfiguration.cpp
index 0354964..2a67362 100644
--- a/src/SipConfiguration.cpp
+++ b/src/SipConfiguration.cpp
@@ -348,10 +348,10 @@ public:
      */
     ~UDPTransportConfig()
     {
-	if (mTransport)
-	{
-	    pjsip_transport_shutdown(mTransport);
-	}
+        if (mTransport)
+        {
+            pjsip_transport_shutdown(mTransport);
+        }
     };
 
     SipConfigurationItemVisitorPtr getVisitor()
@@ -778,7 +778,15 @@ public:
             v = createGroupTemplate(group);
         }
         performSerialCheck(group->configurationItems, v->configurationItems);
-        v->configurationItems.insert(group->configurationItems.begin(), group->configurationItems.end());
+        for (ConfigurationItemDict::const_iterator i = group->configurationItems.begin();
+            i != group->configurationItems.end(); ++i)
+        {
+            //
+            // Using the index operator allows us to effectively overwrite or add the value
+            // as opposed to erasing/inserting.
+            //
+            v->configurationItems[i->first] = i->second;
+        }
         return updateGroup(v);
     }
 

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list