diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 41f81be1db6..e69dc0bd3ba 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -2,7 +2,7 @@
name: Report a bug
about: Create a report to help us improve
labels: kind/bug, priority/P2
-assignees: markdroth
+assignees: nicolasnoble
---
diff --git a/.github/ISSUE_TEMPLATE/cleanup_request.md b/.github/ISSUE_TEMPLATE/cleanup_request.md
index 7da478019fc..c9a6d3f911d 100644
--- a/.github/ISSUE_TEMPLATE/cleanup_request.md
+++ b/.github/ISSUE_TEMPLATE/cleanup_request.md
@@ -2,7 +2,7 @@
name: Request a cleanup
about: Suggest a cleanup in our repository
labels: kind/internal cleanup, priority/P2
-assignees: markdroth
+assignees: nicolasnoble
---
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index 00599d145d8..e3137998ae0 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -2,7 +2,7 @@
name: Request a feature
about: Suggest an idea for this project
labels: kind/enhancement, priority/P2
-assignees: markdroth
+assignees: nicolasnoble
---
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
index 5dc067381f9..cfde18bec27 100644
--- a/.github/ISSUE_TEMPLATE/question.md
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -2,7 +2,7 @@
name: Ask a question
about: Ask a question
labels: kind/question, priority/P3
-assignees: markdroth
+assignees: nicolasnoble
---
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index a85cfad9c7a..57af6c21597 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -8,4 +8,4 @@ If you know who should review your pull request, please remove the mentioning be
-->
-@markdroth
+@nicolasnoble
diff --git a/BUILD b/BUILD
index a31ca64684d..a75ff60dc96 100644
--- a/BUILD
+++ b/BUILD
@@ -251,7 +251,6 @@ GRPCXX_PUBLIC_HDRS = [
"include/grpcpp/security/auth_metadata_processor.h",
"include/grpcpp/security/credentials.h",
"include/grpcpp/security/server_credentials.h",
- "include/grpcpp/security/server_credentials_impl.h",
"include/grpcpp/security/tls_credentials_options.h",
"include/grpcpp/server.h",
"include/grpcpp/server_impl.h",
@@ -408,7 +407,6 @@ grpc_cc_library(
hdrs = [
"include/grpc++/support/error_details.h",
"include/grpcpp/support/error_details.h",
- "include/grpcpp/support/error_details_impl.h",
],
language = "c++",
standalone = True,
diff --git a/BUILD.gn b/BUILD.gn
index bb6cf098224..313e62f4ea9 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1177,7 +1177,6 @@ config("grpc_config") {
"include/grpcpp/security/auth_metadata_processor.h",
"include/grpcpp/security/credentials.h",
"include/grpcpp/security/server_credentials.h",
- "include/grpcpp/security/server_credentials_impl.h",
"include/grpcpp/security/tls_credentials_options.h",
"include/grpcpp/server.h",
"include/grpcpp/server_builder.h",
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d568cb0ebb..7408c1439ca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2820,7 +2820,6 @@ foreach(_hdr
include/grpcpp/security/auth_metadata_processor.h
include/grpcpp/security/credentials.h
include/grpcpp/security/server_credentials.h
- include/grpcpp/security/server_credentials_impl.h
include/grpcpp/security/tls_credentials_options.h
include/grpcpp/server.h
include/grpcpp/server_builder.h
@@ -2990,7 +2989,6 @@ target_link_libraries(grpc++_error_details
foreach(_hdr
include/grpc++/support/error_details.h
include/grpcpp/support/error_details.h
- include/grpcpp/support/error_details_impl.h
)
string(REPLACE "include/" "" _path ${_hdr})
get_filename_component(_path ${_path} PATH)
@@ -3512,7 +3510,6 @@ foreach(_hdr
include/grpcpp/security/auth_metadata_processor.h
include/grpcpp/security/credentials.h
include/grpcpp/security/server_credentials.h
- include/grpcpp/security/server_credentials_impl.h
include/grpcpp/security/tls_credentials_options.h
include/grpcpp/server.h
include/grpcpp/server_builder.h
diff --git a/Makefile b/Makefile
index 8dfb02355d1..cb15ee1cc57 100644
--- a/Makefile
+++ b/Makefile
@@ -4944,7 +4944,6 @@ PUBLIC_HEADERS_CXX += \
include/grpcpp/security/auth_metadata_processor.h \
include/grpcpp/security/credentials.h \
include/grpcpp/security/server_credentials.h \
- include/grpcpp/security/server_credentials_impl.h \
include/grpcpp/security/tls_credentials_options.h \
include/grpcpp/server.h \
include/grpcpp/server_builder.h \
@@ -5121,7 +5120,6 @@ LIBGRPC++_ERROR_DETAILS_SRC = \
PUBLIC_HEADERS_CXX += \
include/grpc++/support/error_details.h \
include/grpcpp/support/error_details.h \
- include/grpcpp/support/error_details_impl.h \
LIBGRPC++_ERROR_DETAILS_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC++_ERROR_DETAILS_SRC))))
@@ -5634,7 +5632,6 @@ PUBLIC_HEADERS_CXX += \
include/grpcpp/security/auth_metadata_processor.h \
include/grpcpp/security/credentials.h \
include/grpcpp/security/server_credentials.h \
- include/grpcpp/security/server_credentials_impl.h \
include/grpcpp/security/tls_credentials_options.h \
include/grpcpp/server.h \
include/grpcpp/server_builder.h \
diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl
index e53777d0743..335c1f02e2a 100644
--- a/bazel/grpc_deps.bzl
+++ b/bazel/grpc_deps.bzl
@@ -283,11 +283,11 @@ def grpc_deps():
if "upb" not in native.existing_rules():
http_archive(
name = "upb",
- sha256 = "79f7de61203c4ee5e4fcb2f17c5f3338119d6eb94aca8bce05332d2c1cfee108",
- strip_prefix = "upb-92e63da73328d01b417cf26c2de7b0a27a0f83af",
+ sha256 = "7992217989f3156f8109931c1fc6db3434b7414957cb82371552377beaeb9d6c",
+ strip_prefix = "upb-382d5afc60e05470c23e8de19b19fc5ad231e732",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/92e63da73328d01b417cf26c2de7b0a27a0f83af.tar.gz",
- "https://github.com/protocolbuffers/upb/archive/92e63da73328d01b417cf26c2de7b0a27a0f83af.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/382d5afc60e05470c23e8de19b19fc5ad231e732.tar.gz",
+ "https://github.com/protocolbuffers/upb/archive/382d5afc60e05470c23e8de19b19fc5ad231e732.tar.gz",
],
)
diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml
index 93d439dd25b..9bd597bad31 100644
--- a/build_autogenerated.yaml
+++ b/build_autogenerated.yaml
@@ -2152,7 +2152,6 @@ libs:
- include/grpcpp/security/auth_metadata_processor.h
- include/grpcpp/security/credentials.h
- include/grpcpp/security/server_credentials.h
- - include/grpcpp/security/server_credentials_impl.h
- include/grpcpp/security/tls_credentials_options.h
- include/grpcpp/server.h
- include/grpcpp/server_builder.h
@@ -2277,7 +2276,6 @@ libs:
public_headers:
- include/grpc++/support/error_details.h
- include/grpcpp/support/error_details.h
- - include/grpcpp/support/error_details_impl.h
headers: []
src:
- src/proto/grpc/status/status.proto
@@ -2536,7 +2534,6 @@ libs:
- include/grpcpp/security/auth_metadata_processor.h
- include/grpcpp/security/credentials.h
- include/grpcpp/security/server_credentials.h
- - include/grpcpp/security/server_credentials_impl.h
- include/grpcpp/security/tls_credentials_options.h
- include/grpcpp/server.h
- include/grpcpp/server_builder.h
diff --git a/cmake/re2.cmake b/cmake/re2.cmake
index 383d64faa72..3e83aae6910 100644
--- a/cmake/re2.cmake
+++ b/cmake/re2.cmake
@@ -21,6 +21,9 @@ if(gRPC_RE2_PROVIDER STREQUAL "module")
set(RE2_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/re2)
endif()
if(EXISTS "${RE2_ROOT_DIR}/CMakeLists.txt")
+ # Explicitly disable BUILD_TESTING to avoid re2's CMakeLists.txt triggering https://github.com/grpc/grpc/issues/23586
+ option(BUILD_TESTING "re2.cmake explicitly disabled CTest's BUILD_TESTING option." OFF)
+
include_directories("${RE2_ROOT_DIR}")
add_subdirectory(${RE2_ROOT_DIR} third_party/re2)
diff --git a/doc/grpc_xds_features.md b/doc/grpc_xds_features.md
index 3537db2b965..798a072e7ce 100644
--- a/doc/grpc_xds_features.md
+++ b/doc/grpc_xds_features.md
@@ -36,5 +36,6 @@ to authenticate with the xDS server.
Features | gRFCs | [C++, Python,
Ruby, PHP, C#](https://github.com/grpc/grpc/releases) | [Java](https://github.com/grpc/grpc-java/releases) | [Go](https://github.com/grpc/grpc-go/releases)
---------|--------|--------------|------|------
-**xDS Infrastructure in gRPC client channel:**
LDS->RDS->CDS->EDS flow,
ADS stream, | [A27](https://github.com/grpc/proposal/blob/master/A27-xds-global-load-balancing.md) | v1.30.0 | v1.30.0 | v1.30.0 |
-**Load Balancing:**
Virtual host matching,
Only default path ("" or "/") matching,
Priority-based weighted round-robin locality picking,
Round-robin endpoint picking within locality,
Cluster route action,
Client-side Load reporting via [LRS](https://github.com/envoyproxy/data-plane-api/blob/master/envoy/service/load_stats/v2/lrs.proto)| [A27](https://github.com/grpc/proposal/blob/master/A27-xds-global-load-balancing.md) | v1.30.0 | v1.30.0 | v1.30.0 |
+**xDS Infrastructure in gRPC client channel:**
- LDS->RDS->CDS->EDS flow
- ADS stream
| [A27](https://github.com/grpc/proposal/blob/master/A27-xds-global-load-balancing.md) | v1.30.0 | v1.30.0 | v1.30.0 |
+**Load Balancing:**- [Virtual host](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/route/route_components.proto#route-virtualhost) domains matching
- Only default path ("" or "/") matching
- Priority-based weighted round-robin locality picking
- Round-robin endpoint picking within locality
- [Cluster](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/route/route_components.proto#envoy-api-msg-route-routeaction) route action
- Client-side Load reporting via [LRS](https://github.com/envoyproxy/data-plane-api/blob/master/envoy/service/load_stats/v2/lrs.proto)
| [A27](https://github.com/grpc/proposal/blob/master/A27-xds-global-load-balancing.md) | v1.30.0 | v1.30.0 | v1.30.0 |
+Request matching based on:- [Path](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/route/route_components.proto#route-routematch) (prefix, full path and safe regex)
- [Headers](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/route/route_components.proto#route-headermatcher)
Request routing to multiple clusters based on [weights](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/route/route_components.proto#route-weightedcluster) | [A28](https://github.com/grpc/proposal/blob/master/A28-xds-traffic-splitting-and-routing.md) | v1.31.0 | v1.31.0 | v1.31.0 |
diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec
index 43394c48cff..b6307dd5c6f 100644
--- a/gRPC-C++.podspec
+++ b/gRPC-C++.podspec
@@ -164,7 +164,6 @@ Pod::Spec.new do |s|
'include/grpcpp/security/auth_metadata_processor.h',
'include/grpcpp/security/credentials.h',
'include/grpcpp/security/server_credentials.h',
- 'include/grpcpp/security/server_credentials_impl.h',
'include/grpcpp/security/tls_credentials_options.h',
'include/grpcpp/server.h',
'include/grpcpp/server_builder.h',
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h
index a3d3bb27b5a..33f8a1a59d6 100644
--- a/include/grpc/impl/codegen/port_platform.h
+++ b/include/grpc/impl/codegen/port_platform.h
@@ -31,8 +31,13 @@
* Defines GPR_ABSEIL_SYNC to use synchronization features from Abseil
*/
#ifndef GPR_ABSEIL_SYNC
+#if defined(__APPLE__)
+// This is disabled on Apple platforms because macos/grpc_basictests_c_cpp
+// fails with this. https://github.com/grpc/grpc/issues/23661
+#else
#define GPR_ABSEIL_SYNC 1
#endif
+#endif // GPR_ABSEIL_SYNC
/* Get windows.h included everywhere (we need it) */
#if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)
diff --git a/include/grpcpp/impl/codegen/server_interface.h b/include/grpcpp/impl/codegen/server_interface.h
index 3294c4037b5..0c556f0a5f0 100644
--- a/include/grpcpp/impl/codegen/server_interface.h
+++ b/include/grpcpp/impl/codegen/server_interface.h
@@ -36,12 +36,12 @@ namespace grpc_impl {
class Channel;
class CompletionQueue;
class ServerCompletionQueue;
-class ServerCredentials;
} // namespace grpc_impl
namespace grpc {
class AsyncGenericService;
class GenericServerContext;
+class ServerCredentials;
class Service;
extern CoreCodegenInterface* g_core_codegen_interface;
@@ -173,7 +173,7 @@ class ServerInterface : public internal::CallHook {
///
/// \warning It's an error to call this method on an already started server.
virtual int AddListeningPort(const std::string& addr,
- grpc_impl::ServerCredentials* creds) = 0;
+ ServerCredentials* creds) = 0;
/// Start the server.
///
diff --git a/include/grpcpp/security/server_credentials.h b/include/grpcpp/security/server_credentials.h
index 1223b10978e..189f491a37d 100644
--- a/include/grpcpp/security/server_credentials.h
+++ b/include/grpcpp/security/server_credentials.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2019 gRPC authors.
+ * Copyright 2015 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,15 @@
#ifndef GRPCPP_SECURITY_SERVER_CREDENTIALS_H
#define GRPCPP_SECURITY_SERVER_CREDENTIALS_H
-#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+struct grpc_server;
namespace grpc_impl {
@@ -27,8 +35,6 @@ class Server;
} // namespace grpc_impl
namespace grpc {
-typedef ::grpc_impl::ServerCredentials ServerCredentials;
-
/// Options to create ServerCredentials with SSL
struct SslServerCredentialsOptions {
/// \warning Deprecated
@@ -55,16 +61,45 @@ struct SslServerCredentialsOptions {
grpc_ssl_client_certificate_request_type client_certificate_request;
};
+/// Wrapper around \a grpc_server_credentials, a way to authenticate a server.
+class ServerCredentials {
+ public:
+ virtual ~ServerCredentials();
+
+ /// This method is not thread-safe and has to be called before the server is
+ /// started. The last call to this function wins.
+ virtual void SetAuthMetadataProcessor(
+ const std::shared_ptr& processor) = 0;
+
+ private:
+ friend class ::grpc_impl::Server;
+
+ /// Tries to bind \a server to the given \a addr (eg, localhost:1234,
+ /// 192.168.1.1:31416, [::1]:27182, etc.)
+ ///
+ /// \return bound port number on success, 0 on failure.
+ // TODO(dgq): the "port" part seems to be a misnomer.
+ virtual int AddPortToServer(const std::string& addr, grpc_server* server) = 0;
+};
+
+/// Builds SSL ServerCredentials given SSL specific options
std::shared_ptr SslServerCredentials(
- const SslServerCredentialsOptions& options);
+ const grpc::SslServerCredentialsOptions& options);
std::shared_ptr InsecureServerCredentials();
namespace experimental {
-typedef ::grpc_impl::experimental::AltsServerCredentialsOptions
- AltsServerCredentialsOptions;
+/// Options to create ServerCredentials with ALTS
+struct AltsServerCredentialsOptions {
+ /// Add fields if needed.
+};
+
+/// Builds ALTS ServerCredentials given ALTS specific options
+std::shared_ptr AltsServerCredentials(
+ const AltsServerCredentialsOptions& options);
+/// Builds Local ServerCredentials.
std::shared_ptr AltsServerCredentials(
const AltsServerCredentialsOptions& options);
@@ -73,7 +108,7 @@ std::shared_ptr LocalServerCredentials(
/// Builds TLS ServerCredentials given TLS options.
std::shared_ptr TlsServerCredentials(
- const ::grpc::experimental::TlsCredentialsOptions& options);
+ const experimental::TlsCredentialsOptions& options);
} // namespace experimental
} // namespace grpc
diff --git a/include/grpcpp/security/server_credentials_impl.h b/include/grpcpp/security/server_credentials_impl.h
deleted file mode 100644
index 734409ab8e5..00000000000
--- a/include/grpcpp/security/server_credentials_impl.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPCPP_SECURITY_SERVER_CREDENTIALS_IMPL_H
-#define GRPCPP_SECURITY_SERVER_CREDENTIALS_IMPL_H
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-struct grpc_server;
-
-namespace grpc {
-
-struct SslServerCredentialsOptions;
-} // namespace grpc
-namespace grpc_impl {
-class Server;
-
-/// Wrapper around \a grpc_server_credentials, a way to authenticate a server.
-class ServerCredentials {
- public:
- virtual ~ServerCredentials();
-
- /// This method is not thread-safe and has to be called before the server is
- /// started. The last call to this function wins.
- virtual void SetAuthMetadataProcessor(
- const std::shared_ptr& processor) = 0;
-
- private:
- friend class ::grpc_impl::Server;
-
- /// Tries to bind \a server to the given \a addr (eg, localhost:1234,
- /// 192.168.1.1:31416, [::1]:27182, etc.)
- ///
- /// \return bound port number on success, 0 on failure.
- // TODO(dgq): the "port" part seems to be a misnomer.
- virtual int AddPortToServer(const std::string& addr, grpc_server* server) = 0;
-};
-
-/// Builds SSL ServerCredentials given SSL specific options
-std::shared_ptr SslServerCredentials(
- const grpc::SslServerCredentialsOptions& options);
-
-/// Builds insecure server credentials.
-std::shared_ptr InsecureServerCredentials();
-
-namespace experimental {
-
-/// Options to create ServerCredentials with ALTS
-struct AltsServerCredentialsOptions {
- /// Add fields if needed.
-};
-
-/// Builds ALTS ServerCredentials given ALTS specific options
-std::shared_ptr AltsServerCredentials(
- const AltsServerCredentialsOptions& options);
-
-/// Builds Local ServerCredentials.
-std::shared_ptr LocalServerCredentials(
- grpc_local_connect_type type);
-
-/// Builds TLS ServerCredentials given TLS options.
-std::shared_ptr TlsServerCredentials(
- const grpc::experimental::TlsCredentialsOptions& options);
-
-} // namespace experimental
-} // namespace grpc_impl
-
-#endif // GRPCPP_SECURITY_SERVER_CREDENTIALS_IMPL_H
diff --git a/include/grpcpp/server_builder.h b/include/grpcpp/server_builder.h
index 46057f50c85..a32101732c7 100644
--- a/include/grpcpp/server_builder.h
+++ b/include/grpcpp/server_builder.h
@@ -43,13 +43,13 @@ namespace grpc_impl {
class CompletionQueue;
class Server;
class ServerCompletionQueue;
-class ServerCredentials;
} // namespace grpc_impl
namespace grpc {
class AsyncGenericService;
class ResourceQuota;
+class ServerCredentials;
class Service;
namespace testing {
class ServerBuilderPluginTest;
@@ -134,7 +134,7 @@ class ServerBuilder {
/// does not modify this pointer.
ServerBuilder& AddListeningPort(
const std::string& addr_uri,
- std::shared_ptr creds,
+ std::shared_ptr creds,
int* selected_port = nullptr);
/// Add a completion queue for handling asynchronous services.
@@ -316,7 +316,7 @@ class ServerBuilder {
/// Experimental, to be deprecated
struct Port {
std::string addr;
- std::shared_ptr creds;
+ std::shared_ptr creds;
int* selected_port;
};
@@ -384,7 +384,7 @@ class ServerBuilder {
/// List of completion queues added via \a AddCompletionQueue method.
std::vector cqs_;
- std::shared_ptr creds_;
+ std::shared_ptr creds_;
std::vector> plugins_;
grpc_resource_quota* resource_quota_;
grpc::AsyncGenericService* generic_service_{nullptr};
diff --git a/include/grpcpp/support/error_details.h b/include/grpcpp/support/error_details.h
index 07bc750db5c..15b917f6c5c 100644
--- a/include/grpcpp/support/error_details.h
+++ b/include/grpcpp/support/error_details.h
@@ -19,7 +19,7 @@
#ifndef GRPCPP_SUPPORT_ERROR_DETAILS_H
#define GRPCPP_SUPPORT_ERROR_DETAILS_H
-#include
+#include
namespace google {
namespace rpc {
@@ -29,15 +29,19 @@ class Status;
namespace grpc {
-static inline Status ExtractErrorDetails(const Status& from,
- ::google::rpc::Status* to) {
- return ::grpc_impl::ExtractErrorDetails(from, to);
-}
-
-static inline Status SetErrorDetails(const ::google::rpc::Status& from,
- Status* to) {
- return ::grpc_impl::SetErrorDetails(from, to);
-}
+/// Map a \a grpc::Status to a \a google::rpc::Status.
+/// The given \a to object will be cleared.
+/// On success, returns status with OK.
+/// Returns status with \a INVALID_ARGUMENT, if failed to deserialize.
+/// Returns status with \a FAILED_PRECONDITION, if \a to is nullptr.
+grpc::Status ExtractErrorDetails(const grpc::Status& from,
+ ::google::rpc::Status* to);
+
+/// Map \a google::rpc::Status to a \a grpc::Status.
+/// Returns OK on success.
+/// Returns status with \a FAILED_PRECONDITION if \a to is nullptr.
+grpc::Status SetErrorDetails(const ::google::rpc::Status& from,
+ grpc::Status* to);
} // namespace grpc
diff --git a/include/grpcpp/support/error_details_impl.h b/include/grpcpp/support/error_details_impl.h
deleted file mode 100644
index ae5f04ced8f..00000000000
--- a/include/grpcpp/support/error_details_impl.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPCPP_SUPPORT_ERROR_DETAILS_IMPL_H
-#define GRPCPP_SUPPORT_ERROR_DETAILS_IMPL_H
-
-#include
-
-namespace google {
-namespace rpc {
-class Status;
-} // namespace rpc
-} // namespace google
-
-namespace grpc_impl {
-
-/// Map a \a grpc::Status to a \a google::rpc::Status.
-/// The given \a to object will be cleared.
-/// On success, returns status with OK.
-/// Returns status with \a INVALID_ARGUMENT, if failed to deserialize.
-/// Returns status with \a FAILED_PRECONDITION, if \a to is nullptr.
-grpc::Status ExtractErrorDetails(const grpc::Status& from,
- ::google::rpc::Status* to);
-
-/// Map \a google::rpc::Status to a \a grpc::Status.
-/// Returns OK on success.
-/// Returns status with \a FAILED_PRECONDITION if \a to is nullptr.
-grpc::Status SetErrorDetails(const ::google::rpc::Status& from,
- grpc::Status* to);
-
-} // namespace grpc_impl
-
-#endif // GRPCPP_SUPPORT_ERROR_DETAILS_IMPL_H
diff --git a/setup.py b/setup.py
index 2fb0296506e..90df0a1042e 100644
--- a/setup.py
+++ b/setup.py
@@ -12,6 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""A setup module for the GRPC Python package."""
+
+# setuptools need to be imported before distutils. Otherwise it might lead to
+# undesirable behaviors or errors.
+import setuptools
+
from distutils import cygwinccompiler
from distutils import extension as _extension
from distutils import util
@@ -25,7 +30,6 @@ import shutil
import sys
import sysconfig
-import setuptools
from setuptools.command import egg_info
import subprocess
diff --git a/src/boringssl/gen_build_yaml.py b/src/boringssl/gen_build_yaml.py
index b54f53df095..0b869fa64f3 100755
--- a/src/boringssl/gen_build_yaml.py
+++ b/src/boringssl/gen_build_yaml.py
@@ -13,24 +13,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from __future__ import print_function
-import shutil
-import sys
+import json
import os
+import sys
import yaml
-sys.dont_write_bytecode = True
-
-boring_ssl_root = os.path.abspath(
- os.path.join(os.path.dirname(sys.argv[0]),
- '../../third_party/boringssl-with-bazel/src'))
-sys.path.append(os.path.join(boring_ssl_root, 'util'))
-
+run_dir = os.path.dirname(sys.argv[0])
+sources_path = os.path.abspath(
+ os.path.join(run_dir,
+ '../../third_party/boringssl-with-bazel/sources.json'))
try:
- import generate_build_files
-except ImportError:
- print(yaml.dump({}))
- sys.exit()
+ with open(sources_path, 'r') as s:
+ sources = json.load(s)
+except IOError:
+ sources_path = os.path.abspath(
+ os.path.join(run_dir,
+ '../../../../third_party/openssl/boringssl/sources.json'))
+ with open(sources_path, 'r') as s:
+ sources = json.load(s)
def map_dir(filename):
@@ -38,18 +38,19 @@ def map_dir(filename):
class Grpc(object):
- """Implements a "platform" in the sense of boringssl's generate_build_files.py"""
- yaml = None
+ """Adapter for boring-SSL json sources files. """
- def WriteFiles(self, files, asm_outputs):
- test_binaries = ['ssl_test', 'crypto_test']
+ def __init__(self, sources):
+ self.yaml = None
+ self.WriteFiles(sources)
+ def WriteFiles(self, files):
+ test_binaries = ['ssl_test', 'crypto_test']
self.yaml = {
'#':
'generated with src/boringssl/gen_build_yaml.py',
'raw_boringssl_build_output_for_debugging': {
'files': files,
- 'asm_outputs': asm_outputs,
},
'libs': [
{
@@ -120,29 +121,5 @@ class Grpc(object):
}
-os.chdir(os.path.dirname(sys.argv[0]))
-os.mkdir('src')
-try:
- for f in os.listdir(boring_ssl_root):
- os.symlink(os.path.join(boring_ssl_root, f), os.path.join('src', f))
-
- grpc_platform = Grpc()
- # We use a hack to run boringssl's util/generate_build_files.py as part of this script.
- # The call will populate "grpc_platform" with boringssl's source file metadata.
- # As a side effect this script generates err_data.c and crypto_test_data.cc (requires golang)
- # Both of these files are already available under third_party/boringssl-with-bazel
- # so we don't need to generate them again, but there's no option to disable that behavior.
- # - crypto_test_data.cc is required to run boringssl_crypto_test but we already
- # use the copy under third_party/boringssl-with-bazel so we just delete it
- # - err_data.c is already under third_party/boringssl-with-bazel so we just delete it
- generate_build_files.main([grpc_platform])
-
- print(yaml.dump(grpc_platform.yaml))
-
-finally:
- # we don't want err_data.c and crypto_test_data.cc (see comment above)
- if os.path.exists('err_data.c'):
- os.remove('err_data.c')
- if os.path.exists('crypto_test_data.cc'):
- os.remove('crypto_test_data.cc')
- shutil.rmtree('src')
+grpc_platform = Grpc(sources)
+print(yaml.dump(grpc_platform.yaml))
diff --git a/src/core/ext/filters/client_channel/client_channel.h b/src/core/ext/filters/client_channel/client_channel.h
index 2ba2b87bb13..35c2a2af6b2 100644
--- a/src/core/ext/filters/client_channel/client_channel.h
+++ b/src/core/ext/filters/client_channel/client_channel.h
@@ -79,4 +79,4 @@ void grpc_client_channel_stop_connectivity_watch(
grpc_core::RefCountedPtr
grpc_client_channel_get_subchannel_call(grpc_call_element* elem);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H */
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
diff --git a/src/core/ext/filters/client_channel/http_connect_handshaker.cc b/src/core/ext/filters/client_channel/http_connect_handshaker.cc
index 3f60f0ff373..620cc89e334 100644
--- a/src/core/ext/filters/client_channel/http_connect_handshaker.cc
+++ b/src/core/ext/filters/client_channel/http_connect_handshaker.cc
@@ -325,10 +325,9 @@ void HttpConnectHandshaker::DoHandshake(grpc_tcp_server_acceptor* /*acceptor*/,
args_ = args;
on_handshake_done_ = on_handshake_done;
// Log connection via proxy.
- char* proxy_name = grpc_endpoint_get_peer(args->endpoint);
+ std::string proxy_name(grpc_endpoint_get_peer(args->endpoint));
gpr_log(GPR_INFO, "Connecting to server %s via HTTP proxy %s", server_name,
- proxy_name);
- gpr_free(proxy_name);
+ proxy_name.c_str());
// Construct HTTP CONNECT request.
grpc_httpcli_request request;
request.host = server_name;
diff --git a/src/core/ext/filters/client_channel/server_address.cc b/src/core/ext/filters/client_channel/server_address.cc
index 93d361a8154..16ec96b7b56 100644
--- a/src/core/ext/filters/client_channel/server_address.cc
+++ b/src/core/ext/filters/client_channel/server_address.cc
@@ -26,23 +26,56 @@ namespace grpc_core {
// ServerAddress
//
-ServerAddress::ServerAddress(const grpc_resolved_address& address,
- grpc_channel_args* args)
- : address_(address), args_(args) {}
+ServerAddress::ServerAddress(
+ const grpc_resolved_address& address, grpc_channel_args* args,
+ std::map> attributes)
+ : address_(address), args_(args), attributes_(std::move(attributes)) {}
-ServerAddress::ServerAddress(const void* address, size_t address_len,
- grpc_channel_args* args)
- : args_(args) {
+ServerAddress::ServerAddress(
+ const void* address, size_t address_len, grpc_channel_args* args,
+ std::map> attributes)
+ : args_(args), attributes_(std::move(attributes)) {
memcpy(address_.addr, address, address_len);
address_.len = static_cast(address_len);
}
+namespace {
+
+int CompareAttributes(
+ const std::map>&
+ attributes1,
+ const std::map>&
+ attributes2) {
+ auto it2 = attributes2.begin();
+ for (auto it1 = attributes1.begin(); it1 != attributes1.end(); ++it1) {
+ // attributes2 has fewer elements than attributes1
+ if (it2 == attributes2.end()) return -1;
+ // compare keys
+ int retval = strcmp(it1->first, it2->first);
+ if (retval != 0) return retval;
+ // compare values
+ retval = it1->second->Cmp(it2->second.get());
+ if (retval != 0) return retval;
+ ++it2;
+ }
+ // attributes1 has fewer elements than attributes2
+ if (it2 != attributes2.end()) return 1;
+ // equal
+ return 0;
+}
+
+} // namespace
+
int ServerAddress::Cmp(const ServerAddress& other) const {
if (address_.len > other.address_.len) return 1;
if (address_.len < other.address_.len) return -1;
int retval = memcmp(address_.addr, other.address_.addr, address_.len);
if (retval != 0) return retval;
- return grpc_channel_args_compare(args_, other.args_);
+ retval = grpc_channel_args_compare(args_, other.args_);
+ if (retval != 0) return retval;
+ return CompareAttributes(attributes_, other.attributes_);
}
} // namespace grpc_core
diff --git a/src/core/ext/filters/client_channel/server_address.h b/src/core/ext/filters/client_channel/server_address.h
index f53dd3c7dd5..4a28ea75205 100644
--- a/src/core/ext/filters/client_channel/server_address.h
+++ b/src/core/ext/filters/client_channel/server_address.h
@@ -21,6 +21,8 @@
#include
+#include