diff options
author | Mark D. Roth <roth@google.com> | 2017-09-01 15:04:13 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2017-09-01 15:04:13 -0700 |
commit | 2caf021772ee241da3366e7dfd32aa4ee1134092 (patch) | |
tree | 53807318821baaa38be9e0b3c7d7d2e7b193dd6a /src/ruby | |
parent | c928cfee2b94a99747f97ff8c5fb09277a1352b7 (diff) |
Change plugin credentials API to support both sync and async modes.
Diffstat (limited to 'src/ruby')
-rw-r--r-- | src/ruby/ext/grpc/rb_call_credentials.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ruby/ext/grpc/rb_call_credentials.c b/src/ruby/ext/grpc/rb_call_credentials.c index 049a869bdc..4214a0811b 100644 --- a/src/ruby/ext/grpc/rb_call_credentials.c +++ b/src/ruby/ext/grpc/rb_call_credentials.c @@ -112,9 +112,12 @@ static void grpc_rb_call_credentials_callback_with_gil(void *param) { gpr_free(params); } -static void grpc_rb_call_credentials_plugin_get_metadata( +static int grpc_rb_call_credentials_plugin_get_metadata( void *state, grpc_auth_metadata_context context, - grpc_credentials_plugin_metadata_cb cb, void *user_data) { + grpc_credentials_plugin_metadata_cb cb, void *user_data, + grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX], + size_t *num_creds_md, grpc_status_code *status, + const char **error_details) { callback_params *params = gpr_malloc(sizeof(callback_params)); params->get_metadata = (VALUE)state; params->context = context; @@ -123,6 +126,7 @@ static void grpc_rb_call_credentials_plugin_get_metadata( grpc_rb_event_queue_enqueue(grpc_rb_call_credentials_callback_with_gil, (void *)(params)); + return 0; // Async return. } static void grpc_rb_call_credentials_plugin_destroy(void *state) { |