Fix linphone_proxy_config_is_server_config_changed() to return weak-equal if the identities are weak-equal but the proxies are equal.

This commit is contained in:
Ghislain MARY 2014-12-09 13:35:00 +01:00
parent bff27f5c6d
commit 9a59eb8924

View file

@ -62,13 +62,20 @@ LinphoneProxyConfigAddressComparisonResult linphone_proxy_config_address_equal(c
LinphoneProxyConfigAddressComparisonResult linphone_proxy_config_is_server_config_changed(const LinphoneProxyConfig* obj) {
LinphoneAddress *current_identity=obj->reg_identity?linphone_address_new(obj->reg_identity):NULL;
LinphoneAddress *current_proxy=obj->reg_proxy?linphone_address_new(obj->reg_proxy):NULL;
LinphoneProxyConfigAddressComparisonResult result=LinphoneProxyConfigAddressDifferent;
LinphoneProxyConfigAddressComparisonResult result_identity;
LinphoneProxyConfigAddressComparisonResult result;
result = linphone_proxy_config_address_equal(obj->saved_identity,current_identity);
if (result == LinphoneProxyConfigAddressDifferent) goto end;
result_identity = result;
result = linphone_proxy_config_address_equal(obj->saved_proxy,current_proxy);
if (result == LinphoneProxyConfigAddressDifferent) goto end;
/** If the proxies are equal use the result of the difference between the identities,
* otherwise the result is weak-equal and so weak-equal must be returned even if the
* identities were equal.
*/
if (result == LinphoneProxyConfigAddressEqual) result = result_identity;
end:
if (current_identity) linphone_address_destroy(current_identity);