diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-02-04 11:52:41 -0800 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-02-04 11:52:41 -0800 |
commit | eff91095cf4936812b965e1bfdd671e052ff4328 (patch) | |
tree | 17ee0872b7af056964238609a354b2828d61e7a6 /src | |
parent | bf5b26103d10016b0731051f38a6d8c9cd9e10c0 (diff) | |
parent | 280744ec642241c840521b92452f7965c3f94274 (diff) |
Merge pull request #388 from vjpai/master
Add write buffer hint to C++ server handlers so that writes actually go out as expected
Diffstat (limited to 'src')
-rw-r--r-- | src/cpp/server/async_server_context.cc | 2 | ||||
-rw-r--r-- | src/cpp/server/server_rpc_handler.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/cpp/server/async_server_context.cc b/src/cpp/server/async_server_context.cc index 2dd3cd1e8e..886e794137 100644 --- a/src/cpp/server/async_server_context.cc +++ b/src/cpp/server/async_server_context.cc @@ -54,7 +54,7 @@ AsyncServerContext::~AsyncServerContext() { grpc_call_destroy(call_); } void AsyncServerContext::Accept(grpc_completion_queue *cq) { GPR_ASSERT(grpc_call_server_accept_old(call_, cq, this) == GRPC_CALL_OK); - GPR_ASSERT(grpc_call_server_end_initial_metadata_old(call_, 0) == + GPR_ASSERT(grpc_call_server_end_initial_metadata_old(call_, GRPC_WRITE_BUFFER_HINT) == GRPC_CALL_OK); } diff --git a/src/cpp/server/server_rpc_handler.cc b/src/cpp/server/server_rpc_handler.cc index 061ac1c2f3..bf02de8b80 100644 --- a/src/cpp/server/server_rpc_handler.cc +++ b/src/cpp/server/server_rpc_handler.cc @@ -77,7 +77,7 @@ void ServerRpcHandler::StartRpc() { if (status.IsOk()) { // Send the response if we get an ok status. - async_server_context_->StartWrite(*response, 0); + async_server_context_->StartWrite(*response, GRPC_WRITE_BUFFER_HINT); type = WaitForNextEvent(); if (type != CompletionQueue::SERVER_WRITE_OK) { status = Status(StatusCode::INTERNAL, "Error writing response."); |