diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-10-16 12:53:48 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-10-16 12:53:48 +0000 |
commit | 44e5ec721364e4d51ad849d23ab7982b57dd4ce6 (patch) | |
tree | 21902cc8662aa6d67827d3b74cbfbd6b786f59dc /pjmedia/src | |
parent | bc36d37799c0d7bc3d4ee15f36de27360222d89b (diff) |
Fixed bug in media UDP transport: when recv() returns error (e.g. ICMP packet is received on Windows), transport will be stopped! [thanks Tomer]
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@773 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src')
-rw-r--r-- | pjmedia/src/pjmedia/transport_udp.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pjmedia/src/pjmedia/transport_udp.c b/pjmedia/src/pjmedia/transport_udp.c index be67cfae..31fe74c6 100644 --- a/pjmedia/src/pjmedia/transport_udp.c +++ b/pjmedia/src/pjmedia/transport_udp.c @@ -410,7 +410,9 @@ static void on_rx_rtp( pj_ioqueue_key_t *key, * source packet address after several consecutive packets * have been received. */ - if ((udp->options & PJMEDIA_UDP_NO_SRC_ADDR_CHECKING)==0) { + if (bytes_read>0 && + (udp->options & PJMEDIA_UDP_NO_SRC_ADDR_CHECKING)==0) + { if ((udp->rem_rtp_addr.sin_addr.s_addr != udp->rtp_src_addr.sin_addr.s_addr) || (udp->rem_rtp_addr.sin_port != @@ -464,7 +466,7 @@ read_next_packet: &udp->rtp_src_addr, &udp->rtp_addrlen); - } while (status == PJ_SUCCESS); + } while (status != PJ_EPENDING); } @@ -494,7 +496,8 @@ static void on_rx_rtcp(pj_ioqueue_key_t *key, * remote address, and switch the address when they are * different. */ - if ((udp->options & PJMEDIA_UDP_NO_SRC_ADDR_CHECKING)==0 && + if (bytes_read>0 && + (udp->options & PJMEDIA_UDP_NO_SRC_ADDR_CHECKING)==0 && ((udp->rem_rtcp_addr.sin_addr.s_addr != udp->rtcp_src_addr.sin_addr.s_addr) || (udp->rem_rtcp_addr.sin_port != @@ -515,7 +518,7 @@ static void on_rx_rtcp(pj_ioqueue_key_t *key, &udp->rtcp_src_addr, &udp->rtcp_addr_len); - } while (status == PJ_SUCCESS); + } while (status != PJ_EPENDING); } |