summaryrefslogtreecommitdiff
path: root/toxav/rtp.c
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2014-05-24 16:02:01 +0200
committermannol <eniz_vukovic@hotmail.com>2014-05-24 16:02:01 +0200
commit565e95301f19884b3597404f41c06566cf5f9dc0 (patch)
tree162864fe2d4dabe70c10ad7a624f52d76abad56c /toxav/rtp.c
parent9db41e7582baf15d650376e8afc38dd6146492a8 (diff)
Tests works and some fixes
Diffstat (limited to 'toxav/rtp.c')
-rwxr-xr-xtoxav/rtp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toxav/rtp.c b/toxav/rtp.c
index 1a42f99e..f8f5b63b 100755
--- a/toxav/rtp.c
+++ b/toxav/rtp.c
@@ -588,7 +588,7 @@ int rtp_handle_packet ( void *object, uint8_t *data, uint32_t length )
588 _session->queue_size++; 588 _session->queue_size++;
589 589
590 pthread_mutex_unlock(&_session->mutex); 590 pthread_mutex_unlock(&_session->mutex);
591 591
592 return 0; 592 return 0;
593} 593}
594 594
@@ -778,13 +778,12 @@ int rtp_send_msg ( RTPSession *session, Messenger *messenger, const uint8_t *dat
778 int encrypted_length = encrypt_data_symmetric( /* TODO: msg->length - 2 (fix this properly)*/ 778 int encrypted_length = encrypt_data_symmetric( /* TODO: msg->length - 2 (fix this properly)*/
779 (uint8_t *) session->encrypt_key, _calculated, msg->data + 2, msg->length, _send_data + 3 ); 779 (uint8_t *) session->encrypt_key, _calculated, msg->data + 2, msg->length, _send_data + 3 );
780 780
781 int full_length = encrypted_length + 3;
782 781
783 _send_data[1] = msg->data[0]; 782 _send_data[1] = msg->data[0];
784 _send_data[2] = msg->data[1]; 783 _send_data[2] = msg->data[1];
785 784
786 785
787 if ( full_length != send_custom_user_packet(messenger, session->dest, _send_data, full_length) ) { 786 if ( -1 == send_custom_user_packet(messenger, session->dest, _send_data, encrypted_length + 3) ) {
788 LOGGER_WARNING("Failed to send full packet! std error: %s", strerror(errno)); 787 LOGGER_WARNING("Failed to send full packet! std error: %s", strerror(errno));
789 rtp_free_msg ( session, msg ); 788 rtp_free_msg ( session, msg );
790 return -1; 789 return -1;
@@ -800,6 +799,7 @@ int rtp_send_msg ( RTPSession *session, Messenger *messenger, const uint8_t *dat
800 } 799 }
801 800
802 rtp_free_msg ( session, msg ); 801 rtp_free_msg ( session, msg );
802
803 return 0; 803 return 0;
804} 804}
805 805