in api/src/gmsa_service.cpp [1596:1644]
void Proceed()
{
if ( cookie.compare( CLASS_NAME_CallDataAddNonDomainJoinedKerberosLease ) != 0 )
{
return;
}
std::cerr << Util::getCurrentTime() << '\t' << "INFO: AddNonDomainJoinedKerberosLease "
<< this << "status: " << status_ << std::endl;
if ( status_ == CREATE )
{
// Make this instance progress to the PROCESS state.
status_ = PROCESS;
// As part of the initial CREATE state, we *request* that the system
// start processing RequestHandleNonDomainJoinedKerberosLease requests. In this
// request, "this" acts are the tag uniquely identifying the request (so that
// different CallData instances can serve different requests concurrently), in this
// case the memory address of this CallData instance.
service_->RequestAddNonDomainJoinedKerberosLease(
&add_krb_ctx_, &create_domainless_krb_request_, &handle_krb_responder_, cq_,
cq_, this );
}
else if ( status_ == PROCESS )
{
// Spawn a new CallData instance to serve new clients while we process
// the one for this CallData. The instance will deallocate itself as
// part of its FINISH state.
new CallDataAddNonDomainJoinedKerberosLease( service_, cq_ );
// The actual processing.
create_domainless_krb_reply_.set_lease_id( "12345" );
// And we are done! Let the gRPC runtime know we've finished, using the
// memory address of this instance as the uniquely identifying tag for
// the event.
status_ = FINISH;
handle_krb_responder_.Finish( create_domainless_krb_reply_, grpc::Status::OK,
this );
}
else
{
GPR_ASSERT( status_ == FINISH );
// Once in the FINISH state, deallocate ourselves (CallData).
delete this;
}
return;
}