diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-09-14 09:30:25 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-09-14 09:30:25 +0000 |
commit | d418ada288892e835119f82a9a9819e1fd842115 (patch) | |
tree | 9209faa46c1e5e8692508601856a144089c92372 /pjnath | |
parent | b406b0f53717127c81e7d4110ea50a0a2e25bbab (diff) |
Fixed ticket #368: STUN keep-alive timed out when ICE is used
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1433 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath')
-rw-r--r-- | pjnath/src/pjnath/ice_strans.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pjnath/src/pjnath/ice_strans.c b/pjnath/src/pjnath/ice_strans.c index d789b993..e66b154a 100644 --- a/pjnath/src/pjnath/ice_strans.c +++ b/pjnath/src/pjnath/ice_strans.c @@ -476,9 +476,9 @@ static void on_read_complete(pj_ioqueue_key_t *key, PJ_STUN_IS_DATAGRAM); if (status == PJ_SUCCESS) { - if (ice_st->ice==NULL && - (comp->stun_sess && - pj_memcmp(comp->pkt+8, comp->ka_tsx_id, 12) == 0)) + if (comp->stun_sess && + PJ_STUN_IS_RESPONSE(((pj_stun_msg_hdr*)comp->pkt)->type) && + pj_memcmp(comp->pkt+8, comp->ka_tsx_id, 12) == 0) { status = pj_stun_session_on_rx_pkt(comp->stun_sess, comp->pkt, bytes_read, @@ -499,7 +499,9 @@ static void on_read_complete(pj_ioqueue_key_t *key, &comp->src_addr, comp->src_addr_len); } else { - /* This must have been a very late STUN reponse */ + /* This must have been a very late STUN reponse, + * or an early STUN Binding Request when our local + * ICE has not been created yet. */ } } else { (*ice_st->cb.on_rx_data)(ice_st, comp->comp_id, |