From 9a59eb892466f7e9de1766dda67e9717fdd0fadd Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 9 Dec 2014 13:35:00 +0100 Subject: [PATCH] Fix linphone_proxy_config_is_server_config_changed() to return weak-equal if the identities are weak-equal but the proxies are equal. --- coreapi/proxy.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 275613477..807a03db3 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -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);