Commit f16cb5f8 authored by gejun's avatar gejun

Set http_body_compress_threshold to 0 on gzip & not set content-type

parent f0d7e5cf
......@@ -32,6 +32,9 @@ DEFINE_bool(gzip, false, "compress body using gzip");
int main(int argc, char* argv[]) {
// Parse gflags. We recommend you to use gflags as well.
GFLAGS_NS::ParseCommandLineFlags(&argc, &argv, true);
if (FLAGS_gzip) {
GFLAGS_NS::SetCommandLineOption("http_body_compress_threshold", 0);
}
// A Channel represents a communication line to a Server. Notice that
// Channel is thread-safe and can be shared by all threads in your program.
......@@ -60,7 +63,6 @@ int main(int argc, char* argv[]) {
brpc::Controller cntl;
request.set_name("grpc_req_from_brpc");
cntl.http_request().set_content_type("application/grpc");
if (FLAGS_gzip) {
cntl.set_request_compress_type(brpc::COMPRESS_TYPE_GZIP);
}
......
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