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) { ...@@ -143,5 +143,4 @@ inline void MethodStatus::OnResponded(int error_code, int64_t latency) {
} // namespace brpc } // namespace brpc
#endif //BRPC_METHOD_STATUS_H #endif //BRPC_METHOD_STATUS_H
...@@ -84,7 +84,6 @@ ...@@ -84,7 +84,6 @@
extern "C" { extern "C" {
// defined in gperftools/malloc_extension_c.h // defined in gperftools/malloc_extension_c.h
void BAIDU_WEAK MallocExtension_ReleaseFreeMemory(void); void BAIDU_WEAK MallocExtension_ReleaseFreeMemory(void);
void BAIDU_WEAK RegisterThriftProtocol();
} }
namespace brpc { namespace brpc {
...@@ -475,9 +474,16 @@ static void GlobalInitializeOrDieImpl() { ...@@ -475,9 +474,16 @@ static void GlobalInitializeOrDieImpl() {
exit(1); exit(1);
} }
// Register Thrift framed protocol if linked // Use Macro is more straight forward than weak link technology(becasue of static link issue) + // Register Thrift framed protocol if linked
if (RegisterThriftProtocol) { #ifdef ENABLE_THRIFT_FRAMED_PROTOCOL
RegisterThriftProtocol(); 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 #endif
......
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