ekiga r6569 - in trunk: . src/endpoints



Author: dsandras
Date: Mon Aug 11 18:45:59 2008
New Revision: 6569
URL: http://svn.gnome.org/viewvc/ekiga?rev=6569&view=rev

Log:
Fixed NAT detection logic in case of error and make sure the signal is
not triggered in the thread.


Modified:
   trunk/ChangeLog
   trunk/src/endpoints/manager.cpp

Modified: trunk/src/endpoints/manager.cpp
==============================================================================
--- trunk/src/endpoints/manager.cpp	(original)
+++ trunk/src/endpoints/manager.cpp	Mon Aug 11 18:45:59 2008
@@ -81,6 +81,15 @@
   {
     this->Resume ();
   };
+
+  ~StunDetector ()
+  {
+    if (!nat_error.empty ()) {
+      while (!core.errors.handle_request (nat_error)) {
+        PThread::Current ()->Sleep (100);
+      }
+    }
+  }
   
   void Main () 
   {
@@ -89,20 +98,19 @@
         || type == PSTUNClient::BlockedNat 
         || type == PSTUNClient::PartialBlockedNat) {
 
-      std::string nat_error =  _("The type of NAT that has been detected is not compatible "
-                                 "with Ekiga. "
-                                 "Please refer to our WIKI on http://wiki.ekiga.org to solve that problem.");
+      nat_error =  _("The type of NAT that has been detected is not compatible "
+                     "with Ekiga. "
+                     "Please refer to our WIKI on http://wiki.ekiga.org to solve that problem.");
+
 
-      // FIXME: this is a hack
-      while (!core.errors.handle_request (nat_error)) {
-        PThread::Current ()->Sleep (100);
-      }
     }
+    else {
 
-    for (Ekiga::CallManager::iterator iter = manager.begin ();
-         iter != manager.end ();
-         iter++) 
-      (*iter)->set_listen_port ((*iter)->get_listen_interface ().port);
+      for (Ekiga::CallManager::iterator iter = manager.begin ();
+           iter != manager.end ();
+           iter++) 
+        (*iter)->set_listen_port ((*iter)->get_listen_interface ().port);
+    }
 
     runtime.run_in_main (sigc::bind (sigc::ptr_fun (manager_ready_in_main),
 				     &manager));
@@ -113,6 +121,7 @@
   Ekiga::CallCore & core;
   Opal::CallManager & manager;
   Ekiga::Runtime & runtime;
+  std::string nat_error;
 };
 
 



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