Adding comment and address code style formatting.

This commit is contained in:
Bala Namasivayam 2022-01-28 14:48:41 -08:00 committed by Meng Xu
parent 0f36157c2c
commit 208b5de572
2 changed files with 3 additions and 2 deletions

View File

@ -198,7 +198,7 @@ public:
int HTTP_READ_SIZE; int HTTP_READ_SIZE;
int HTTP_VERBOSE_LEVEL; int HTTP_VERBOSE_LEVEL;
std::string HTTP_REQUEST_ID_HEADER; std::string HTTP_REQUEST_ID_HEADER;
bool HTTP_REQUEST_AWS_V4_HEADER; bool HTTP_REQUEST_AWS_V4_HEADER; // setting this knob to true will enable AWS V4 style header.
std::string BLOBSTORE_ENCRYPTION_TYPE; std::string BLOBSTORE_ENCRYPTION_TYPE;
int BLOBSTORE_CONNECT_TRIES; int BLOBSTORE_CONNECT_TRIES;
int BLOBSTORE_CONNECT_TIMEOUT; int BLOBSTORE_CONNECT_TIMEOUT;

View File

@ -31,7 +31,7 @@ std::string awsV4URIEncode(const std::string& s, bool encodeSlash) {
std::string o; std::string o;
o.reserve(s.size() * 3); o.reserve(s.size() * 3);
char buf[4]; char buf[4];
for (auto c : s) for (auto c : s) {
if (std::isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') if (std::isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~')
o.append(&c, 1); o.append(&c, 1);
else if (c == '/') else if (c == '/')
@ -40,6 +40,7 @@ std::string awsV4URIEncode(const std::string& s, bool encodeSlash) {
sprintf(buf, "%%%.02X", c); sprintf(buf, "%%%.02X", c);
o.append(buf); o.append(buf);
} }
}
return o; return o;
} }