diff --git a/document/sphinx-cn/release_notes/v0_10_0.md b/document/sphinx-cn/release_notes/v0_10_0.md index 50bac3e54..ee28d5131 100644 --- a/document/sphinx-cn/release_notes/v0_10_0.md +++ b/document/sphinx-cn/release_notes/v0_10_0.md @@ -7,3 +7,4 @@ **次要修改**: +- 修复 grpc 插件与原生 grpc 通信时,服务地址设置不正确的问题 diff --git a/src/examples/utils/run_all_example.py b/src/examples/utils/run_all_example.py index ff106ef74..448c927b5 100644 --- a/src/examples/utils/run_all_example.py +++ b/src/examples/utils/run_all_example.py @@ -37,10 +37,12 @@ class ExampleRunner: with open(version_file, "r") as f: version = f.read().strip() - subprocess.run( - ["pip3", "install", f"./aimrt_py_pkg/dist/aimrt_py-{version}-cp310-cp310-linux_x86_64.whl", "--force-reinstall"], - cwd=default_build_path, - ) + subprocess.run(["pip3", + "install", + f"./aimrt_py_pkg/dist/aimrt_py-{version}-cp310-cp310-linux_x86_64.whl", + "--force-reinstall"], + cwd=default_build_path, + ) subprocess.run( ["bash", os.path.join("build_examples_py_pb_rpc.sh")], cwd=os.path.join(py_cwd, "pb_rpc"), diff --git a/src/plugins/grpc_plugin/grpc_rpc_backend.cc b/src/plugins/grpc_plugin/grpc_rpc_backend.cc index 961da6ee4..8cf39fb08 100644 --- a/src/plugins/grpc_plugin/grpc_rpc_backend.cc +++ b/src/plugins/grpc_plugin/grpc_rpc_backend.cc @@ -163,9 +163,9 @@ bool GrpcRpcBackend::RegisterServiceFunc( return false; } - // pb:/aimrt.protocols.example.ExampleService/GetBarData -> /rpc/aimrt.protocols.example.ExampleService/GetBarData - // ros2:/example_ros2/srv/RosTestRpc -> /rpc/example_ros2/srv/RosTestRpc - auto pattern = "/rpc" + std::string(GetRealFuncName(func_name)); + // pb:/aimrt.protocols.example.ExampleService/GetBarData -> /aimrt.protocols.example.ExampleService/GetBarData + // ros2:/example_ros2/srv/RosTestRpc -> /example_ros2/srv/RosTestRpc + auto pattern = std::string(GetRealFuncName(func_name)); plugins::grpc_plugin::server::HttpHandle http_handle = [this, &service_func_wrapper]( @@ -369,7 +369,7 @@ void GrpcRpcBackend::Invoke( return; } if (url->path.empty()) { - url->path = "/rpc" + std::string(GetRealFuncName(info.func_name)); + url->path = std::string(GetRealFuncName(info.func_name)); } AIMRT_TRACE("Http2 cli session send request, remote addr {}, path: {}", url->host, url->path);