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