Merge pull request #53 from ucloud/bugfix_upload_file_region
bug fix upload file region
This commit is contained in:
commit
af81b96333
|
@ -21,6 +21,7 @@
|
||||||
#include "lite-utils.h"
|
#include "lite-utils.h"
|
||||||
#include "ca.h"
|
#include "ca.h"
|
||||||
#include "utils_sha2.h"
|
#include "utils_sha2.h"
|
||||||
|
#include "uiot_export.h"
|
||||||
|
|
||||||
static int calc_file_len(char *file_path)
|
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);
|
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();
|
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)
|
if(SUCCESS_RET != ret)
|
||||||
{
|
{
|
||||||
LOG_ERROR("HTTP_POST error\n");
|
LOG_ERROR("HTTP_POST error\n");
|
||||||
|
|
|
@ -55,8 +55,15 @@ extern "C" {
|
||||||
#define ENABLE_INFINITE_RECONNECT 1
|
#define ENABLE_INFINITE_RECONNECT 1
|
||||||
|
|
||||||
/* MQTT连接域名 */
|
/* MQTT连接域名 */
|
||||||
|
//上海区域域名
|
||||||
#define UIOT_MQTT_DIRECT_DOMAIN "mqtt-cn-sh2.iot.ucloud.cn"
|
#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_export_mqtt.h"
|
||||||
#include "uiot_defs.h"
|
#include "uiot_defs.h"
|
||||||
|
|
Loading…
Reference in New Issue