mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 11:28:25 +00:00
Add ast_assert(), which can be used to handle fatal errors. It is only compiled
in if dev-mode is enabled, and only aborts if DO_CRASH is defined. (inspired by issue #12650) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@116463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -855,8 +855,7 @@ struct ast_frame *ast_rtcp_read(struct ast_rtp *rtp)
|
||||
rtcpheader = (unsigned int *)(rtcpdata + AST_FRIENDLY_OFFSET);
|
||||
|
||||
if (res < 0) {
|
||||
if (errno == EBADF)
|
||||
CRASH;
|
||||
ast_assert(errno != EBADF);
|
||||
if (errno != EAGAIN) {
|
||||
ast_log(LOG_WARNING, "RTCP Read error: %s. Hanging up.\n", strerror(errno));
|
||||
return NULL;
|
||||
@@ -1134,8 +1133,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
|
||||
|
||||
rtpheader = (unsigned int *)(rtp->rawdata + AST_FRIENDLY_OFFSET);
|
||||
if (res < 0) {
|
||||
if (errno == EBADF)
|
||||
CRASH;
|
||||
ast_assert(errno != EBADF);
|
||||
if (errno != EAGAIN) {
|
||||
ast_log(LOG_WARNING, "RTP Read error: %s. Hanging up.\n", strerror(errno));
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user