bug fix upload file region

This commit is contained in:
ethan.du 2020-12-04 13:17:41 +08:00
parent 9acbd58435
commit 775a37f334
2 changed files with 9 additions and 2 deletions

View File

@ -21,6 +21,7 @@
#include "lite-utils.h"
#include "ca.h"
#include "utils_sha2.h"
#include "uiot_export.h"
static int calc_file_len(char *file_path)
{
@ -115,9 +116,8 @@ int IOT_GET_URL_AND_AUTH(const char *product_sn, const char *device_sn, const ch
HAL_Snprintf(http_client_post->header, 1024, "Content-Type: application/json\r\nAuthorization:%s\r\n",mac_output_char);
const char *ca_crt = iot_https_ca_get();
char *url = (char *)"https://file-cn-sh2.iot.ucloud.cn/api/v1/url";
ret = http_client_common(http_client_post, url, 443, ca_crt, HTTP_POST, http_data_post,5000);
ret = http_client_common(http_client_post, UIOT_UPLOAD_FILE_URL, 443, ca_crt, HTTP_POST, http_data_post,5000);
if(SUCCESS_RET != ret)
{
LOG_ERROR("HTTP_POST error\n");

View File

@ -55,8 +55,15 @@ extern "C" {
#define ENABLE_INFINITE_RECONNECT 1
/* MQTT连接域名 */
//上海区域域名
#define UIOT_MQTT_DIRECT_DOMAIN "mqtt-cn-sh2.iot.ucloud.cn"
#define UIOT_UPLOAD_FILE_URL "https://file-cn-sh2.iot.ucloud.cn/api/v1/url"
/*
//使用广州区域时替换为
#define UIOT_MQTT_DIRECT_DOMAIN "mqtt-cn-sh2.iot.ucloud.cn"
#define UIOT_UPLOAD_FILE_URL "https://file-cn-gd.iot.ucloud.cn/api/v1/url"
*/
#include "uiot_export_mqtt.h"
#include "uiot_defs.h"