提交 c1fdae08 authored 作者: Brian West's avatar Brian West

update

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1105 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 82c19073
...@@ -284,7 +284,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_create(switch_rtp **new_rtp_session, ...@@ -284,7 +284,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_create(switch_rtp **new_rtp_session,
policy.key = (uint8_t *) key; policy.key = (uint8_t *) key;
policy.next = NULL; policy.next = NULL;
policy.rtp.sec_serv = sec_serv_conf_and_auth; policy.rtp.sec_serv = sec_serv_conf_and_auth;
policy.rtcp.sec_serv = sec_serv_none; /* we don't do RTCP anyway */ policy.rtcp.sec_serv = sec_serv_conf_and_auth;
/* /*
* read key from hexadecimal on command line into an octet string * read key from hexadecimal on command line into an octet string
...@@ -464,7 +464,8 @@ static int rtp_common_read(switch_rtp *rtp_session, void *data, int *payload_typ ...@@ -464,7 +464,8 @@ static int rtp_common_read(switch_rtp *rtp_session, void *data, int *payload_typ
for(;;) { for(;;) {
bytes = sizeof(rtp_msg_t); bytes = sizeof(rtp_msg_t);
status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *)&rtp_session->recv_msg, &bytes); 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_SECURE)) {
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_SECURE) && bytes > 0) {
int sbytes = (int)bytes; int sbytes = (int)bytes;
srtp_unprotect(rtp_session->recv_ctx, &rtp_session->send_msg, &sbytes); srtp_unprotect(rtp_session->recv_ctx, &rtp_session->send_msg, &sbytes);
bytes = sbytes; bytes = sbytes;
...@@ -491,10 +492,14 @@ static int rtp_common_read(switch_rtp *rtp_session, void *data, int *payload_typ ...@@ -491,10 +492,14 @@ static int rtp_common_read(switch_rtp *rtp_session, void *data, int *payload_typ
} }
} }
if (bytes <= 0) { if (status == SWITCH_STATUS_BREAK || bytes == 0) {
return 0; return 0;
} }
if (bytes < 0) {
return bytes;
}
if (rtp_session->recv_msg.header.version != 2) { if (rtp_session->recv_msg.header.version != 2) {
if (rtp_session->recv_msg.header.version == 0 && rtp_session->ice_user) { if (rtp_session->recv_msg.header.version == 0 && rtp_session->ice_user) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论