Commit 97ab9440 authored by TousakaRin's avatar TousakaRin

Fix errors caused by conflicts in rebase, fix code style

parent b7509aea
......@@ -143,5 +143,4 @@ inline void MethodStatus::OnResponded(int error_code, int64_t latency) {
} // namespace brpc
#endif //BRPC_METHOD_STATUS_H
......@@ -84,7 +84,6 @@
extern "C" {
// defined in gperftools/malloc_extension_c.h
void BAIDU_WEAK MallocExtension_ReleaseFreeMemory(void);
void BAIDU_WEAK RegisterThriftProtocol();
}
namespace brpc {
......@@ -475,10 +474,17 @@ static void GlobalInitializeOrDieImpl() {
exit(1);
}
// Register Thrift framed protocol if linked
if (RegisterThriftProtocol) {
RegisterThriftProtocol();
}
// Use Macro is more straight forward than weak link technology(becasue of static link issue) + // Register Thrift framed protocol if linked
#ifdef ENABLE_THRIFT_FRAMED_PROTOCOL
Protocol thrift_binary_protocol = {
policy::ParseThriftMessage,
policy::SerializeThriftRequest, policy::PackThriftRequest,
policy::ProcessThriftRequest, policy::ProcessThriftResponse,
policy::VerifyThriftRequest, NULL, NULL,
CONNECTION_TYPE_POOLED_AND_SHORT, "thrift" };
if (RegisterProtocol(PROTOCOL_THRIFT, thrift_binary_protocol) != 0) {
exit(1);
}
#endif
// Only valid at client side
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment