Skip to content

Commit

Permalink
Merge pull request sogou#142 from holmes1412/master
Browse files Browse the repository at this point in the history
check caller empty
  • Loading branch information
Barenboim authored Dec 16, 2021
2 parents 55615c8 + fc43dbd commit 993e0a2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/generator/printer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,8 @@ inline void %sClient::%s(const %s *req, %sDone done)
{
auto *task = this->create_rpc_client_task("%s", std::move(done));
task->get_req()->set_caller_name(this->params.caller);
if (!this->params.caller.empty())
task->get_req()->set_caller_name(this->params.caller);
task->serialize_input(req);
task->start();
}
Expand All @@ -1425,7 +1426,8 @@ inline WFFuture<std::pair<%s, srpc::RPCSyncContext>> %sClient::async_%s(const %s
auto fr = pr->get_future();
auto *task = this->create_rpc_client_task<%s>("%s", srpc::RPCAsyncFutureCallback<%s>);
task->get_req()->set_caller_name(this->params.caller);
if (!this->params.caller.empty())
task->get_req()->set_caller_name(this->params.caller);
task->serialize_input(req);
task->user_data = pr;
task->start();
Expand Down Expand Up @@ -1521,7 +1523,10 @@ inline srpc::%sClientTask *%sClient::create_%s_task(%sDone done)
inline srpc::%sClientTask *%sClient::create_%s_task(%sDone done)
{
auto *task = this->create_rpc_client_task("%s", std::move(done));
task->get_req()->set_caller_name(this->params.caller);
if (!this->params.caller.empty())
task->get_req()->set_caller_name(this->params.caller);
return task;
}
)";
Expand Down

0 comments on commit 993e0a2

Please sign in to comment.