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

FreeSWITCH SVN brian at freeswitch.org
Wed May 27 15:48:16 PDT 2009


Author: brian
Date: Wed May 27 17:48:16 2009
New Revision: 13472

Log:
 clean up 

Modified:
   freeswitch/trunk/src/switch_rtp.c

Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c	(original)
+++ freeswitch/trunk/src/switch_rtp.c	Wed May 27 17:48:16 2009
@@ -1923,13 +1923,12 @@
 
 #ifdef ENABLE_ZRTP
 		/* ZRTP Recv */
-
 		if (bytes && switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_RECV)) {
 			unsigned int sbytes = (int) bytes;
 			zrtp_status_t stat = 0;
-
+			
 			stat = zrtp_process_srtp(rtp_session->zrtp_ctx, (void *)&rtp_session->recv_msg, &sbytes);
-
+			
 			switch (stat) {
 			case zrtp_status_ok:
 				break;
@@ -2532,11 +2531,10 @@
 		}
 #ifdef ENABLE_ZRTP
 		/* ZRTP Send */
-
 		if (switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND)) {
 			unsigned int sbytes = (int) bytes;
 			zrtp_status_t stat = zrtp_status_fail;
-
+			
 			stat = zrtp_process_rtp(rtp_session->zrtp_ctx, (void*)send_msg, &sbytes);
 
 			switch (stat) {
@@ -2813,29 +2811,28 @@
 		bytes = sbytes;
 	}
 #ifdef ENABLE_ZRTP
-		/* ZRTP Send */
-
-		if (switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND)) {
-			unsigned int sbytes = (int) bytes;
-			zrtp_status_t stat = zrtp_status_fail;
-
-			stat = zrtp_process_rtp(rtp_session->zrtp_ctx, (void*)&rtp_session->write_msg, &sbytes);
-
-			switch (stat) {
-			case zrtp_status_ok:
-				break;
-			case zrtp_status_drop:
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection drop with code %d\n", stat);
-				break;
-			case zrtp_status_fail:
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection fail with code %d\n", stat);
-				break;
-			default:
-				break;
-			}
-			
-			bytes = sbytes;
+	/* ZRTP Send */
+	if (switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND)) {
+		unsigned int sbytes = (int) bytes;
+		zrtp_status_t stat = zrtp_status_fail;
+		
+		stat = zrtp_process_rtp(rtp_session->zrtp_ctx, (void*)&rtp_session->write_msg, &sbytes);
+		
+		switch (stat) {
+		case zrtp_status_ok:
+			break;
+		case zrtp_status_drop:
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection drop with code %d\n", stat);
+			break;
+		case zrtp_status_fail:
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection fail with code %d\n", stat);
+			break;
+		default:
+			break;
 		}
+		
+		bytes = sbytes;
+	}
 #endif
 	if (switch_socket_sendto(rtp_session->sock_output, rtp_session->remote_addr, 0, (void *) &rtp_session->write_msg, &bytes) != SWITCH_STATUS_SUCCESS) {
 		rtp_session->seq--;



More information about the Freeswitch-svn mailing list