From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] gatchat/gatppp.c: Add timeout handler in ppp_enter_phase
Date: Mon, 04 Jan 2016 23:28:14 -0600 [thread overview]
Message-ID: <568B546E.80503@gmail.com> (raw)
In-Reply-To: <1450860754-31695-1-git-send-email-marko.sulejic@hale.at>
[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]
Hi Marko,
On 12/23/2015 02:52 AM, Marko Šulejić wrote:
> * ppp_enter_phase calls ppp_dead if the PPP phase is PPP_PHASE_DEAD
> && ppp->sta_pending == FALSE, but fails if sta_pending is never set
> to FALSE. So a timeout handler was added to handle this case too.
> ---
> gatchat/gatppp.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
> index 5144084..f84535a 100644
> --- a/gatchat/gatppp.c
> +++ b/gatchat/gatppp.c
> @@ -361,8 +361,12 @@ static inline void ppp_enter_phase(GAtPPP *ppp, enum ppp_phase phase)
> DBG(ppp, "%d", phase);
> ppp->phase = phase;
>
> - if (phase == PPP_PHASE_DEAD && ppp->sta_pending == FALSE)
> - ppp->ppp_dead_source = g_idle_add(ppp_dead, ppp);
> + if (phase == PPP_PHASE_DEAD) {
> + if(ppp->sta_pending)
> + ppp->ppp_dead_source = g_timeout_add(5000, ppp_dead, ppp);
> + else
> + ppp->ppp_dead_source = g_idle_add(ppp_dead, ppp);
> + }
This seems wrong. sta_pending is set if we are trying to transmit a
terminate_ack. If this fails, then the peer is likely severing the
connection very shortly afterwards.
What is the sequence of events you're observing here?
Regards,
-Denis
prev parent reply other threads:[~2016-01-05 5:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 8:52 [PATCH] gatchat/gatppp.c: Add timeout handler in ppp_enter_phase Marko =?unknown-8bit?b?xaB1bGVqacSH?=
2016-01-05 5:28 ` Denis Kenzior [this message]
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=568B546E.80503@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.