Skip to content

Commit

Permalink
[server] Fix typo in the class name
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneo committed Dec 5, 2023
1 parent 7047cc1 commit d9f58bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions src/cpp/server/secure_server_credentials.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,32 @@

namespace grpc {

void AuthMetadataProcessorAyncWrapper::Destroy(void* wrapper) {
auto* w = static_cast<AuthMetadataProcessorAyncWrapper*>(wrapper);
void AuthMetadataProcessorAsyncWrapper::Destroy(void* wrapper) {
auto* w = static_cast<AuthMetadataProcessorAsyncWrapper*>(wrapper);
delete w;
}

void AuthMetadataProcessorAyncWrapper::Process(
void AuthMetadataProcessorAsyncWrapper::Process(
void* wrapper, grpc_auth_context* context, const grpc_metadata* md,
size_t num_md, grpc_process_auth_metadata_done_cb cb, void* user_data) {
auto* w = static_cast<AuthMetadataProcessorAyncWrapper*>(wrapper);
auto* w = static_cast<AuthMetadataProcessorAsyncWrapper*>(wrapper);
if (!w->processor_) {
// Early exit.
cb(user_data, nullptr, 0, nullptr, 0, GRPC_STATUS_OK, nullptr);
return;
}
if (w->processor_->IsBlocking()) {
w->thread_pool_->Add([w, context, md, num_md, cb, user_data] {
w->AuthMetadataProcessorAyncWrapper::InvokeProcessor(context, md, num_md,
cb, user_data);
w->AuthMetadataProcessorAsyncWrapper::InvokeProcessor(context, md, num_md,
cb, user_data);
});
} else {
// invoke directly.
w->InvokeProcessor(context, md, num_md, cb, user_data);
}
}

void AuthMetadataProcessorAyncWrapper::InvokeProcessor(
void AuthMetadataProcessorAsyncWrapper::InvokeProcessor(
grpc_auth_context* context, const grpc_metadata* md, size_t num_md,
grpc_process_auth_metadata_done_cb cb, void* user_data) {
AuthMetadataProcessor::InputMetadata metadata;
Expand Down Expand Up @@ -104,10 +104,10 @@ int SecureServerCredentials::AddPortToServer(const std::string& addr,

void SecureServerCredentials::SetAuthMetadataProcessor(
const std::shared_ptr<grpc::AuthMetadataProcessor>& processor) {
auto* wrapper = new grpc::AuthMetadataProcessorAyncWrapper(processor);
auto* wrapper = new grpc::AuthMetadataProcessorAsyncWrapper(processor);
grpc_server_credentials_set_auth_metadata_processor(
creds_, {grpc::AuthMetadataProcessorAyncWrapper::Process,
grpc::AuthMetadataProcessorAyncWrapper::Destroy, wrapper});
creds_, {grpc::AuthMetadataProcessorAsyncWrapper::Process,
grpc::AuthMetadataProcessorAsyncWrapper::Destroy, wrapper});
}

std::shared_ptr<ServerCredentials> SslServerCredentials(
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/server/secure_server_credentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ namespace grpc {

class SecureServerCredentials;

class AuthMetadataProcessorAyncWrapper final {
class AuthMetadataProcessorAsyncWrapper final {
public:
static void Destroy(void* wrapper);

static void Process(void* wrapper, grpc_auth_context* context,
const grpc_metadata* md, size_t num_md,
grpc_process_auth_metadata_done_cb cb, void* user_data);

explicit AuthMetadataProcessorAyncWrapper(
explicit AuthMetadataProcessorAsyncWrapper(
const std::shared_ptr<AuthMetadataProcessor>& processor)
: processor_(processor) {
if (processor && processor->IsBlocking()) {
Expand Down Expand Up @@ -78,7 +78,7 @@ class SecureServerCredentials final : public ServerCredentials {
SecureServerCredentials* AsSecureServerCredentials() override { return this; }

grpc_server_credentials* creds_;
std::unique_ptr<grpc::AuthMetadataProcessorAyncWrapper> processor_;
std::unique_ptr<grpc::AuthMetadataProcessorAsyncWrapper> processor_;
};

} // namespace grpc
Expand Down

0 comments on commit d9f58bc

Please sign in to comment.