[Top][All Lists]

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

[Linphone-developers] liblinphone proxy and Linphone-iphone timer patche

From: Eli Burke
Subject: [Linphone-developers] liblinphone proxy and Linphone-iphone timer patches
Date: Wed, 24 Apr 2013 16:38:53 -0400

A function in liblinphone called linphone_proxy_config_edit() is responsible 
for UNREGISTERing a user when account settings change. This entails sending a 
brand new REGISTRATION to the remote server and setting the expire time to 0. 
In situations where the user's credentials are invalid, an unnecessary 
UNREGISTER is sent and can result in the display of an invalid error message.  
(for example, if the user enters a bad password and then corrects it). I 
modified the function so that it would not unregister the user when 
Registration had failed.

Making this change in liblinphone revealed a race condition in Linphone-iPhone. 
It occurs when the user's changed account settings are synchronized. A call to 
linphone_core_set_sip_transports() ultimately results in a call to 
eXosip_quit() / eXosip_init() which tears down the network connection and 
re-initializes it. Meanwhile, the LinphoneManager object is periodically 
calling a function called linphone_core_iterate(), which eventually calls down 
to eXosip_event_wait(). 

If a context switch occurs at the wrong time, the call to eXosip_quit will free 
up allocated memory, and then eXosip_event_wait will try to use 
eXosip.j_socketctl_event (now uninitialized) and Linphone goes boom. My fix was 
to add a methods to stop and start the iterate timer, and to turn it off when 
the account settings are being synchronized. 

Attachment: proxy.c.patch
Description: Binary data

Attachment: LinphoneTimer.patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]