Merge pull request #53 from ucloud/bugfix_upload_file_region

bug fix upload file region
This commit is contained in:
ethanDu1 2020-12-04 13:20:26 +08:00 committed by GitHub
commit af81b96333
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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-gd.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"