Compare commits

...

3 Commits

Author SHA1 Message Date
wb-hx510875
a13d778e7b patch 2020-04-28 17:19:01 +08:00
wb-hx510875
f16150baca fix : code patch
1. fixed code about delete char*
2. free curl_slist
3. added lock for EndpointProvider::LoadLocalEndpoints()
2020-04-28 16:41:32 +08:00
sdk-team
a51834c8d0 Generated 2019-03-15 for fnf. 2020-04-28 15:43:32 +08:00
25 changed files with 141 additions and 2 deletions

View File

@@ -1,3 +1,6 @@
2020-04-28 Version: 1.36.385
- Generated 2019-03-15 for `fnf`.
2020-04-28 Version: 1.36.384
- Add CompareFaceVerify API.

View File

@@ -1 +1 @@
1.36.384
1.36.385

View File

@@ -145,6 +145,7 @@ CurlHttpClient::makeRequest(const HttpRequest &request) {
curl_easy_setopt(curlHandle_, CURLOPT_READFUNCTION, readCallback);
curl_easy_setopt(curlHandle_, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(curlHandle_, CURLOPT_READDATA, ctx);
free(ctx);
}
break;
@@ -194,6 +195,7 @@ CurlHttpClient::makeRequest(const HttpRequest &request) {
}
CURLcode res = curl_easy_perform(curlHandle_);
curl_slist_free_all(list);
switch (res) {
case CURLE_OK: {
long response_code;

View File

@@ -19,6 +19,9 @@
#include <iomanip>
#include <json/json.h>
#include <sstream>
#include <thread>
#include <mutex>
#include <condition_variable>
#ifndef WIN32
#include "LocalEndpoints.h"
@@ -39,7 +42,10 @@ namespace
#include <strings.h>
#endif
std::mutex mutex;
std::condition_variable cv;
bool local_endpoints_loaded = false;
bool local_endpoints_loading = false;
typedef std::string productType;
typedef std::string regionType;
typedef std::string endpointType;
@@ -60,6 +66,8 @@ static void LoadLocalEndpoints()
{
Json::Reader reader;
Json::Value value;
std::unique_lock<std::mutex> lock(mutex);
if (local_endpoints_loaded)
{
return;
@@ -76,6 +84,10 @@ static void LoadLocalEndpoints()
return;
}
cv.wait(lock, [] { return !local_endpoints_loading; });// continue if loading completed
local_endpoints_loading = true;
auto regions = value["regions"];
for (const auto &region : regions)
{
@@ -107,6 +119,10 @@ static void LoadLocalEndpoints()
allLocalEndpoints[product] = p;
}
local_endpoints_loaded = true;
local_endpoints_loading = false;
lock.unlock();
cv.notify_one();
}
} // namespace

View File

@@ -139,7 +139,7 @@ HttpMessage::HeaderValueType HttpMessage::header(KnownHeader header)const {
void HttpMessage::setBody(const char *data, size_t size) {
if (body_)
delete body_;
delete[] body_;
body_ = nullptr;
bodySize_ = 0;
if (size) {

View File

@@ -47,6 +47,8 @@ namespace AlibabaCloud
void setName(const std::string& name);
std::string getDefinition()const;
void setDefinition(const std::string& definition);
std::string getExternalStorageLocation()const;
void setExternalStorageLocation(const std::string& externalStorageLocation);
private:
std::string description_;
@@ -55,6 +57,7 @@ namespace AlibabaCloud
std::string roleArn_;
std::string name_;
std::string definition_;
std::string externalStorageLocation_;
};
}

View File

@@ -43,6 +43,7 @@ namespace AlibabaCloud
std::string getDefinition()const;
std::string getLastModifiedTime()const;
std::string getId()const;
std::string getExternalStorageLocation()const;
std::string getRoleArn()const;
std::string getName()const;
@@ -55,6 +56,7 @@ namespace AlibabaCloud
std::string definition_;
std::string lastModifiedTime_;
std::string id_;
std::string externalStorageLocation_;
std::string roleArn_;
std::string name_;

View File

@@ -42,7 +42,9 @@ namespace AlibabaCloud
std::string getStoppedTime()const;
std::string getFlowName()const;
std::string getOutput()const;
std::string getExternalOutputUri()const;
std::string getStartedTime()const;
std::string getExternalInputUri()const;
std::string getFlowDefinition()const;
std::string getName()const;
@@ -54,7 +56,9 @@ namespace AlibabaCloud
std::string stoppedTime_;
std::string flowName_;
std::string output_;
std::string externalOutputUri_;
std::string startedTime_;
std::string externalInputUri_;
std::string flowDefinition_;
std::string name_;

View File

@@ -43,6 +43,7 @@ namespace AlibabaCloud
std::string getDefinition()const;
std::string getLastModifiedTime()const;
std::string getId()const;
std::string getExternalStorageLocation()const;
std::string getRoleArn()const;
std::string getName()const;
@@ -55,6 +56,7 @@ namespace AlibabaCloud
std::string definition_;
std::string lastModifiedTime_;
std::string id_;
std::string externalStorageLocation_;
std::string roleArn_;
std::string name_;

View File

@@ -39,7 +39,9 @@ namespace AlibabaCloud
std::string stoppedTime;
std::string flowName;
std::string output;
std::string externalOutputUri;
std::string startedTime;
std::string externalInputUri;
std::string flowDefinition;
std::string name;
};

View File

@@ -40,6 +40,7 @@ namespace AlibabaCloud
std::string definition;
std::string lastModifiedTime;
std::string id;
std::string externalStorageLocation;
std::string roleArn;
std::string name;
};

View File

@@ -42,7 +42,9 @@ namespace AlibabaCloud
std::string getStoppedTime()const;
std::string getFlowName()const;
std::string getOutput()const;
std::string getExternalOutputUri()const;
std::string getStartedTime()const;
std::string getExternalInputUri()const;
std::string getFlowDefinition()const;
std::string getName()const;
@@ -54,7 +56,9 @@ namespace AlibabaCloud
std::string stoppedTime_;
std::string flowName_;
std::string output_;
std::string externalOutputUri_;
std::string startedTime_;
std::string externalInputUri_;
std::string flowDefinition_;
std::string name_;

View File

@@ -42,7 +42,9 @@ namespace AlibabaCloud
std::string getStoppedTime()const;
std::string getFlowName()const;
std::string getOutput()const;
std::string getExternalOutputUri()const;
std::string getStartedTime()const;
std::string getExternalInputUri()const;
std::string getFlowDefinition()const;
std::string getName()const;
@@ -54,7 +56,9 @@ namespace AlibabaCloud
std::string stoppedTime_;
std::string flowName_;
std::string output_;
std::string externalOutputUri_;
std::string startedTime_;
std::string externalInputUri_;
std::string flowDefinition_;
std::string name_;

View File

@@ -47,6 +47,8 @@ namespace AlibabaCloud
void setName(const std::string& name);
std::string getDefinition()const;
void setDefinition(const std::string& definition);
std::string getExternalStorageLocation()const;
void setExternalStorageLocation(const std::string& externalStorageLocation);
private:
std::string description_;
@@ -55,6 +57,7 @@ namespace AlibabaCloud
std::string roleArn_;
std::string name_;
std::string definition_;
std::string externalStorageLocation_;
};
}

View File

@@ -43,6 +43,7 @@ namespace AlibabaCloud
std::string getDefinition()const;
std::string getLastModifiedTime()const;
std::string getId()const;
std::string getExternalStorageLocation()const;
std::string getRoleArn()const;
std::string getName()const;
@@ -55,6 +56,7 @@ namespace AlibabaCloud
std::string definition_;
std::string lastModifiedTime_;
std::string id_;
std::string externalStorageLocation_;
std::string roleArn_;
std::string name_;

View File

@@ -93,3 +93,14 @@ void CreateFlowRequest::setDefinition(const std::string& definition)
setBodyParameter("Definition", definition);
}
std::string CreateFlowRequest::getExternalStorageLocation()const
{
return externalStorageLocation_;
}
void CreateFlowRequest::setExternalStorageLocation(const std::string& externalStorageLocation)
{
externalStorageLocation_ = externalStorageLocation;
setBodyParameter("ExternalStorageLocation", externalStorageLocation);
}

View File

@@ -55,6 +55,8 @@ void CreateFlowResult::parse(const std::string &payload)
createdTime_ = value["CreatedTime"].asString();
if(!value["LastModifiedTime"].isNull())
lastModifiedTime_ = value["LastModifiedTime"].asString();
if(!value["ExternalStorageLocation"].isNull())
externalStorageLocation_ = value["ExternalStorageLocation"].asString();
}
@@ -88,6 +90,11 @@ std::string CreateFlowResult::getId()const
return id_;
}
std::string CreateFlowResult::getExternalStorageLocation()const
{
return externalStorageLocation_;
}
std::string CreateFlowResult::getRoleArn()const
{
return roleArn_;

View File

@@ -55,6 +55,10 @@ void DescribeExecutionResult::parse(const std::string &payload)
startedTime_ = value["StartedTime"].asString();
if(!value["StoppedTime"].isNull())
stoppedTime_ = value["StoppedTime"].asString();
if(!value["ExternalInputUri"].isNull())
externalInputUri_ = value["ExternalInputUri"].asString();
if(!value["ExternalOutputUri"].isNull())
externalOutputUri_ = value["ExternalOutputUri"].asString();
}
@@ -83,11 +87,21 @@ std::string DescribeExecutionResult::getOutput()const
return output_;
}
std::string DescribeExecutionResult::getExternalOutputUri()const
{
return externalOutputUri_;
}
std::string DescribeExecutionResult::getStartedTime()const
{
return startedTime_;
}
std::string DescribeExecutionResult::getExternalInputUri()const
{
return externalInputUri_;
}
std::string DescribeExecutionResult::getFlowDefinition()const
{
return flowDefinition_;

View File

@@ -55,6 +55,8 @@ void DescribeFlowResult::parse(const std::string &payload)
createdTime_ = value["CreatedTime"].asString();
if(!value["LastModifiedTime"].isNull())
lastModifiedTime_ = value["LastModifiedTime"].asString();
if(!value["ExternalStorageLocation"].isNull())
externalStorageLocation_ = value["ExternalStorageLocation"].asString();
}
@@ -88,6 +90,11 @@ std::string DescribeFlowResult::getId()const
return id_;
}
std::string DescribeFlowResult::getExternalStorageLocation()const
{
return externalStorageLocation_;
}
std::string DescribeFlowResult::getRoleArn()const
{
return roleArn_;

View File

@@ -59,6 +59,10 @@ void ListExecutionsResult::parse(const std::string &payload)
executionsObject.startedTime = valueExecutionsExecutionsItem["StartedTime"].asString();
if(!valueExecutionsExecutionsItem["StoppedTime"].isNull())
executionsObject.stoppedTime = valueExecutionsExecutionsItem["StoppedTime"].asString();
if(!valueExecutionsExecutionsItem["ExternalInputUri"].isNull())
executionsObject.externalInputUri = valueExecutionsExecutionsItem["ExternalInputUri"].asString();
if(!valueExecutionsExecutionsItem["ExternalOutputUri"].isNull())
executionsObject.externalOutputUri = valueExecutionsExecutionsItem["ExternalOutputUri"].asString();
executions_.push_back(executionsObject);
}
if(!value["NextToken"].isNull())

View File

@@ -59,6 +59,8 @@ void ListFlowsResult::parse(const std::string &payload)
flowsObject.createdTime = valueFlowsFlowsItem["CreatedTime"].asString();
if(!valueFlowsFlowsItem["LastModifiedTime"].isNull())
flowsObject.lastModifiedTime = valueFlowsFlowsItem["LastModifiedTime"].asString();
if(!valueFlowsFlowsItem["ExternalStorageLocation"].isNull())
flowsObject.externalStorageLocation = valueFlowsFlowsItem["ExternalStorageLocation"].asString();
flows_.push_back(flowsObject);
}
if(!value["NextToken"].isNull())

View File

@@ -55,6 +55,10 @@ void StartExecutionResult::parse(const std::string &payload)
startedTime_ = value["StartedTime"].asString();
if(!value["StoppedTime"].isNull())
stoppedTime_ = value["StoppedTime"].asString();
if(!value["ExternalInputUri"].isNull())
externalInputUri_ = value["ExternalInputUri"].asString();
if(!value["ExternalOutputUri"].isNull())
externalOutputUri_ = value["ExternalOutputUri"].asString();
}
@@ -83,11 +87,21 @@ std::string StartExecutionResult::getOutput()const
return output_;
}
std::string StartExecutionResult::getExternalOutputUri()const
{
return externalOutputUri_;
}
std::string StartExecutionResult::getStartedTime()const
{
return startedTime_;
}
std::string StartExecutionResult::getExternalInputUri()const
{
return externalInputUri_;
}
std::string StartExecutionResult::getFlowDefinition()const
{
return flowDefinition_;

View File

@@ -55,6 +55,10 @@ void StopExecutionResult::parse(const std::string &payload)
startedTime_ = value["StartedTime"].asString();
if(!value["StoppedTime"].isNull())
stoppedTime_ = value["StoppedTime"].asString();
if(!value["ExternalInputUri"].isNull())
externalInputUri_ = value["ExternalInputUri"].asString();
if(!value["ExternalOutputUri"].isNull())
externalOutputUri_ = value["ExternalOutputUri"].asString();
}
@@ -83,11 +87,21 @@ std::string StopExecutionResult::getOutput()const
return output_;
}
std::string StopExecutionResult::getExternalOutputUri()const
{
return externalOutputUri_;
}
std::string StopExecutionResult::getStartedTime()const
{
return startedTime_;
}
std::string StopExecutionResult::getExternalInputUri()const
{
return externalInputUri_;
}
std::string StopExecutionResult::getFlowDefinition()const
{
return flowDefinition_;

View File

@@ -93,3 +93,14 @@ void UpdateFlowRequest::setDefinition(const std::string& definition)
setBodyParameter("Definition", definition);
}
std::string UpdateFlowRequest::getExternalStorageLocation()const
{
return externalStorageLocation_;
}
void UpdateFlowRequest::setExternalStorageLocation(const std::string& externalStorageLocation)
{
externalStorageLocation_ = externalStorageLocation;
setBodyParameter("ExternalStorageLocation", externalStorageLocation);
}

View File

@@ -55,6 +55,8 @@ void UpdateFlowResult::parse(const std::string &payload)
createdTime_ = value["CreatedTime"].asString();
if(!value["LastModifiedTime"].isNull())
lastModifiedTime_ = value["LastModifiedTime"].asString();
if(!value["ExternalStorageLocation"].isNull())
externalStorageLocation_ = value["ExternalStorageLocation"].asString();
}
@@ -88,6 +90,11 @@ std::string UpdateFlowResult::getId()const
return id_;
}
std::string UpdateFlowResult::getExternalStorageLocation()const
{
return externalStorageLocation_;
}
std::string UpdateFlowResult::getRoleArn()const
{
return roleArn_;