use github repo as central

This commit is contained in:
Jackson Tian
2019-01-09 14:07:33 +08:00
parent 9664fb1b00
commit bc0df2dcec
46 changed files with 1864 additions and 29 deletions

View File

@@ -1,12 +1,12 @@
#
# Copyright 2009-2017 Alibaba Cloud All rights reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,6 +14,15 @@
# limitations under the License.
#
# coverage option
OPTION (ENABLE_COVERAGE "Use gcov" ON)
MESSAGE(STATUS ENABLE_COVERAGE=${ENABLE_COVERAGE})
IF(ENABLE_COVERAGE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
# SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
ENDIF()
configure_file(src/Config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/alibabacloud/core/Config.h @ONLY)
set(core_public_header
@@ -120,7 +129,7 @@ set(core_src
src/sts/StsClient.cc
src/sts/StsRequest.cc
src/sts/model/AssumeRoleRequest.cc
src/sts/model/AssumeRoleResult.cc
src/sts/model/AssumeRoleResult.cc
src/sts/model/GetCallerIdentityRequest.cc
src/sts/model/GetCallerIdentityResult.cc
)

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,7 +18,7 @@
#include "Executor.h"
static AlibabaCloud::Executor * executor = nullptr;
void AlibabaCloud::InitializeSdk()
{
if (IsSdkInitialized())
@@ -37,7 +37,7 @@ void AlibabaCloud::ShutdownSdk()
{
if (!IsSdkInitialized())
return;
executor->shutdown();
delete executor;
executor = nullptr;

View File

@@ -106,7 +106,7 @@ void Executor::shutdown()
{
if (isShutdown())
return;
{
std::lock_guard<std::mutex> locker(tasksQueueMutex_);
while (tasksQueue_.size() > 0) {

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -99,7 +99,7 @@ HttpMessage::HeaderValueType HttpMessage::header(const HeaderNameType & name) co
auto it = headers_.find(name);
if (it != headers_.end())
return it->second;
else
else
return std::string();
}
@@ -161,8 +161,9 @@ void HttpMessage::setBody(const char *data, size_t size)
bodySize_ = 0;
if (size) {
bodySize_ = size;
body_ = new char[size];
body_ = new char[size + 1];
std::copy(data, data + size, body_);
body_[size] = '\0';
}
}

View File

@@ -77,7 +77,7 @@ void StsAssumeRoleCredentialsProvider::loadCredentials()
std::tm tm = {};
#if defined(__GNUG__) && __GNUC__ < 5
strptime(stsCredentials.expiration.c_str(), "%Y-%m-%dT%H:%M:%SZ", &tm);
#else
#else
std::stringstream ss(stsCredentials.expiration);
ss >> std::get_time(&tm, "%Y-%m-%dT%H:%M:%SZ");
#endif

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,7 +45,7 @@ std::string AlibabaCloud::GenerateUuid()
std::string AlibabaCloud::UrlEncode(const std::string & src)
{
CURL *curl = curl_easy_init();
CURL *curl = curl_easy_init();
char *output = curl_easy_escape(curl, src.c_str(), src.size());
std::string result(output);
curl_free(output);
@@ -89,7 +89,7 @@ std::string AlibabaCloud::ComputeContentMD5(const char * data, size_t size)
#else
unsigned char md[MD5_DIGEST_LENGTH];
MD5(reinterpret_cast<const unsigned char*>(data), size, (unsigned char*)&md);
char encodedData[100];
EVP_EncodeBlock(reinterpret_cast<unsigned char*>(encodedData), md, MD5_DIGEST_LENGTH);
return encodedData;
@@ -99,10 +99,10 @@ std::string AlibabaCloud::ComputeContentMD5(const char * data, size_t size)
void AlibabaCloud::StringReplace(std::string & src, const std::string & s1, const std::string & s2)
{
std::string::size_type pos =0;
while ((pos = src.find(s1, pos)) != std::string::npos)
while ((pos = src.find(s1, pos)) != std::string::npos)
{
src.replace(pos, s1.length(), s2);
pos += s2.length();
pos += s2.length();
}
}

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.