From cdc99ae7f379b3908600a54ecff568591a66758a Mon Sep 17 00:00:00 2001 From: Pure White Date: Wed, 23 Aug 2023 00:35:41 +0800 Subject: [PATCH] fix(volo-thrift): server rpcinfo.caller may be None --- Cargo.lock | 2 +- volo-thrift/Cargo.toml | 2 +- volo-thrift/src/transport/pingpong/server.rs | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2235fd2f..208a4f51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2629,7 +2629,7 @@ version = "0.3.0" [[package]] name = "volo-thrift" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "async-trait", diff --git a/volo-thrift/Cargo.toml b/volo-thrift/Cargo.toml index a82262c6..f993817f 100644 --- a/volo-thrift/Cargo.toml +++ b/volo-thrift/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "volo-thrift" -version = "0.7.0" +version = "0.7.1" edition.workspace = true homepage.workspace = true repository.workspace = true diff --git a/volo-thrift/src/transport/pingpong/server.rs b/volo-thrift/src/transport/pingpong/server.rs index a82ede3c..c21cbb1d 100644 --- a/volo-thrift/src/transport/pingpong/server.rs +++ b/volo-thrift/src/transport/pingpong/server.rs @@ -54,6 +54,8 @@ pub async fn serve( caller.set_address(peer_addr.clone()); cx.rpc_info.caller = Some(caller); } + } else if cx.rpc_info.caller().is_none() { + cx.rpc_info.caller = Some(Endpoint::new("-".into())); } let msg = tokio::select! {