|
|
@ -39,7 +39,7 @@ |
|
|
|
#include "src/core/channel/channel_args.h" |
|
|
|
#include "src/core/channel/channel_args.h" |
|
|
|
#include "src/core/channel/http_client_filter.h" |
|
|
|
#include "src/core/channel/http_client_filter.h" |
|
|
|
#include "src/core/httpcli/httpcli.h" |
|
|
|
#include "src/core/httpcli/httpcli.h" |
|
|
|
#include "src/core/iomgr/iomgr.h" |
|
|
|
#include "src/core/iomgr/executor.h" |
|
|
|
#include "src/core/json/json.h" |
|
|
|
#include "src/core/json/json.h" |
|
|
|
#include "src/core/support/string.h" |
|
|
|
#include "src/core/support/string.h" |
|
|
|
#include "src/core/surface/api_trace.h" |
|
|
|
#include "src/core/surface/api_trace.h" |
|
|
@ -48,7 +48,6 @@ |
|
|
|
#include <grpc/support/log.h> |
|
|
|
#include <grpc/support/log.h> |
|
|
|
#include <grpc/support/string_util.h> |
|
|
|
#include <grpc/support/string_util.h> |
|
|
|
#include <grpc/support/sync.h> |
|
|
|
#include <grpc/support/sync.h> |
|
|
|
#include <grpc/support/thd.h> |
|
|
|
|
|
|
|
#include <grpc/support/time.h> |
|
|
|
#include <grpc/support/time.h> |
|
|
|
|
|
|
|
|
|
|
|
/* -- Common. -- */ |
|
|
|
/* -- Common. -- */ |
|
|
@ -792,15 +791,14 @@ static void md_only_test_destruct(grpc_call_credentials *creds) { |
|
|
|
grpc_credentials_md_store_unref(c->md_store); |
|
|
|
grpc_credentials_md_store_unref(c->md_store); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void on_simulated_token_fetch_done(void *user_data) { |
|
|
|
static void on_simulated_token_fetch_done(grpc_exec_ctx *exec_ctx, |
|
|
|
|
|
|
|
void *user_data, int success) { |
|
|
|
grpc_credentials_metadata_request *r = |
|
|
|
grpc_credentials_metadata_request *r = |
|
|
|
(grpc_credentials_metadata_request *)user_data; |
|
|
|
(grpc_credentials_metadata_request *)user_data; |
|
|
|
grpc_md_only_test_credentials *c = (grpc_md_only_test_credentials *)r->creds; |
|
|
|
grpc_md_only_test_credentials *c = (grpc_md_only_test_credentials *)r->creds; |
|
|
|
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; |
|
|
|
r->cb(exec_ctx, r->user_data, c->md_store->entries, c->md_store->num_entries, |
|
|
|
r->cb(&exec_ctx, r->user_data, c->md_store->entries, c->md_store->num_entries, |
|
|
|
|
|
|
|
GRPC_CREDENTIALS_OK); |
|
|
|
GRPC_CREDENTIALS_OK); |
|
|
|
grpc_credentials_metadata_request_destroy(r); |
|
|
|
grpc_credentials_metadata_request_destroy(r); |
|
|
|
grpc_exec_ctx_finish(&exec_ctx); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void md_only_test_get_request_metadata( |
|
|
|
static void md_only_test_get_request_metadata( |
|
|
@ -810,10 +808,10 @@ static void md_only_test_get_request_metadata( |
|
|
|
grpc_md_only_test_credentials *c = (grpc_md_only_test_credentials *)creds; |
|
|
|
grpc_md_only_test_credentials *c = (grpc_md_only_test_credentials *)creds; |
|
|
|
|
|
|
|
|
|
|
|
if (c->is_async) { |
|
|
|
if (c->is_async) { |
|
|
|
gpr_thd_id thd_id; |
|
|
|
|
|
|
|
grpc_credentials_metadata_request *cb_arg = |
|
|
|
grpc_credentials_metadata_request *cb_arg = |
|
|
|
grpc_credentials_metadata_request_create(creds, cb, user_data); |
|
|
|
grpc_credentials_metadata_request_create(creds, cb, user_data); |
|
|
|
gpr_thd_new(&thd_id, on_simulated_token_fetch_done, cb_arg, NULL); |
|
|
|
grpc_executor_enqueue( |
|
|
|
|
|
|
|
grpc_closure_create(on_simulated_token_fetch_done, cb_arg), 1); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
cb(exec_ctx, user_data, c->md_store->entries, 1, GRPC_CREDENTIALS_OK); |
|
|
|
cb(exec_ctx, user_data, c->md_store->entries, 1, GRPC_CREDENTIALS_OK); |
|
|
|
} |
|
|
|
} |
|
|
|