aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/interop
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@google.com>2016-10-12 15:38:46 -0700
committerGravatar Noah Eisen <ncteisen@google.com>2016-10-12 15:38:46 -0700
commit40860c4488363bd534b3440d4d09b1a946750667 (patch)
tree6bba44951601df881b0698714283cfed78d0febd /test/cpp/interop
parentf8ffbf62a2a44f152c2d88b388fe67de62cc1051 (diff)
reverting a file for the last commit caused a function to be deleted from interop_client. This commit adds that function back in
Diffstat (limited to 'test/cpp/interop')
-rw-r--r--test/cpp/interop/interop_server.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc
index c05eb5d146..2e6a10b36b 100644
--- a/test/cpp/interop/interop_server.cc
+++ b/test/cpp/interop/interop_server.cc
@@ -47,6 +47,7 @@
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
+#include "src/core/lib/support/string.h"
#include "src/core/lib/transport/byte_stream.h"
#include "src/proto/grpc/testing/empty.grpc.pb.h"
#include "src/proto/grpc/testing/messages.grpc.pb.h"
@@ -153,6 +154,17 @@ class TestServiceImpl : public TestService::Service {
return Status::OK;
}
+ // Response contains current timestamp. We ignore everything in the request.
+ Status CacheableUnaryCall(ServerContext* context,
+ const SimpleRequest* request,
+ SimpleResponse* response) {
+ gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE);
+ std::string timestamp = std::to_string((long long unsigned)ts.tv_nsec);
+ response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size());
+ context->AddInitialMetadata("cache-control", "max-age=60, public");
+ return Status::OK;
+ }
+
Status UnaryCall(ServerContext* context, const SimpleRequest* request,
SimpleResponse* response) {
MaybeEchoMetadata(context);