Unverified Commit 3ded5044 authored by Ge Jun's avatar Ge Jun Committed by GitHub

Merge pull request #342 from kenshinxf/kenshinxf

Fix the issue that RegisterThriftProtocol is not in the right namespace
parents b7e0c536 94712e83
......@@ -57,11 +57,6 @@ int main(int argc, char* argv[]) {
// Send a request and wait for the response every 1 second.
int log_id = 0;
std::string query_string = "hello";
for(auto i = 0; i < 1000000; i++) {
query_string += " test";
}
while (!brpc::IsAskedToQuit()) {
brpc::Controller cntl;
cntl.set_log_id(log_id ++); // set by user
......
......@@ -631,19 +631,21 @@ void PackThriftRequest(
}
} // namespace policy
} // namespace brpc
extern "C" {
void 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) {
brpc::Protocol thrift_binary_protocol = {brpc::policy::ParseThriftMessage,
brpc::policy::SerializeThriftRequest, brpc::policy::PackThriftRequest,
brpc::policy::ProcessThriftRequest, brpc::policy::ProcessThriftResponse,
brpc::policy::VerifyThriftRequest, NULL, NULL,
brpc::CONNECTION_TYPE_POOLED_AND_SHORT, "thrift" };
if (brpc::RegisterProtocol(brpc::PROTOCOL_THRIFT, thrift_binary_protocol) != 0) {
exit(1);
}
}
} // namespace brpc
}
#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