diff --git a/coreapi/chat.c b/coreapi/chat.c index d26efcf85..0c89485f3 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -41,14 +41,14 @@ const char *multipart_boundary=MULTIPART_BOUNDARY; static void process_io_error_upload(void *data, const belle_sip_io_error_event_t *event){ LinphoneChatMessage* msg=(LinphoneChatMessage *)data; - ms_error("I/O Error during file upload to %s - msg [%p] chat room[%p]", msg->chat_room->lc->file_transfer_server, msg, msg->chat_room); + ms_error("I/O Error during file upload to %s - msg [%p] chat room[%p]", linphone_core_get_file_transfer_server(msg->chat_room->lc), msg, msg->chat_room); if (msg->cb) { msg->cb(msg, LinphoneChatMessageStateNotDelivered, msg->chat_room->lc); } } static void process_auth_requested_upload(void *data, belle_sip_auth_event_t *event){ LinphoneChatMessage* msg=(LinphoneChatMessage *)data; - ms_error("Error during file upload : auth requested to connect %s - msg [%p] chat room[%p]", msg->chat_room->lc->file_transfer_server, msg, msg->chat_room); + ms_error("Error during file upload : auth requested to connect %s - msg [%p] chat room[%p]", linphone_core_get_file_transfer_server(msg->chat_room->lc), msg, msg->chat_room); if (msg->cb) { msg->cb(msg, LinphoneChatMessageStateNotDelivered, msg->chat_room->lc); } @@ -148,7 +148,7 @@ static void linphone_chat_message_process_response_from_post_file(void *data, co content_type=belle_sip_strdup_printf("multipart/form-data; boundary=%s",multipart_boundary); - uri=belle_generic_uri_parse(msg->chat_room->lc->file_transfer_server); + uri=belle_generic_uri_parse(linphone_core_get_file_transfer_server(msg->chat_room->lc)); req=belle_http_request_create("POST", uri, @@ -425,7 +425,7 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM belle_generic_uri_t *uri; belle_http_request_t *req; - uri=belle_generic_uri_parse(cr->lc->file_transfer_server); + uri=belle_generic_uri_parse(linphone_core_get_file_transfer_server(cr->lc)); req=belle_http_request_create("POST", uri, @@ -1138,7 +1138,7 @@ void linphone_chat_message_start_file_download(LinphoneChatMessage *message, Lin * @param msg #LinphoneChatMessage */ void linphone_chat_room_cancel_file_transfer(LinphoneChatMessage *msg) { - ms_message("Cancelled file transfer %s - msg [%p] chat room[%p]", (msg->external_body_url==NULL)?msg->chat_room->lc->file_transfer_server:msg->external_body_url, msg, msg->chat_room); + ms_message("Cancelled file transfer %s - msg [%p] chat room[%p]", (msg->external_body_url==NULL)?linphone_core_get_file_transfer_server(msg->chat_room->lc):msg->external_body_url, msg, msg->chat_room); /* TODO: here we shall call the cancel http request from bellesip API when it is available passing msg->http_request */ /* waiting for this API, just set to NULL the reference to the request in the message and any request */ msg->http_request = NULL; diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index f322a361f..68211022a 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1146,8 +1146,6 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab lc->http_verify_policy = belle_tls_verify_policy_new(); belle_http_provider_set_tls_verify_policy(lc->http_provider,lc->http_verify_policy); - lc->file_transfer_server = NULL; - certificates_config_read(lc); remote_provisioning_uri = linphone_core_get_provisioning_uri(lc); @@ -5771,9 +5769,6 @@ static void linphone_core_uninit(LinphoneCore *lc) ms_list_for_each(lc->last_recv_msg_ids,ms_free); lc->last_recv_msg_ids=ms_list_free(lc->last_recv_msg_ids); - // Free struct variable - ms_free(lc->file_transfer_server); - if(lc->zrtp_secrets_cache != NULL) { ms_free(lc->zrtp_secrets_cache); } @@ -6438,11 +6433,11 @@ bool_t linphone_core_sdp_200_ack_enabled(const LinphoneCore *lc) { } void linphone_core_set_file_transfer_server(LinphoneCore *core, const char * server_url) { - core->file_transfer_server=ms_strdup(server_url); + lp_config_set_string(core->config, "misc", "file_transfer_server_url", server_url); } const char * linphone_core_get_file_transfer_server(LinphoneCore *core) { - return core->file_transfer_server; + return lp_config_get_string(core->config, "misc", "file_transfer_server_url", NULL); } /** diff --git a/coreapi/private.h b/coreapi/private.h index 795dfb60f..a92a2b844 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -766,7 +766,6 @@ struct _LinphoneCore belle_tls_verify_policy_t *http_verify_policy; MSList *tones; LinphoneReason chat_deny_code; - char *file_transfer_server; const char **supported_formats; };