diff options
author | David Garcia Quintas <dgq@google.com> | 2015-08-13 15:26:00 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2015-08-13 15:26:00 -0700 |
commit | 864d18650e007d9080257d685fc09bfbbf3a306e (patch) | |
tree | dcc964c58d8f37e4528de53e83aebfded499591f | |
parent | 80dc66d8aba7d04a3b0cab2054c3227dbd3e7c9a (diff) |
proto3 required changes
-rw-r--r-- | test/cpp/interop/interop_client.cc | 3 | ||||
-rw-r--r-- | test/cpp/interop/server.cc | 28 |
2 files changed, 13 insertions, 18 deletions
diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index cb6a607167..27bb1d4725 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -104,9 +104,6 @@ void InteropClient::PerformLargeUnary(SimpleRequest* request, InteropClientContextInspector inspector(context); // If the request doesn't already specify the response type, default to // COMPRESSABLE. - if (!request->has_response_type()) { - request->set_response_type(PayloadType::COMPRESSABLE); - } request->set_response_size(kLargeResponseSize); grpc::string payload(kLargeRequestSize, '\0'); request->mutable_payload()->set_body(payload.c_str(), kLargeRequestSize); diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc index 319e394399..760bb18f73 100644 --- a/test/cpp/interop/server.cc +++ b/test/cpp/interop/server.cc @@ -115,20 +115,18 @@ bool SetPayload(PayloadType type, int size, Payload* payload) { template <typename RequestType> void SetResponseCompression(ServerContext* context, const RequestType& request) { - if (request.has_response_compression()) { - switch (request.response_compression()) { - case grpc::testing::NONE: - context->set_compression_algorithm(GRPC_COMPRESS_NONE); - break; - case grpc::testing::GZIP: - context->set_compression_algorithm(GRPC_COMPRESS_GZIP); - break; - case grpc::testing::DEFLATE: - context->set_compression_algorithm(GRPC_COMPRESS_DEFLATE); - break; - } - } else { - context->set_compression_algorithm(GRPC_COMPRESS_NONE); + switch (request.response_compression()) { + case grpc::testing::NONE: + context->set_compression_algorithm(GRPC_COMPRESS_NONE); + break; + case grpc::testing::GZIP: + context->set_compression_algorithm(GRPC_COMPRESS_GZIP); + break; + case grpc::testing::DEFLATE: + context->set_compression_algorithm(GRPC_COMPRESS_DEFLATE); + break; + default: + abort(); } } @@ -142,7 +140,7 @@ class TestServiceImpl : public TestService::Service { Status UnaryCall(ServerContext* context, const SimpleRequest* request, SimpleResponse* response) { SetResponseCompression(context, *request); - if (request->has_response_size() && request->response_size() > 0) { + if (request->response_size() > 0) { if (!SetPayload(request->response_type(), request->response_size(), response->mutable_payload())) { return Status(grpc::StatusCode::INTERNAL, "Error creating payload."); |