[asterisk-commits] russell: trunk r59359 - in /trunk: ./ main/rtp.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Mar 29 10:20:43 MST 2007


Author: russell
Date: Thu Mar 29 12:20:43 2007
New Revision: 59359

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

................
r59358 | russell | 2007-03-29 12:17:41 -0500 (Thu, 29 Mar 2007) | 13 lines

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:
    trunk/   (props changed)
    trunk/main/rtp.c

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

Modified: trunk/main/rtp.c
URL: http://svn.digium.com/view/asterisk/trunk/main/rtp.c?view=diff&rev=59359&r1=59358&r2=59359
==============================================================================
--- trunk/main/rtp.c (original)
+++ trunk/main/rtp.c Thu Mar 29 12:20:43 2007
@@ -920,10 +920,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;
 	}
 
@@ -1176,10 +1178,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