ekiga r7842 - trunk/lib/engine/components/opal



Author: jpuydt
Date: Thu Apr  2 20:27:32 2009
New Revision: 7842
URL: http://svn.gnome.org/viewvc/ekiga?rev=7842&view=rev

Log:
Fixed bug #577524 (locking in sip-endpoint.cpp)

Modified:
   trunk/lib/engine/components/opal/sip-endpoint.cpp
   trunk/lib/engine/components/opal/sip-endpoint.h

Modified: trunk/lib/engine/components/opal/sip-endpoint.cpp
==============================================================================
--- trunk/lib/engine/components/opal/sip-endpoint.cpp	(original)
+++ trunk/lib/engine/components/opal/sip-endpoint.cpp	Thu Apr  2 20:27:32 2009
@@ -262,6 +262,7 @@
 void
 Opal::Sip::EndPoint::fetch (const std::string _uri)
 {
+  PWaitAndSignal mut(listsMutex);
   std::string::size_type loc = _uri.find ("@", 0);
   std::string domain;
 
@@ -289,6 +290,7 @@
 void
 Opal::Sip::EndPoint::unfetch (const std::string uri)
 {
+  PWaitAndSignal mut(listsMutex);
   if (std::find (subscribed_uris.begin (), subscribed_uris.end (), uri) != subscribed_uris.end ()) {
 
     Subscribe (SIPSubscribe::Presence, 0, PString (uri.c_str ()));
@@ -301,6 +303,7 @@
 void
 Opal::Sip::EndPoint::publish (const Ekiga::PersonalDetails & details)
 {
+  PWaitAndSignal mut(listsMutex);
   std::string hostname = (const char *) PIPSocket::GetHostName ();
   std::string presence = ((Ekiga::PersonalDetails &) (details)).get_presence ();
   std::string status = ((Ekiga::PersonalDetails &) (details)).get_status ();
@@ -564,6 +567,7 @@
 			       bool is_enabled,
 			       unsigned timeout)
 {
+  PWaitAndSignal mut(listsMutex);
   PString _aor;
   std::stringstream aor;
   std::string host(host_);
@@ -603,6 +607,7 @@
 Opal::Sip::EndPoint::OnRegistered (const PString & _aor,
 				   bool was_registering)
 {
+  PWaitAndSignal mut(listsMutex);
   std::string aor = (const char *) _aor;
   std::string::size_type found;
   std::string::size_type loc = aor.find ("@", 0);

Modified: trunk/lib/engine/components/opal/sip-endpoint.h
==============================================================================
--- trunk/lib/engine/components/opal/sip-endpoint.h	(original)
+++ trunk/lib/engine/components/opal/sip-endpoint.h	Thu Apr  2 20:27:32 2009
@@ -217,6 +217,7 @@
 
       CallManager & manager;
 
+      PMutex listsMutex;
       std::list<std::string> to_subscribe_uris;  // List of uris to subscribe
       std::list<std::string> subscribed_uris;    // List of subscribed uris
       std::list<std::string> aors;               // List of registered aor



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