Merge pull request #15713 from hcaseyal/cleanup_filters

Use GRPC_CLOSURE_RUN instead of directly invoking callbacks in filters
pull/15725/head
hcaseyal 7 years ago committed by GitHub
commit a70053690a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/core/ext/filters/deadline/deadline_filter.cc
  2. 4
      src/core/ext/filters/load_reporting/server_load_reporting_filter.cc

@ -289,11 +289,10 @@ static void client_start_transport_stream_op_batch(
static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
server_call_data* calld = static_cast<server_call_data*>(elem->call_data);
// Get deadline from metadata and start the timer if needed.
start_timer_if_needed(elem, calld->recv_initial_metadata->deadline);
// Invoke the next callback.
calld->next_recv_initial_metadata_ready->cb(
calld->next_recv_initial_metadata_ready->cb_arg, error);
GRPC_CLOSURE_RUN(calld->next_recv_initial_metadata_ready,
GRPC_ERROR_REF(error));
}
// Method for starting a call op for server filter.

@ -82,9 +82,7 @@ static void on_initial_md_ready(void* user_data, grpc_error* err) {
} else {
GRPC_ERROR_REF(err);
}
calld->ops_recv_initial_metadata_ready->cb(
calld->ops_recv_initial_metadata_ready->cb_arg, err);
GRPC_ERROR_UNREF(err);
GRPC_CLOSURE_RUN(calld->ops_recv_initial_metadata_ready, err);
}
/* Constructor for call_data */

Loading…
Cancel
Save