diff options
author | 2017-09-01 15:04:13 -0700 | |
---|---|---|
committer | 2017-09-01 15:04:13 -0700 | |
commit | 2caf021772ee241da3366e7dfd32aa4ee1134092 (patch) | |
tree | 53807318821baaa38be9e0b3c7d7d2e7b193dd6a /src/node/ext/call_credentials.cc | |
parent | c928cfee2b94a99747f97ff8c5fb09277a1352b7 (diff) |
Change plugin credentials API to support both sync and async modes.
Diffstat (limited to 'src/node/ext/call_credentials.cc')
-rw-r--r-- | src/node/ext/call_credentials.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/node/ext/call_credentials.cc b/src/node/ext/call_credentials.cc index 4cf3e565ef..0644a812e9 100644 --- a/src/node/ext/call_credentials.cc +++ b/src/node/ext/call_credentials.cc @@ -238,9 +238,12 @@ NAUV_WORK_CB(SendPluginCallback) { } } -void plugin_get_metadata(void *state, grpc_auth_metadata_context context, - grpc_credentials_plugin_metadata_cb cb, - void *user_data) { +int plugin_get_metadata( + void *state, grpc_auth_metadata_context context, + 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) { plugin_state *p_state = reinterpret_cast<plugin_state *>(state); plugin_callback_data *data = new plugin_callback_data; data->service_url = context.service_url; @@ -252,6 +255,7 @@ void plugin_get_metadata(void *state, grpc_auth_metadata_context context, uv_mutex_unlock(&p_state->plugin_mutex); uv_async_send(&p_state->plugin_async); + return 0; // Async processing. } void plugin_uv_close_cb(uv_handle_t *handle) { |