[Freeswitch-svn] [commit] r13286 - freeswitch/trunk/src

FreeSWITCH SVN anthm at freeswitch.org
Tue May 12 09:46:16 PDT 2009


Author: anthm
Date: Tue May 12 11:46:16 2009
New Revision: 13286

Log:
FSCORE-365

Modified:
   freeswitch/trunk/src/switch_apr.c
   freeswitch/trunk/src/switch_rtp.c

Modified: freeswitch/trunk/src/switch_apr.c
==============================================================================
--- freeswitch/trunk/src/switch_apr.c	(original)
+++ freeswitch/trunk/src/switch_apr.c	Tue May 12 11:46:16 2009
@@ -786,15 +786,23 @@
 
 SWITCH_DECLARE(switch_status_t) switch_pollset_add(switch_pollset_t *pollset, const switch_pollfd_t *descriptor)
 {
+	if (!pollset) {
+		return SWITCH_STATUS_FALSE;
+	}
+	
 	return apr_pollset_add((apr_pollset_t *)pollset, (const apr_pollfd_t *)descriptor);
 }
 
 SWITCH_DECLARE(switch_status_t) switch_poll(switch_pollfd_t *aprset, int32_t numsock, int32_t *nsds, switch_interval_time_t timeout)
 {
-	apr_status_t st = apr_poll((apr_pollfd_t *)aprset, numsock, nsds, timeout);
-
-	if (st == APR_TIMEUP) {
-		st = SWITCH_STATUS_TIMEOUT;
+	apr_status_t st = SWITCH_STATUS_FALSE;
+	
+	if (aprset) {
+		st = apr_poll((apr_pollfd_t *)aprset, numsock, nsds, timeout);
+
+		if (st == APR_TIMEUP) {
+			st = SWITCH_STATUS_TIMEOUT;
+		}
 	}
 
 	return st;

Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c	(original)
+++ freeswitch/trunk/src/switch_rtp.c	Tue May 12 11:46:16 2009
@@ -1475,7 +1475,8 @@
 		int do_cng = 0;
 
 		if (rtp_session->timer.interval) {
-			if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOFLUSH) || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH)) {
+			if ((switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOFLUSH) || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH)) &&
+				rtp_session->read_pollfd) {
 				if (switch_poll(rtp_session->read_pollfd, 1, &fdr, 1) == SWITCH_STATUS_SUCCESS) {
 					hot_socket = 1;
 				}
@@ -1487,7 +1488,7 @@
 
 	recvfrom:
 
-		if (!rtp_session->timer.interval) {
+		if (!rtp_session->timer.interval && rtp_session->read_pollfd) {
 			poll_status = switch_poll(rtp_session->read_pollfd, 1, &fdr, poll_sec * 1000000);
 		} 
 		



More information about the Freeswitch-svn mailing list