This is an automated email from the ASF dual-hosted git repository.
wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git
The following commit(s) were added to refs/heads/master by this push:
new 4005a08b Fix description of VersionedRefWithId (#2895)
4005a08b is described below
commit 4005a08b07129bcf3a43641c23e4f2b85a05e7ec
Author: Bright Chen <[email protected]>
AuthorDate: Wed Feb 19 10:49:12 2025 +0800
Fix description of VersionedRefWithId (#2895)
---
src/brpc/socket.cpp | 4 ++--
src/brpc/versioned_ref_with_id.h | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/brpc/socket.cpp b/src/brpc/socket.cpp
index ac4c6892..056a9fca 100644
--- a/src/brpc/socket.cpp
+++ b/src/brpc/socket.cpp
@@ -960,9 +960,9 @@ std::string Socket::OnDescription() const {
result.reserve(64);
const int saved_fd = fd();
if (saved_fd >= 0) {
- butil::string_appendf(&result, "fd=%d", saved_fd);
+ butil::string_appendf(&result, "fd=%d ", saved_fd);
}
- butil::string_appendf(&result, " addr=%s",
+ butil::string_appendf(&result, "addr=%s",
butil::endpoint2str(remote_side()).c_str());
const int local_port = local_side().port;
if (local_port > 0) {
diff --git a/src/brpc/versioned_ref_with_id.h b/src/brpc/versioned_ref_with_id.h
index e7c3ef8d..20e0106d 100644
--- a/src/brpc/versioned_ref_with_id.h
+++ b/src/brpc/versioned_ref_with_id.h
@@ -102,17 +102,17 @@ typename std::enable_if<butil::is_void<Ret>::value,
Ret>::type ReturnEmpty() {}
template<typename... Args>
\
typename std::enable_if<decltype(
\
Test<class_type, Args...>(0))::value, return_type>::type
\
- Call(class_type* obj, Args&&... args) {
\
+ Call(class_type* obj, Args&&... args) {
\
BAIDU_CASSERT((butil::is_result_same<
\
return_type, decltype(&T::func_name), T,
Args...>::value), \
- "Params or return type mismatch");
\
+ "Params or return type mismatch");
\
return obj->func_name(std::forward<Args>(args)...);
\
}
\
\
template<typename... Args>
\
typename std::enable_if<!decltype(
\
Test<class_type, Args...>(0))::value, return_type>::type
\
- Call(class_type* obj, Args&&... args) {
\
+ Call(class_type* obj, Args&&...) {
\
return ReturnEmpty<return_type>();
\
}
\
}
@@ -356,7 +356,7 @@ int VersionedRefWithId<T>::Create(VRefId* id, Args&&...
args) {
T* const t = butil::get_resource(&slot, Forbidden());
if (t == NULL) {
LOG(FATAL) << "Fail to get_resource<"
- << butil::class_name_str<T>() << ">";
+ << butil::class_name<T>() << ">";
return -1;
}
// nref can be non-zero due to concurrent Address().
@@ -617,10 +617,10 @@ template<typename T>
std::string VersionedRefWithId<T>::description() const {
std::string result;
result.reserve(128);
- butil::string_appendf(&result, "Socket{id=%" PRIu64, id());
+ butil::string_appendf(&result, "%s{id=%" PRIu64 " ",
butil::class_name<T>(), id());
result.append(WRAPPER_CALL(
OnDescription, const_cast<T*>(static_cast<const T*>(this))));
- butil::string_appendf(&result, "} (0x%p)", this);
+ butil::string_appendf(&result, "} (%p)", this);
return result;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]