未验证 提交 f46113a9 编写于 作者: Y Yang Zhao 提交者: GitHub

impl: remove http/https in front (2.6) (#13620)

* impl: add env variable url\token support for cloud platform

* impl: remove http/https in front
上级 c386f41d
...@@ -104,6 +104,16 @@ int main(int argc, char* argv[]) { ...@@ -104,6 +104,16 @@ int main(int argc, char* argv[]) {
char* cloud_url = getenv("TDENGINE_CLOUD_URL"); char* cloud_url = getenv("TDENGINE_CLOUD_URL");
if (cloud_url != NULL) { if (cloud_url != NULL) {
char* start = strstr(cloud_url, "http://");
if (start != NULL) {
cloud_url = start + strlen("http://");
} else {
start = strstr(cloud_url, "https://");
if (start != NULL) {
cloud_url = start + strlen("https://");
}
}
char* tmp = last_strstr(cloud_url, ":"); char* tmp = last_strstr(cloud_url, ":");
if ((tmp == NULL) && ((tmp + 1) != NULL )) { if ((tmp == NULL) && ((tmp + 1) != NULL )) {
fprintf(stderr, "Invalid format in environment variable TDENGINE_CLOUD_URL: %s\n", cloud_url); fprintf(stderr, "Invalid format in environment variable TDENGINE_CLOUD_URL: %s\n", cloud_url);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册