use github repo as central
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -106,7 +106,7 @@ void Executor::shutdown()
|
||||
{
|
||||
if (isShutdown())
|
||||
return;
|
||||
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> locker(tasksQueueMutex_);
|
||||
while (tasksQueue_.size() > 0) {
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user