http_client_setopt(client, HTTPCLIENT_OPT_HTTPHEADER, header);
}
-static void fill_hc_http_opt(struct http_client_list * header, struct http_client * client, void* priv_date)
+static void fill_hc_http_opt(struct http_client_list ** header, struct http_client * client, void* priv_date)
{
#define CONTENT_AUTH_MAX_LEN 128
//printf("content_msg:%s:len=%d\n", content_msg, strlen(content_msg));
//content_host,content_len, lib will control
- header = http_client_list_append(header, content_auth);
- header = http_client_list_append(header, content_type);
- header = http_client_list_append(header, content_accept);
+ *header = http_client_list_append(*header, content_auth);
+ *header = http_client_list_append(*header, content_type);
+ *header = http_client_list_append(*header, content_accept);
- http_client_setopt(client, HTTPCLIENT_OPT_HTTPHEADER, header);
+ http_client_setopt(client, HTTPCLIENT_OPT_HTTPHEADER, *header);
}
void agnsshttp_download_require(char *url, void *priv_date)
uos_sleep(2000);
//fill_hd_http_opt(header, client, priv_date);
- fill_hc_http_opt(header, client, priv_date);
+ fill_hc_http_opt(&header, client, priv_date);
http_client_getinfo(client, HTTPCLIENT_GETINFO_TCP_STATE, &response_code);
printf("[http]Get tcp state %d\n", response_code);
}
}
- http_client_shutdown(client); /*release http resources*/
+ if (header) {
+ http_client_list_destroy(header);
+ header = NULL;
+ }
+ http_client_shutdown(client); /*release http resources*/
if (http_ret)
{
// TODO: send message to config gnss by uart
printf("%s, WifiResultInd: result=%d, count=%d\n", __FUNCTION__, result, g_Wifi.WifiApList.count);
g_Wifi.WifiResultInd(result, ap_list);
+ Hal_Mem_Free(ap_list);
}
//cleanup
printf("%s, WifiResultInd: result=%d, count=%d\n", __FUNCTION__, result, g_Wifi.WifiApList.count);
g_Wifi.WifiResultInd(result, ap_list);
+ Hal_Mem_Free(ap_list);
}
//cleanup