Fixed RTT character not being freed correctly + RTT test with SRTP failing if SRTP not available

This commit is contained in:
Sylvain Berfini 2016-12-15 15:25:49 +01:00
parent e132ecc181
commit 5eb5ea3473
2 changed files with 9 additions and 4 deletions

View file

@ -114,6 +114,9 @@ BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneChatMessage);
static void _linphone_chat_room_destroy(LinphoneChatRoom *cr) {
bctbx_list_free_with_data(cr->transient_messages, (void (*)(void *))linphone_chat_message_release);
if (cr->received_rtt_characters) {
cr->received_rtt_characters = bctbx_list_free_with_data(cr->received_rtt_characters, (void (*)(void *))ms_free);
}
linphone_chat_room_delete_composing_idle_timer(cr);
linphone_chat_room_delete_composing_refresh_timer(cr);
linphone_chat_room_delete_remote_composing_refresh_timer(cr);
@ -292,9 +295,6 @@ static void linphone_chat_room_delete_remote_composing_refresh_timer(LinphoneCha
}
void linphone_chat_room_destroy(LinphoneChatRoom *cr) {
if (cr->received_rtt_characters) {
cr->received_rtt_characters = bctbx_list_free(cr->received_rtt_characters);
}
linphone_chat_room_unref(cr);
}
@ -969,7 +969,7 @@ void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *c
linphone_chat_room_message_received(cr, lc, msg);
linphone_chat_message_unref(msg);
cr->pending_message = NULL;
cr->received_rtt_characters = bctbx_list_free(cr->received_rtt_characters);
cr->received_rtt_characters = bctbx_list_free_with_data(cr->received_rtt_characters, (void (*)(void *))ms_free);
} else {
char *value = utf8_to_char(character);
cr->pending_message->message = ms_strcat_printf(cr->pending_message->message, value);

View file

@ -1593,6 +1593,10 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo
}
if (srtp_enabled) {
if (!ms_srtp_supported()) {
ms_warning("test skipped, missing srtp support");
goto srtp_end;
}
BC_ASSERT_TRUE(linphone_core_media_encryption_supported(marie->lc, LinphoneMediaEncryptionSRTP));
linphone_core_set_media_encryption(marie->lc, LinphoneMediaEncryptionSRTP);
linphone_core_set_media_encryption(pauline->lc, LinphoneMediaEncryptionSRTP);
@ -1672,6 +1676,7 @@ end:
end_call(marie, pauline);
}
linphone_call_params_destroy(marie_params);
srtp_end:
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
remove(marie_db);