Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCHv3 09/12] call-forwarding: Cache cfs on CFU removal
Date: Tue, 20 Mar 2012 19:16:27 -0500	[thread overview]
Message-ID: <4F691DDB.3060502@gmail.com> (raw)
In-Reply-To: <1331646393-5249-10-git-send-email-oleg.zhurakivskyy@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2303 bytes --]

Hi Oleg,

On 03/13/2012 08:46 AM, Oleg Zhurakivskyy wrote:
> Since the re-querying is done, cache the call forwardings.
> ---
>  src/call-forwarding.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/src/call-forwarding.c b/src/call-forwarding.c
> index 575d96d..7109c21 100644
> --- a/src/call-forwarding.c
> +++ b/src/call-forwarding.c
> @@ -38,6 +38,7 @@
>  
>  #define CALL_FORWARDING_FLAG_CACHED	0x1
>  #define CALL_FORWARDING_FLAG_CPHS_CFF	0x2
> +#define CALL_FORWARDING_FLAG_CACHE	0x4
>  

You really have to pick a better name for this flag, I really don't
understand its purpose right now.

>  /* According to 27.007 Spec */
>  #define DEFAULT_NO_REPLY_TIMEOUT 20
> @@ -635,7 +636,8 @@ static void set_query_cf_callback(const struct ofono_error *error, int total,
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
>  		ofono_error("Setting succeeded, but query failed");
> -		cf->flags &= ~CALL_FORWARDING_FLAG_CACHED;
> +		cf->flags &= ~(CALL_FORWARDING_FLAG_CACHED |
> +				CALL_FORWARDING_FLAG_CACHE);
>  		__ofono_dbus_pending_reply(&cf->pending,
>  					__ofono_error_failed(cf->pending));
>  		return;
> @@ -655,6 +657,11 @@ static void set_query_cf_callback(const struct ofono_error *error, int total,
>  		cf->flags ^= CALL_FORWARDING_FLAG_CACHED;
>  
>  	if (cf->query_next == cf->query_end) {
> +		if (cf->flags & CALL_FORWARDING_FLAG_CACHE) {
> +			cf->flags &= ~CALL_FORWARDING_FLAG_CACHE;
> +			cf->flags |= CALL_FORWARDING_FLAG_CACHED;
> +		}
> +
>  		__ofono_dbus_pending_reply(&cf->pending,
>  				dbus_message_new_method_return(cf->pending));
>  		return;
> @@ -701,12 +708,13 @@ static DBusMessage *set_property_request(struct ofono_call_forwarding *cf,
>  	cf->query_next = type;
>  
>  	if (type == CALL_FORWARDING_TYPE_UNCONDITIONAL &&
> -		ph->number[0] == '\0' && is_cfu_enabled(cf))
> +		ph->number[0] == '\0' && is_cfu_enabled(cf)) {
>  		/*
>  		 * CFU is removed, conditionals need to be updated
>  		 */
>  		cf->query_end = CALL_FORWARDING_TYPE_NOT_REACHABLE;
> -	else
> +		cf->flags |= CALL_FORWARDING_FLAG_CACHE;
> +	} else
>  		cf->query_end = type;
>  
>  	DBG("Farming off request, will be erasure: %d", ph->number[0] == '\0');

Regards,
-Denis

  reply	other threads:[~2012-03-21  0:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 13:46 [PATCHv3 00/12] Call forwarding state handling change Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 01/12] call-forwarding: Remove cf_list_clear() Oleg Zhurakivskyy
2012-03-19 19:03   ` Denis Kenzior
2012-03-13 13:46 ` [PATCHv3 02/12] call-forwarding: Inline get_query_next_cf_cond() Oleg Zhurakivskyy
2012-03-19 19:03   ` Denis Kenzior
2012-03-13 13:46 ` [PATCHv3 03/12] call-forwarding: Refactor cf_condition_find_with_cls() slightly Oleg Zhurakivskyy
2012-03-20 23:50   ` Denis Kenzior
2012-03-21 11:45     ` Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 04/12] call-forwarding: Refactor cf_find_unconditional() Oleg Zhurakivskyy
2012-03-20 23:51   ` Denis Kenzior
2012-03-21 11:46     ` Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 05/12] call-forwarding: Minor cleanup of set_query_cf_callback Oleg Zhurakivskyy
2012-03-20 23:54   ` Denis Kenzior
2012-03-21 11:47     ` Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 06/12] call-forwarding: Don't run conditional queries if cfu is active Oleg Zhurakivskyy
2012-03-21  0:09   ` Denis Kenzior
2012-03-21 11:49     ` Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 07/12] call-forwarding: Re-run conditional queries on cfu removal Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 08/12] call-forwarding: Toggle the cached flag on CFU changes Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 09/12] call-forwarding: Cache cfs on CFU removal Oleg Zhurakivskyy
2012-03-21  0:16   ` Denis Kenzior [this message]
2012-03-21 11:51     ` Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 10/12] call-forwarding: Re-run ss path cfs queries on cfu changes Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 11/12] call-forwarding: Cache cfs on all/all conditional removal Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 12/12] TODO: Remove completed call forwarding state task Oleg Zhurakivskyy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F691DDB.3060502@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox