THRIFT-2423 Facebook's THeader protocol and transport for cpp
Client: C++ Library, Compiler
Patch: Dave Watson rebased by Nobuaki Sukegawa
This closes #357 and closes #677
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index 2736ee8..47539dc 100644
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -23,6 +23,7 @@
#include <iostream>
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/protocol/TCompactProtocol.h>
+#include <thrift/protocol/THeaderProtocol.h>
#include <thrift/protocol/TJSONProtocol.h>
#include <thrift/transport/THttpClient.h>
#include <thrift/transport/TTransportUtils.h>
@@ -170,7 +171,7 @@
"Transport: buffered, framed, http, evhttp")(
"protocol",
boost::program_options::value<string>(&protocol_type)->default_value(protocol_type),
- "Protocol: binary, compact, json")("ssl", "Encrypted Transport using SSL")(
+ "Protocol: binary, header, compact, json")("ssl", "Encrypted Transport using SSL")(
"testloops,n",
boost::program_options::value<int>(&numTests)->default_value(numTests),
"Number of Tests")("noinsane", "Do not run insanity test");
@@ -188,6 +189,7 @@
if (!protocol_type.empty()) {
if (protocol_type == "binary") {
} else if (protocol_type == "compact") {
+ } else if (protocol_type == "header") {
} else if (protocol_type == "json") {
} else {
throw invalid_argument("Unknown protocol type " + protocol_type);
@@ -266,6 +268,9 @@
} else if (protocol_type.compare("compact") == 0) {
boost::shared_ptr<TProtocol> compactProtocol(new TCompactProtocol(transport));
protocol = compactProtocol;
+ } else if (protocol_type == "header") {
+ boost::shared_ptr<TProtocol> headerProtocol(new THeaderProtocol(transport));
+ protocol = headerProtocol;
} else {
boost::shared_ptr<TBinaryProtocol> binaryProtocol(new TBinaryProtocol(transport));
protocol = binaryProtocol;