[asterisk-commits] russell: branch 1.4 r59358 - in /branches/1.4: ./ main/rtp.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Mar 29 10:17:42 MST 2007


Author: russell
Date: Thu Mar 29 12:17:41 2007
New Revision: 59358

URL: http://svn.digium.com/view/asterisk?view=rev&rev=59358
Log:
Merged revisions 59357 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59357 | russell | 2007-03-29 12:14:33 -0500 (Thu, 29 Mar 2007) | 5 lines

If an error occurs when reading from an RTP socket, and the error code does not
indicate that we should try again, then return NULL instead of a "null frame".
This will prevent Asterisk from trying over and over again, and eventually
causing the system to crash.  (issue #8285, john)

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/main/rtp.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/main/rtp.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/rtp.c?view=diff&rev=59358&r1=59357&r2=59358
==============================================================================
--- branches/1.4/main/rtp.c (original)
+++ branches/1.4/main/rtp.c Thu Mar 29 12:17:41 2007
@@ -850,10 +850,12 @@
 	rtcpheader = (unsigned int *)(rtcpdata + AST_FRIENDLY_OFFSET);
 	
 	if (res < 0) {
-		if (errno != EAGAIN)
-			ast_log(LOG_WARNING, "RTCP Read error: %s\n", strerror(errno));
 		if (errno == EBADF)
 			CRASH;
+		if (errno != EAGAIN) {
+			ast_log(LOG_WARNING, "RTCP Read error: %s.  Hanging up.\n", strerror(errno));
+			return NULL;
+		}
 		return &ast_null_frame;
 	}
 
@@ -1105,10 +1107,12 @@
 
 	rtpheader = (unsigned int *)(rtp->rawdata + AST_FRIENDLY_OFFSET);
 	if (res < 0) {
-		if (errno != EAGAIN)
-			ast_log(LOG_WARNING, "RTP Read error: %s\n", strerror(errno));
 		if (errno == EBADF)
 			CRASH;
+		if (errno != EAGAIN) {
+			ast_log(LOG_WARNING, "RTP Read error: %s.  Hanging up.\n", strerror(errno));
+			return NULL;
+		}
 		return &ast_null_frame;
 	}
 	



More information about the asterisk-commits mailing list