[ekiga/v4_0] h323-endpoint: assign gk_name only if success



commit 5dce2bfafbfb90ffcafd2909425be0c4b1328165
Author: VÃctor Manuel JÃquez Leal <vjaquez igalia com>
Date:   Fri Dec 21 17:43:22 2012 +0100

    h323-endpoint: assign gk_name only if success
    
    Only if the method H323EndPoint::UseGatekeeper() is successful, the
    address of the gatekeeper will be assigned to the gk_name flag
    attribute.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690618

 lib/engine/components/opal/h323-endpoint.cpp |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/lib/engine/components/opal/h323-endpoint.cpp b/lib/engine/components/opal/h323-endpoint.cpp
index 8a1768c..bfeb23d 100644
--- a/lib/engine/components/opal/h323-endpoint.cpp
+++ b/lib/engine/components/opal/h323-endpoint.cpp
@@ -373,12 +373,16 @@ Opal::H323::EndPoint::UseGatekeeper (const PString & address,
                                      const PString & domain,
                                      const PString & iface)
 {
-  bool result =
-    H323EndPoint::UseGatekeeper (address, domain, iface);
+  bool result = false;
 
-  PWaitAndSignal m(gk_name_mutex);
+  if (!IsRegisteredWithGatekeeper (address)) {
+    result = H323EndPoint::UseGatekeeper (address, domain, iface);
 
-  gk_name = address;
+    if (result) {
+      PWaitAndSignal m(gk_name_mutex);
+      gk_name = address;
+    }
+  }
 
   return result;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]