git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1342 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2006-05-04 01:15:38 +00:00
parent a92ae5b64b
commit e61acfba16
3 changed files with 12 additions and 2 deletions

View File

@@ -523,7 +523,11 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
bytes = sizeof(rtp_msg_t);
status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *)&rtp_session->recv_msg, &bytes);
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK)) {
switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_BREAK);
return 0;
}
if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) {
return -1;
}
@@ -621,6 +625,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_read(switch_rtp_t *rtp_session, void
if (bytes < 0) {
*datalen = 0;
return SWITCH_STATUS_GENERR;
} else if (bytes == 0) {
*datalen = 0;
return SWITCH_STATUS_BREAK;
} else {
bytes -= rtp_header_len;
}