[trafficserver] branch master updated: Frees disk_vols when volume create failed
This is an automated email from the ASF dual-hosted git repository. scw00 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new c2a9189 Frees disk_vols when volume create failed c2a9189 is described below commit c2a91894585bd84ec14ae367762dcadb55e0f645 Author: scw00 AuthorDate: Mon Feb 18 16:55:54 2019 +0800 Frees disk_vols when volume create failed --- iocore/cache/Cache.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc index 4933727..e1416fa 100644 --- a/iocore/cache/Cache.cc +++ b/iocore/cache/Cache.cc @@ -2865,6 +2865,8 @@ cplist_reconfigure() new_cp->disk_vols = (DiskVol **)ats_malloc(gndisks * sizeof(DiskVol *)); memset(new_cp->disk_vols, 0, gndisks * sizeof(DiskVol *)); if (create_volume(config_vol->number, size_in_blocks, config_vol->scheme, new_cp)) { + ats_free(new_cp->disk_vols); + new_cp->disk_vols = nullptr; delete new_cp; return -1; }
[trafficserver] branch quic-latest updated (6b2773c -> f4b4625)
This is an automated email from the ASF dual-hosted git repository. scw00 pushed a change to branch quic-latest in repository https://gitbox.apache.org/repos/asf/trafficserver.git. from 6b2773c QUIC: Fixed crash when records connection id frame new 38600d4 QUIC: Refactor QUICStream State new 1ccd18d QUIC: Do not discard frame in StreamState new 8535ce7 Clang-Format and signal user event only on consuming all data new c9552ad QUIC: Bring back QUICTransferProgressProvider new 914ffb3 QUIC: Fixed test cases new f4b4625 QUIC: Fixed QUICIncomingFrameBuffer test The 12705 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: iocore/net/quic/Mock.h | 2 +- iocore/net/quic/QUICDebugNames.cc| 96 -- iocore/net/quic/QUICDebugNames.h | 4 +- iocore/net/quic/QUICStream.cc| 6 +- iocore/net/quic/QUICStream.h | 2 +- iocore/net/quic/QUICStreamState.cc | 468 --- iocore/net/quic/QUICStreamState.h| 112 --- iocore/net/quic/test/test_QUICStreamState.cc | 306 ++ 8 files changed, 597 insertions(+), 399 deletions(-)
[trafficserver] branch 8.0.x updated: Updated ChangeLog
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 8.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/8.0.x by this push: new da0e4c5 Updated ChangeLog da0e4c5 is described below commit da0e4c59cb4bcee7ceb6c85e43f0d57820cc10e2 Author: Miles Libbey AuthorDate: Mon Jan 21 17:06:09 2019 -0800 Updated ChangeLog --- CHANGELOG-8.0.3 | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG-8.0.3 b/CHANGELOG-8.0.3 index f68ffd5..62c46ae 100644 --- a/CHANGELOG-8.0.3 +++ b/CHANGELOG-8.0.3 @@ -67,4 +67,5 @@ Changes with Apache Traffic Server 8.0.3 #4971 - Fixed a typo in the background_fetch plugin section #4989 - Doc: money trace plugin link incorrect #4992 - Doc: centering images is not in view + #4995 - Doc: minor records.config cleaning #5019 - s3_auth:fixed uncaught exception on invalid input
[trafficserver] branch 8.0.x updated: Updated ChangeLog
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 8.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/8.0.x by this push: new f2bf4a1 Updated ChangeLog f2bf4a1 is described below commit f2bf4a116b7ed21c332ce198e7e702a671f7b00c Author: Leif Hedstrom AuthorDate: Mon Feb 18 16:54:31 2019 -0700 Updated ChangeLog --- CHANGELOG-8.0.3 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG-8.0.3 b/CHANGELOG-8.0.3 index 724c9d7..f68ffd5 100644 --- a/CHANGELOG-8.0.3 +++ b/CHANGELOG-8.0.3 @@ -64,5 +64,7 @@ Changes with Apache Traffic Server 8.0.3 #4946 - Corrects description for proxy.config.http.origin_max_connections #4949 - Split current active client connections stats into HTTP/1.1 and HTTP/2 #4968 - Fix client connections of traffic_top + #4971 - Fixed a typo in the background_fetch plugin section + #4989 - Doc: money trace plugin link incorrect #4992 - Doc: centering images is not in view #5019 - s3_auth:fixed uncaught exception on invalid input
[trafficserver] branch 8.0.x updated (cf6bda4 -> b8fc140)
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a change to branch 8.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git. from cf6bda4 Updated Changelog new ab90607 Fixed a typo in the background_fetch plugin section new b8fc140 Doc: money trace plugin link incorrect The 11194 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: doc/admin-guide/plugins/background_fetch.en.rst | 2 +- doc/admin-guide/plugins/index.en.rst| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
[trafficserver] branch 8.0.x updated: Updated Changelog
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch 8.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/8.0.x by this push: new cf6bda4 Updated Changelog cf6bda4 is described below commit cf6bda405fae4beecfe88271188adaa889ad02a5 Author: Bryan Call AuthorDate: Mon Feb 18 15:18:38 2019 -0800 Updated Changelog --- CHANGELOG-8.0.3 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG-8.0.3 b/CHANGELOG-8.0.3 index 553e340..724c9d7 100644 --- a/CHANGELOG-8.0.3 +++ b/CHANGELOG-8.0.3 @@ -64,3 +64,5 @@ Changes with Apache Traffic Server 8.0.3 #4946 - Corrects description for proxy.config.http.origin_max_connections #4949 - Split current active client connections stats into HTTP/1.1 and HTTP/2 #4968 - Fix client connections of traffic_top + #4992 - Doc: centering images is not in view + #5019 - s3_auth:fixed uncaught exception on invalid input
[trafficserver] branch 8.0.x updated: s3_auth:fixed uncaught exception on invalid input
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch 8.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/8.0.x by this push: new 2e9d498 s3_auth:fixed uncaught exception on invalid input 2e9d498 is described below commit 2e9d498dd940e9107807594d34766062d647d866 Author: Gancho Tenev AuthorDate: Sat Feb 16 09:32:07 2019 -0800 s3_auth:fixed uncaught exception on invalid input Instead of fixing the URI decoding functionality to handle the exception (re)implemented a check for percent encoding which was what was needed. During signature calculation AWS avoids URI encoding of already encoded query parameters (rfc3986#section-2.4 says "implementations must not percent-encode or decode the same string more than once ...") (cherry picked from commit 953cde65b015e0f914fabdc79153fb9d694b18aa) --- plugins/s3_auth/aws_auth_v4.cc | 63 plugins/s3_auth/unit_tests/test_aws_auth_v4.cc | 79 +++--- plugins/s3_auth/unit_tests/test_aws_auth_v4.h | 2 +- 3 files changed, 101 insertions(+), 43 deletions(-) diff --git a/plugins/s3_auth/aws_auth_v4.cc b/plugins/s3_auth/aws_auth_v4.cc index 61f595d..1df1a61 100644 --- a/plugins/s3_auth/aws_auth_v4.cc +++ b/plugins/s3_auth/aws_auth_v4.cc @@ -103,32 +103,52 @@ uriEncode(const String &in, bool isObjectName) } /** - * @brief URI-decode a character string (AWS specific version, see spec) + * @brief checks if the string is URI-encoded (AWS specific encoding version, see spec) * * @see AWS spec: http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html * - * @todo Consider reusing / converting to TSStringPercentDecode() - * Currently we don't build a library/archive so we could link with the unit-test binary. Also using - * different sets of encode/decode functions during runtime and unit-testing did not seem as a good idea. - * @param in string to be URI decoded - * @return encoded string. + * @note According to the following RFC if the string is encoded and contains '%' it should + * be followed by 2 hexadecimal symbols otherwise '%' should be encoded with %25: + * https://tools.ietf.org/html/rfc3986#section-2.1 + * + * @param in string to be URI checked + * @param isObjectName if true encoding didn't encode '/', kept it as it is. + * @return true if encoded, false not encoded. */ -String -uriDecode(const String &in) +bool +isUriEncoded(const String &in, bool isObjectName) { - std::string result; - result.reserve(in.length()); - size_t i = 0; - while (i < in.length()) { -if (in[i] == '%') { - result += static_cast(std::stoi(in.substr(i + 1, 2), nullptr, 16)); - i += 3; -} else { - result += in[i]; - i++; + for (size_t pos = 0; pos < in.length(); pos++) { +char c = in[pos]; + +if (isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') { + /* found a unreserved character which should not have been be encoded regardless + * 'A'-'Z', 'a'-'z', '0'-'9', '-', '.', '_', and '~'. */ + continue; +} + +if (' ' == c) { + /* space should have been encoded with %20 if the string was encoded */ + return false; +} + +if ('/' == c && !isObjectName) { + /* if this is not an object name '/' should have been encoded */ + return false; +} + +if ('%' == c) { + if (pos + 2 < in.length() && std::isxdigit(in[pos + 1]) && std::isxdigit(in[pos + 2])) { +/* if string was encoded we should have exactly 2 hexadecimal chars following it */ +return true; + } else { +/* lonely '%' should have been encoded with %25 according to the RFC so likely not encoded */ +return false; + } } } - return result; + + return false; } /** @@ -290,10 +310,7 @@ getCanonicalRequestSha256Hash(TsInterface &api, bool signPayload, const StringSe paramNames.insert(encodedParam); -/* Look for '%' first trying to avoid as many uri-decode calls as possible. - * it is hard to estimate which is more likely use-case - (1) URIs with uri-encoded query parameter - * values or (2) with unencoded which defines the success of this optimization */ -if (nullptr == memchr(value.c_str(), '%', value.length()) || 0 == uriDecode(value).compare(value)) { +if (!isUriEncoded(value, /* isObjectName */ false)) { /* Not URI-encoded */ paramsMap[encodedParam] = uriEncode(value, /* isObjectName */ false); } else { diff --git a/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc b/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc index 7dd4f60..025cc2b 100644 --- a/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc +++ b/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc @@ -69,37 +69,78 @@ TEST_CASE("uriEncode(): encode reserved chars in an object name", "[AWS][auth][u
[trafficserver] branch master updated: s3_auth:fixed uncaught exception on invalid input
This is an automated email from the ASF dual-hosted git repository. gancho pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 953cde6 s3_auth:fixed uncaught exception on invalid input 953cde6 is described below commit 953cde65b015e0f914fabdc79153fb9d694b18aa Author: Gancho Tenev AuthorDate: Sat Feb 16 09:32:07 2019 -0800 s3_auth:fixed uncaught exception on invalid input Instead of fixing the URI decoding functionality to handle the exception (re)implemented a check for percent encoding which was what was needed. During signature calculation AWS avoids URI encoding of already encoded query parameters (rfc3986#section-2.4 says "implementations must not percent-encode or decode the same string more than once ...") --- plugins/s3_auth/aws_auth_v4.cc | 63 plugins/s3_auth/unit_tests/test_aws_auth_v4.cc | 79 +++--- plugins/s3_auth/unit_tests/test_aws_auth_v4.h | 2 +- 3 files changed, 101 insertions(+), 43 deletions(-) diff --git a/plugins/s3_auth/aws_auth_v4.cc b/plugins/s3_auth/aws_auth_v4.cc index 61f595d..1df1a61 100644 --- a/plugins/s3_auth/aws_auth_v4.cc +++ b/plugins/s3_auth/aws_auth_v4.cc @@ -103,32 +103,52 @@ uriEncode(const String &in, bool isObjectName) } /** - * @brief URI-decode a character string (AWS specific version, see spec) + * @brief checks if the string is URI-encoded (AWS specific encoding version, see spec) * * @see AWS spec: http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html * - * @todo Consider reusing / converting to TSStringPercentDecode() - * Currently we don't build a library/archive so we could link with the unit-test binary. Also using - * different sets of encode/decode functions during runtime and unit-testing did not seem as a good idea. - * @param in string to be URI decoded - * @return encoded string. + * @note According to the following RFC if the string is encoded and contains '%' it should + * be followed by 2 hexadecimal symbols otherwise '%' should be encoded with %25: + * https://tools.ietf.org/html/rfc3986#section-2.1 + * + * @param in string to be URI checked + * @param isObjectName if true encoding didn't encode '/', kept it as it is. + * @return true if encoded, false not encoded. */ -String -uriDecode(const String &in) +bool +isUriEncoded(const String &in, bool isObjectName) { - std::string result; - result.reserve(in.length()); - size_t i = 0; - while (i < in.length()) { -if (in[i] == '%') { - result += static_cast(std::stoi(in.substr(i + 1, 2), nullptr, 16)); - i += 3; -} else { - result += in[i]; - i++; + for (size_t pos = 0; pos < in.length(); pos++) { +char c = in[pos]; + +if (isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') { + /* found a unreserved character which should not have been be encoded regardless + * 'A'-'Z', 'a'-'z', '0'-'9', '-', '.', '_', and '~'. */ + continue; +} + +if (' ' == c) { + /* space should have been encoded with %20 if the string was encoded */ + return false; +} + +if ('/' == c && !isObjectName) { + /* if this is not an object name '/' should have been encoded */ + return false; +} + +if ('%' == c) { + if (pos + 2 < in.length() && std::isxdigit(in[pos + 1]) && std::isxdigit(in[pos + 2])) { +/* if string was encoded we should have exactly 2 hexadecimal chars following it */ +return true; + } else { +/* lonely '%' should have been encoded with %25 according to the RFC so likely not encoded */ +return false; + } } } - return result; + + return false; } /** @@ -290,10 +310,7 @@ getCanonicalRequestSha256Hash(TsInterface &api, bool signPayload, const StringSe paramNames.insert(encodedParam); -/* Look for '%' first trying to avoid as many uri-decode calls as possible. - * it is hard to estimate which is more likely use-case - (1) URIs with uri-encoded query parameter - * values or (2) with unencoded which defines the success of this optimization */ -if (nullptr == memchr(value.c_str(), '%', value.length()) || 0 == uriDecode(value).compare(value)) { +if (!isUriEncoded(value, /* isObjectName */ false)) { /* Not URI-encoded */ paramsMap[encodedParam] = uriEncode(value, /* isObjectName */ false); } else { diff --git a/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc b/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc index 7dd4f60..025cc2b 100644 --- a/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc +++ b/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc @@ -69,37 +69,78 @@ TEST_CASE("uriEncode(): encode reserved chars in an object name", "[AWS][auth][u CHECK_FALSE(encoded.compare("%20/%21%22%23%24%25%26%27%28%29%2A%2B%2C%3