* [PATCH] gatchat/gatppp.c: Add timeout handler in ppp_enter_phase
@ 2015-12-23 8:52 Marko =?unknown-8bit?b?xaB1bGVqacSH?=
2016-01-05 5:28 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Marko =?unknown-8bit?b?xaB1bGVqacSH?= @ 2015-12-23 8:52 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 960 bytes --]
* 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);
+ }
}
void ppp_set_auth(GAtPPP *ppp, const guint8* auth_data)
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gatchat/gatppp.c: Add timeout handler in ppp_enter_phase
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
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2016-01-05 5:28 UTC (permalink / raw)
To: ofono
[-- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-05 5:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.