aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/common/channel_filter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpp/common/channel_filter.cc')
-rw-r--r--src/cpp/common/channel_filter.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cpp/common/channel_filter.cc b/src/cpp/common/channel_filter.cc
index 422e7bb65e..0634b0416f 100644
--- a/src/cpp/common/channel_filter.cc
+++ b/src/cpp/common/channel_filter.cc
@@ -78,8 +78,13 @@ bool MaybeAddFilter(grpc_channel_stack_builder* builder, void* arg) {
grpc_channel_stack_builder_get_channel_arguments(builder);
if (!filter.include_filter(*args)) return true;
}
- return grpc_channel_stack_builder_prepend_filter(builder, &filter.filter,
- nullptr, nullptr);
+ 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);
+ }
}
} // namespace