Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/brpc/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions src/brpc/versioned_ref_with_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>(); \
} \
}
Expand Down Expand Up @@ -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().
Expand Down Expand Up @@ -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;
}

Expand Down