diff options
author | 2017-09-29 07:26:50 -0700 | |
---|---|---|
committer | 2017-09-29 07:26:50 -0700 | |
commit | ede8ed215603add55479e70407c59b0a62130f89 (patch) | |
tree | 491608661eed1383f2205cef577b6140bf67efa7 /src/node/ext/call_credentials.cc | |
parent | 226e9060b9ea47a3295d9311f237b9aecae996a3 (diff) | |
parent | 6456e494a8474f4d62594e98382678703dee9594 (diff) |
Merge pull request #12374 from markdroth/plugin_credentials_api_fix
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) { |