aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/stream
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-01-13 16:11:30 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-01-13 16:11:30 -0800
commit375605b65f9d58b7544b4af8bc93d4cf8489f010 (patch)
treebc0e1a8861a3dfdb6e8b0bb43a219d31efb88064 /src/cpp/stream
parent80fa15c15121a7d0ec020dec8bfa3697a96058b6 (diff)
parent49a06a6cb843b8ce592312c28b43c9dc527b99ee (diff)
Merge github.com:google/grpc into api
Diffstat (limited to 'src/cpp/stream')
-rw-r--r--src/cpp/stream/stream_context.cc9
-rw-r--r--src/cpp/stream/stream_context.h13
2 files changed, 14 insertions, 8 deletions
diff --git a/src/cpp/stream/stream_context.cc b/src/cpp/stream/stream_context.cc
index 22b7e7d494..7936a30dfd 100644
--- a/src/cpp/stream/stream_context.cc
+++ b/src/cpp/stream/stream_context.cc
@@ -34,11 +34,11 @@
#include "src/cpp/stream/stream_context.h"
#include <grpc/support/log.h>
-#include "src/cpp/rpc_method.h"
#include "src/cpp/proto/proto_utils.h"
#include "src/cpp/util/time.h"
#include <grpc++/client_context.h>
#include <grpc++/config.h>
+#include <grpc++/impl/rpc_method.h>
#include <google/protobuf/message.h>
namespace grpc {
@@ -61,7 +61,8 @@ StreamContext::StreamContext(const RpcMethod& method, ClientContext* context,
// Server only ctor
StreamContext::StreamContext(const RpcMethod& method, grpc_call* call,
grpc_completion_queue* cq,
- google::protobuf::Message* request, google::protobuf::Message* result)
+ google::protobuf::Message* request,
+ google::protobuf::Message* result)
: is_client_(false),
method_(&method),
call_(call),
@@ -85,6 +86,10 @@ void StreamContext::Start(bool buffered) {
GPR_ASSERT(GRPC_CALL_OK == error);
grpc_event* invoke_ev =
grpc_completion_queue_pluck(cq(), invoke_tag(), gpr_inf_future);
+ if (invoke_ev->data.invoke_accepted != GRPC_OP_OK) {
+ peer_halfclosed_ = true;
+ self_halfclosed_ = true;
+ }
grpc_event_finish(invoke_ev);
} else {
// TODO(yangg) metadata needs to be added before accept
diff --git a/src/cpp/stream/stream_context.h b/src/cpp/stream/stream_context.h
index 6c31095042..f70fe6daa3 100644
--- a/src/cpp/stream/stream_context.h
+++ b/src/cpp/stream/stream_context.h
@@ -51,7 +51,8 @@ class RpcMethod;
class StreamContext : public StreamContextInterface {
public:
StreamContext(const RpcMethod& method, ClientContext* context,
- const google::protobuf::Message* request, google::protobuf::Message* result);
+ const google::protobuf::Message* request,
+ google::protobuf::Message* result);
StreamContext(const RpcMethod& method, grpc_call* call,
grpc_completion_queue* cq, google::protobuf::Message* request,
google::protobuf::Message* result);
@@ -81,11 +82,11 @@ class StreamContext : public StreamContextInterface {
grpc_completion_queue* cq() { return cq_; }
bool is_client_;
- const RpcMethod* method_; // not owned
- grpc_call* call_; // not owned
- grpc_completion_queue* cq_; // not owned
- google::protobuf::Message* request_; // first request, not owned
- google::protobuf::Message* result_; // last response, not owned
+ const RpcMethod* method_; // not owned
+ grpc_call* call_; // not owned
+ grpc_completion_queue* cq_; // not owned
+ google::protobuf::Message* request_; // first request, not owned
+ google::protobuf::Message* result_; // last response, not owned
bool peer_halfclosed_;
bool self_halfclosed_;