Fixed ticket #368: STUN keep-alive timed out when ICE is used

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1433 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2007-09-14 09:30:25 +00:00
parent df51a28f8f
commit a5a3ea6a3b
1 changed files with 6 additions and 4 deletions

View File

@ -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,