aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/common
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-08-28 12:55:40 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-08-28 12:55:40 -0700
commit6076b1d7982b4d0778dd68c236075b5c36b72e0d (patch)
tree1da2c80065a6844ca0480bd83217792cc3185886 /src/cpp/common
parent3f002567c4c1f8cc7542aeee2d60d6d0c4c5dd54 (diff)
parent4b5b019d5644affef122e06c6898811286850b8d (diff)
Merge branch 'channelz-subchannels' into channelz-server
Diffstat (limited to 'src/cpp/common')
-rw-r--r--src/cpp/common/channel_filter.cc9
-rw-r--r--src/cpp/common/channel_filter.h7
-rw-r--r--src/cpp/common/resource_quota_cc.cc4
-rw-r--r--src/cpp/common/version_cc.cc2
4 files changed, 8 insertions, 14 deletions
diff --git a/src/cpp/common/channel_filter.cc b/src/cpp/common/channel_filter.cc
index 0634b0416f..422e7bb65e 100644
--- a/src/cpp/common/channel_filter.cc
+++ b/src/cpp/common/channel_filter.cc
@@ -78,13 +78,8 @@ bool MaybeAddFilter(grpc_channel_stack_builder* builder, void* arg) {
grpc_channel_stack_builder_get_channel_arguments(builder);
if (!filter.include_filter(*args)) return true;
}
- if (filter.prepend) {
- return grpc_channel_stack_builder_prepend_filter(builder, &filter.filter,
- nullptr, nullptr);
- } else {
- return grpc_channel_stack_builder_append_filter(builder, &filter.filter,
- nullptr, nullptr);
- }
+ return grpc_channel_stack_builder_prepend_filter(builder, &filter.filter,
+ nullptr, nullptr);
}
} // namespace
diff --git a/src/cpp/common/channel_filter.h b/src/cpp/common/channel_filter.h
index 359c72737c..5e569c97e6 100644
--- a/src/cpp/common/channel_filter.h
+++ b/src/cpp/common/channel_filter.h
@@ -36,8 +36,7 @@
/// \c ChannelData. Then register the filter using something like this:
/// \code{.cpp}
/// RegisterChannelFilter<MyChannelDataSubclass, MyCallDataSubclass>(
-/// "name-of-filter", GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_PRIORITY_LOW,
-/// true, nullptr);
+/// "name-of-filter", GRPC_SERVER_CHANNEL, INT_MAX, nullptr);
/// \endcode
namespace grpc {
@@ -352,7 +351,6 @@ class ChannelFilter final {
struct FilterRecord {
grpc_channel_stack_type stack_type;
int priority;
- bool prepend;
std::function<bool(const grpc_channel_args&)> include_filter;
grpc_channel_filter filter;
};
@@ -365,14 +363,12 @@ void ChannelFilterPluginShutdown();
/// Registers a new filter.
/// Must be called by only one thread at a time.
-/// The \a prepend argument decides whether to prepend or append the filter.
/// The \a include_filter argument specifies a function that will be called
/// to determine at run-time whether or not to add the filter. If the
/// value is nullptr, the filter will be added unconditionally.
template <typename ChannelDataType, typename CallDataType>
void RegisterChannelFilter(
const char* name, grpc_channel_stack_type stack_type, int priority,
- bool prepend,
std::function<bool(const grpc_channel_args&)> include_filter) {
// If we haven't been called before, initialize channel_filters and
// call grpc_register_plugin().
@@ -387,7 +383,6 @@ void RegisterChannelFilter(
internal::FilterRecord filter_record = {
stack_type,
priority,
- prepend,
include_filter,
{FilterType::StartTransportStreamOpBatch, FilterType::StartTransportOp,
FilterType::call_data_size, FilterType::InitCallElement,
diff --git a/src/cpp/common/resource_quota_cc.cc b/src/cpp/common/resource_quota_cc.cc
index daeb0ba171..276e5f7954 100644
--- a/src/cpp/common/resource_quota_cc.cc
+++ b/src/cpp/common/resource_quota_cc.cc
@@ -33,4 +33,8 @@ ResourceQuota& ResourceQuota::Resize(size_t new_size) {
return *this;
}
+ResourceQuota& ResourceQuota::SetMaxThreads(int new_max_threads) {
+ grpc_resource_quota_set_max_threads(impl_, new_max_threads);
+ return *this;
+}
} // namespace grpc
diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc
index b8fca9a6ee..cc797f1546 100644
--- a/src/cpp/common/version_cc.cc
+++ b/src/cpp/common/version_cc.cc
@@ -22,5 +22,5 @@
#include <grpcpp/grpcpp.h>
namespace grpc {
-grpc::string Version() { return "1.15.0-dev"; }
+grpc::string Version() { return "1.16.0-dev"; }
} // namespace grpc