Commit c00718bf authored by wangxuefeng's avatar wangxuefeng

Fix register thrift protocol issue

parent eea2303d
...@@ -73,7 +73,7 @@ int main(int argc, char* argv[]) { ...@@ -73,7 +73,7 @@ int main(int argc, char* argv[]) {
req.raw().data = "hello"; req.raw().data = "hello";
cntl.set_thrift_method_name("Echo"); //cntl.set_thrift_method_name("Echo");
channel.CallMethod(NULL, &cntl, &req, &res, NULL); channel.CallMethod(NULL, &cntl, &req, &res, NULL);
......
...@@ -632,6 +632,8 @@ void PackThriftRequest( ...@@ -632,6 +632,8 @@ void PackThriftRequest(
} // namespace policy } // namespace policy
extern "C" {
void RegisterThriftProtocol() { void RegisterThriftProtocol() {
Protocol thrift_binary_protocol = {policy::ParseThriftMessage, Protocol thrift_binary_protocol = {policy::ParseThriftMessage,
...@@ -639,11 +641,11 @@ void RegisterThriftProtocol() { ...@@ -639,11 +641,11 @@ void RegisterThriftProtocol() {
policy::ProcessThriftRequest, policy::ProcessThriftResponse, policy::ProcessThriftRequest, policy::ProcessThriftResponse,
policy::VerifyThriftRequest, NULL, NULL, policy::VerifyThriftRequest, NULL, NULL,
CONNECTION_TYPE_POOLED_AND_SHORT, "thrift" }; CONNECTION_TYPE_POOLED_AND_SHORT, "thrift" };
if (RegisterProtocol(PROTOCOL_THRIFT, thrift_binary_protocol) != 0) { if (brpc::RegisterProtocol(PROTOCOL_THRIFT, thrift_binary_protocol) != 0) {
exit(1); exit(1);
} }
} }
}
} // namespace brpc } // namespace brpc
#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