diff options
author | nalpp <nalpp@yandex-team.ru> | 2022-02-10 16:46:45 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:45 +0300 |
commit | 87f3eb38999df2d3c1cb77f8ffb9c52ec9c516fb (patch) | |
tree | f4ab0734eecf35b22f21952d1aa15496f267a6a3 /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard | |
parent | 198698b9c1e18958addc9682fbfba4576d604757 (diff) | |
download | ydb-87f3eb38999df2d3c1cb77f8ffb9c52ec9c516fb.tar.gz |
Restoring authorship annotation for <nalpp@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard')
-rw-r--r-- | contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpRequest.cpp | 192 | ||||
-rw-r--r-- | contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpResponse.cpp | 84 |
2 files changed, 138 insertions, 138 deletions
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpRequest.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpRequest.cpp index 47a0ee4fac..1125eb57ce 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpRequest.cpp +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpRequest.cpp @@ -2,103 +2,103 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ - -#include <aws/core/http/standard/StandardHttpRequest.h> - -#include <aws/core/utils/StringUtils.h> - -#include <iostream> -#include <algorithm> -#include <cassert> - -using namespace Aws::Http; -using namespace Aws::Http::Standard; -using namespace Aws::Utils; - -static bool IsDefaultPort(const URI& uri) -{ - switch(uri.GetPort()) - { - case 80: - return uri.GetScheme() == Scheme::HTTP; - case 443: - return uri.GetScheme() == Scheme::HTTPS; - default: - return false; - } -} - -StandardHttpRequest::StandardHttpRequest(const URI& uri, HttpMethod method) : - HttpRequest(uri, method), - bodyStream(nullptr), - m_responseStreamFactory() -{ - if(IsDefaultPort(uri)) - { + +#include <aws/core/http/standard/StandardHttpRequest.h> + +#include <aws/core/utils/StringUtils.h> + +#include <iostream> +#include <algorithm> +#include <cassert> + +using namespace Aws::Http; +using namespace Aws::Http::Standard; +using namespace Aws::Utils; + +static bool IsDefaultPort(const URI& uri) +{ + switch(uri.GetPort()) + { + case 80: + return uri.GetScheme() == Scheme::HTTP; + case 443: + return uri.GetScheme() == Scheme::HTTPS; + default: + return false; + } +} + +StandardHttpRequest::StandardHttpRequest(const URI& uri, HttpMethod method) : + HttpRequest(uri, method), + bodyStream(nullptr), + m_responseStreamFactory() +{ + if(IsDefaultPort(uri)) + { StandardHttpRequest::SetHeaderValue(HOST_HEADER, uri.GetAuthority()); - } - else - { - Aws::StringStream host; - host << uri.GetAuthority() << ":" << uri.GetPort(); + } + else + { + Aws::StringStream host; + host << uri.GetAuthority() << ":" << uri.GetPort(); StandardHttpRequest::SetHeaderValue(HOST_HEADER, host.str()); - } -} - -HeaderValueCollection StandardHttpRequest::GetHeaders() const -{ - HeaderValueCollection headers; - - for (HeaderValueCollection::const_iterator iter = headerMap.begin(); iter != headerMap.end(); ++iter) - { - headers.emplace(HeaderValuePair(iter->first, iter->second)); - } - - return headers; -} - -const Aws::String& StandardHttpRequest::GetHeaderValue(const char* headerName) const -{ - auto iter = headerMap.find(headerName); - assert (iter != headerMap.end()); - return iter->second; -} - -void StandardHttpRequest::SetHeaderValue(const char* headerName, const Aws::String& headerValue) -{ - headerMap[StringUtils::ToLower(headerName)] = StringUtils::Trim(headerValue.c_str()); -} - -void StandardHttpRequest::SetHeaderValue(const Aws::String& headerName, const Aws::String& headerValue) -{ - headerMap[StringUtils::ToLower(headerName.c_str())] = StringUtils::Trim(headerValue.c_str()); -} - -void StandardHttpRequest::DeleteHeader(const char* headerName) -{ - headerMap.erase(StringUtils::ToLower(headerName)); -} - -bool StandardHttpRequest::HasHeader(const char* headerName) const -{ - return headerMap.find(StringUtils::ToLower(headerName)) != headerMap.end(); -} - -int64_t StandardHttpRequest::GetSize() const -{ - int64_t size = 0; - - std::for_each(headerMap.cbegin(), headerMap.cend(), [&](const HeaderValueCollection::value_type& kvPair){ size += kvPair.first.length(); size += kvPair.second.length(); }); - - return size; -} - -const Aws::IOStreamFactory& StandardHttpRequest::GetResponseStreamFactory() const + } +} + +HeaderValueCollection StandardHttpRequest::GetHeaders() const +{ + HeaderValueCollection headers; + + for (HeaderValueCollection::const_iterator iter = headerMap.begin(); iter != headerMap.end(); ++iter) + { + headers.emplace(HeaderValuePair(iter->first, iter->second)); + } + + return headers; +} + +const Aws::String& StandardHttpRequest::GetHeaderValue(const char* headerName) const +{ + auto iter = headerMap.find(headerName); + assert (iter != headerMap.end()); + return iter->second; +} + +void StandardHttpRequest::SetHeaderValue(const char* headerName, const Aws::String& headerValue) +{ + headerMap[StringUtils::ToLower(headerName)] = StringUtils::Trim(headerValue.c_str()); +} + +void StandardHttpRequest::SetHeaderValue(const Aws::String& headerName, const Aws::String& headerValue) +{ + headerMap[StringUtils::ToLower(headerName.c_str())] = StringUtils::Trim(headerValue.c_str()); +} + +void StandardHttpRequest::DeleteHeader(const char* headerName) +{ + headerMap.erase(StringUtils::ToLower(headerName)); +} + +bool StandardHttpRequest::HasHeader(const char* headerName) const { - return m_responseStreamFactory; -} - -void StandardHttpRequest::SetResponseStreamFactory(const Aws::IOStreamFactory& factory) + return headerMap.find(StringUtils::ToLower(headerName)) != headerMap.end(); +} + +int64_t StandardHttpRequest::GetSize() const { - m_responseStreamFactory = factory; -} + int64_t size = 0; + + std::for_each(headerMap.cbegin(), headerMap.cend(), [&](const HeaderValueCollection::value_type& kvPair){ size += kvPair.first.length(); size += kvPair.second.length(); }); + + return size; +} + +const Aws::IOStreamFactory& StandardHttpRequest::GetResponseStreamFactory() const +{ + return m_responseStreamFactory; +} + +void StandardHttpRequest::SetResponseStreamFactory(const Aws::IOStreamFactory& factory) +{ + m_responseStreamFactory = factory; +} diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpResponse.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpResponse.cpp index 92d7a062b6..2097a5efa4 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpResponse.cpp +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpResponse.cpp @@ -2,45 +2,45 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ - -#include <aws/core/http/standard/StandardHttpResponse.h> - -#include <aws/core/utils/StringUtils.h> -#include <aws/core/utils/memory/AWSMemory.h> - -#include <istream> - -using namespace Aws::Http; -using namespace Aws::Http::Standard; -using namespace Aws::Utils; - - -HeaderValueCollection StandardHttpResponse::GetHeaders() const -{ - HeaderValueCollection headerValueCollection; - - for (Aws::Map<Aws::String, Aws::String>::const_iterator iter = headerMap.begin(); iter != headerMap.end(); ++iter) - { - headerValueCollection.emplace(HeaderValuePair(iter->first, iter->second)); - } - - return headerValueCollection; -} - -bool StandardHttpResponse::HasHeader(const char* headerName) const -{ - return headerMap.find(StringUtils::ToLower(headerName)) != headerMap.end(); -} - -const Aws::String& StandardHttpResponse::GetHeader(const Aws::String& headerName) const -{ - Aws::Map<Aws::String, Aws::String>::const_iterator foundValue = headerMap.find(StringUtils::ToLower(headerName.c_str())); - return foundValue->second; -} - -void StandardHttpResponse::AddHeader(const Aws::String& headerName, const Aws::String& headerValue) -{ - headerMap[StringUtils::ToLower(headerName.c_str())] = headerValue; -} - - + +#include <aws/core/http/standard/StandardHttpResponse.h> + +#include <aws/core/utils/StringUtils.h> +#include <aws/core/utils/memory/AWSMemory.h> + +#include <istream> + +using namespace Aws::Http; +using namespace Aws::Http::Standard; +using namespace Aws::Utils; + + +HeaderValueCollection StandardHttpResponse::GetHeaders() const +{ + HeaderValueCollection headerValueCollection; + + for (Aws::Map<Aws::String, Aws::String>::const_iterator iter = headerMap.begin(); iter != headerMap.end(); ++iter) + { + headerValueCollection.emplace(HeaderValuePair(iter->first, iter->second)); + } + + return headerValueCollection; +} + +bool StandardHttpResponse::HasHeader(const char* headerName) const +{ + return headerMap.find(StringUtils::ToLower(headerName)) != headerMap.end(); +} + +const Aws::String& StandardHttpResponse::GetHeader(const Aws::String& headerName) const +{ + Aws::Map<Aws::String, Aws::String>::const_iterator foundValue = headerMap.find(StringUtils::ToLower(headerName.c_str())); + return foundValue->second; +} + +void StandardHttpResponse::AddHeader(const Aws::String& headerName, const Aws::String& headerValue) +{ + headerMap[StringUtils::ToLower(headerName.c_str())] = headerValue; +} + + |