Merge remote-tracking branch 'upstream/master' into log

pull/24949/head
Donna Dionne 4 years ago
commit d64d0bfe12
  1. 3
      src/core/lib/gprpp/arena.h
  2. 8
      src/core/lib/security/security_connector/tls/tls_security_connector.cc
  3. 4
      src/core/lib/uri/uri_parser.cc
  4. 6
      src/python/grpcio/grpc/aio/_base_server.py
  5. 2
      test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc
  6. 4
      test/core/client_channel/resolvers/dns_resolver_test.cc
  7. 2
      test/core/uri/uri_parser_test.cc
  8. 4
      tools/internal_ci/helper_scripts/prepare_build_macos_rc

@ -96,7 +96,8 @@ class Arena {
// where we wish to create an arena and then perform an immediate // where we wish to create an arena and then perform an immediate
// allocation. // allocation.
explicit Arena(size_t initial_size, size_t initial_alloc = 0) explicit Arena(size_t initial_size, size_t initial_alloc = 0)
: total_used_(initial_alloc), initial_zone_size_(initial_size) {} : total_used_(GPR_ROUND_UP_TO_ALIGNMENT_SIZE(initial_alloc)),
initial_zone_size_(initial_size) {}
~Arena(); ~Arena();

@ -259,9 +259,9 @@ void TlsChannelSecurityConnector::check_peer(
if (check_arg_->subject_alternative_names != nullptr) { if (check_arg_->subject_alternative_names != nullptr) {
for (size_t i = 0; i < check_arg_->subject_alternative_names_size; for (size_t i = 0; i < check_arg_->subject_alternative_names_size;
++i) { ++i) {
delete check_arg_->subject_alternative_names[i]; delete[] check_arg_->subject_alternative_names[i];
} }
delete check_arg_->subject_alternative_names; delete[] check_arg_->subject_alternative_names;
} }
check_arg_->subject_alternative_names_size = check_arg_->subject_alternative_names_size =
subject_alternative_names.size(); subject_alternative_names.size();
@ -463,9 +463,9 @@ void TlsChannelSecurityConnector::ServerAuthorizationCheckArgDestroy(
gpr_free(const_cast<char*>(arg->peer_cert)); gpr_free(const_cast<char*>(arg->peer_cert));
gpr_free(const_cast<char*>(arg->peer_cert_full_chain)); gpr_free(const_cast<char*>(arg->peer_cert_full_chain));
for (size_t i = 0; i < arg->subject_alternative_names_size; ++i) { for (size_t i = 0; i < arg->subject_alternative_names_size; ++i) {
delete arg->subject_alternative_names[i]; delete[] arg->subject_alternative_names[i];
} }
delete arg->subject_alternative_names; delete[] arg->subject_alternative_names;
delete arg->error_details; delete arg->error_details;
if (arg->destroy_context != nullptr) { if (arg->destroy_context != nullptr) {
arg->destroy_context(arg->context); arg->destroy_context(arg->context);

@ -46,13 +46,15 @@ std::string PercentDecode(absl::string_view str) {
std::string unescaped; std::string unescaped;
out.reserve(str.size()); out.reserve(str.size());
for (size_t i = 0; i < str.length(); i++) { for (size_t i = 0; i < str.length(); i++) {
unescaped = "";
if (str[i] != '%') { if (str[i] != '%') {
out += str[i]; out += str[i];
continue; continue;
} }
if (i + 3 >= str.length() || if (i + 3 >= str.length() ||
!absl::CUnescape(absl::StrCat("\\x", str.substr(i + 1, 2)), !absl::CUnescape(absl::StrCat("\\x", str.substr(i + 1, 2)),
&unescaped)) { &unescaped) ||
unescaped.length() > 1) {
out += str[i]; out += str[i];
} else { } else {
out += unescaped[0]; out += unescaped[0];

@ -169,8 +169,10 @@ class ServicerContext(Generic[RequestType, ResponseType], abc.ABC):
""" """
@abc.abstractmethod @abc.abstractmethod
async def abort(self, code: grpc.StatusCode, details: str, async def abort(self,
trailing_metadata: Metadata) -> None: code: grpc.StatusCode,
details: str = '',
trailing_metadata: Metadata = tuple()) -> None:
"""Raises an exception to terminate the RPC with a non-OK status. """Raises an exception to terminate the RPC with a non-OK status.
The code and details passed as arguments will supercede any existing The code and details passed as arguments will supercede any existing

@ -285,7 +285,7 @@ static void start_test_under_work_serializer(void* arg) {
gpr_log(GPR_DEBUG, "test: '%s' should be valid for '%s'", res_cb_arg->uri_str, gpr_log(GPR_DEBUG, "test: '%s' should be valid for '%s'", res_cb_arg->uri_str,
factory->scheme()); factory->scheme());
if (!uri.ok()) { if (!uri.ok()) {
gpr_log(GPR_ERROR, uri.status().ToString().c_str()); gpr_log(GPR_ERROR, "%s", uri.status().ToString().c_str());
GPR_ASSERT(uri.ok()); GPR_ASSERT(uri.ok());
} }
grpc_core::ResolverArgs args; grpc_core::ResolverArgs args;

@ -42,7 +42,7 @@ static void test_succeeds(grpc_core::ResolverFactory* factory,
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
absl::StatusOr<grpc_core::URI> uri = grpc_core::URI::Parse(string); absl::StatusOr<grpc_core::URI> uri = grpc_core::URI::Parse(string);
if (!uri.ok()) { if (!uri.ok()) {
gpr_log(GPR_ERROR, uri.status().ToString().c_str()); gpr_log(GPR_ERROR, "%s", uri.status().ToString().c_str());
GPR_ASSERT(uri.ok()); GPR_ASSERT(uri.ok());
} }
grpc_core::ResolverArgs args; grpc_core::ResolverArgs args;
@ -61,7 +61,7 @@ static void test_fails(grpc_core::ResolverFactory* factory,
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
absl::StatusOr<grpc_core::URI> uri = grpc_core::URI::Parse(string); absl::StatusOr<grpc_core::URI> uri = grpc_core::URI::Parse(string);
if (!uri.ok()) { if (!uri.ok()) {
gpr_log(GPR_ERROR, uri.status().ToString().c_str()); gpr_log(GPR_ERROR, "%s", uri.status().ToString().c_str());
GPR_ASSERT(uri.ok()); GPR_ASSERT(uri.ok());
} }
grpc_core::ResolverArgs args; grpc_core::ResolverArgs args;

@ -146,6 +146,8 @@ int main(int argc, char** argv) {
{{"bar", ""}}, "lol?/"); {{"bar", ""}}, "lol?/");
test_succeeds("ipv6:[2001:db8::1%252]:12345", "ipv6", "", test_succeeds("ipv6:[2001:db8::1%252]:12345", "ipv6", "",
"[2001:db8::1%2]:12345", {}, {}, ""); "[2001:db8::1%2]:12345", {}, {}, "");
test_succeeds("ipv6:[fe80::90%eth1.sky1]:6010", "ipv6", "",
"[fe80::90%eth1.sky1]:6010", {}, {}, "");
test_succeeds("https://www.google.com/?a=1%26b%3D2&c=3", "https", test_succeeds("https://www.google.com/?a=1%26b%3D2&c=3", "https",
"www.google.com", "/", {{"c", "3"}, {"a", "1&b=2"}}, "www.google.com", "/", {{"c", "3"}, {"a", "1&b=2"}},
{{"a", "1&b=2"}, {"c", "3"}}, ""); {{"a", "1&b=2"}, {"c", "3"}}, "");

@ -67,7 +67,7 @@ then
time git clone --depth 1 https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master time git clone --depth 1 https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
# Needed for ios-binary-size # Needed for ios-binary-size
time pip install --user pyyaml pyjwt cryptography requests time pip install --user pyyaml pyjwt pyOpenSSL cryptography requests
# Store intermediate build files of ObjC tests into /tmpfs # Store intermediate build files of ObjC tests into /tmpfs
# TODO(jtattermusch): this has likely been done to avoid running # TODO(jtattermusch): this has likely been done to avoid running
@ -85,7 +85,7 @@ if [ "${PREPARE_BUILD_INSTALL_DEPS_PYTHON}" == "true" ]
then then
# python # python
time pip install --user virtualenv time pip install --user virtualenv
time pip install --user --upgrade Mako tox setuptools==44.1.1 twisted pyyaml pyjwt cryptography requests time pip install --user --upgrade Mako tox setuptools==44.1.1 twisted pyyaml pyjwt pyOpenSSL cryptography requests
# Install Python 3.7 if it doesn't exist # Install Python 3.7 if it doesn't exist
if [ ! -f "/usr/local/bin/python3.7" ]; then if [ ! -f "/usr/local/bin/python3.7" ]; then

Loading…
Cancel
Save