Handle file transfer upload with memory body handler.

This commit is contained in:
Ghislain MARY 2014-12-17 17:02:52 +01:00
parent 96bd60cc47
commit 1b32ed0316

View file

@ -293,6 +293,11 @@ static void linphone_chat_message_process_response_from_post_file(void *data, co
/* create a user body handler to take care of the file and add the content disposition and content-type headers */
if (msg->file_transfer_filepath != NULL) {
first_part_bh=(belle_sip_body_handler_t *)belle_sip_file_body_handler_new(msg->file_transfer_filepath,NULL,msg);
} else if (linphone_content_get_buffer(msg->file_transfer_information) != NULL) {
first_part_bh=(belle_sip_body_handler_t *)belle_sip_memory_body_handler_new_from_buffer(
linphone_content_get_buffer(msg->file_transfer_information),
linphone_content_get_size(msg->file_transfer_information),
NULL,msg);
} else {
first_part_bh=(belle_sip_body_handler_t *)belle_sip_user_body_handler_new(linphone_content_get_size(msg->file_transfer_information),NULL,NULL,linphone_chat_message_file_transfer_on_send_body,msg);
}