]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
clean up
authorBrian West <brian@freeswitch.org>
Wed, 27 May 2009 22:48:16 +0000 (22:48 +0000)
committerBrian West <brian@freeswitch.org>
Wed, 27 May 2009 22:48:16 +0000 (22:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13472 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_rtp.c

index d0a3922bc45a77a5be17635386c87b0dcfe452ed..db4e9ad80be9573ce65c955474515600e4881824 100644 (file)
@@ -1923,13 +1923,12 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
 
 #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 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
                }
 #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 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session,
                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--;