From 026e600b5bb61743cf6ac86623b622520ae2d353 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 22 Jun 2015 11:41:14 -0700 Subject: [PATCH] Update to set flags=0 on all ops --- include/grpc++/impl/call.h | 11 ++++++++++- src/cpp/server/server_context.cc | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/grpc++/impl/call.h b/include/grpc++/impl/call.h index 2584caec713..33e66816f53 100644 --- a/include/grpc++/impl/call.h +++ b/include/grpc++/impl/call.h @@ -84,6 +84,7 @@ class CallOpSendInitialMetadata { if (!send_) return; grpc_op* op = &ops[(*nops)++]; op->op = GRPC_OP_SEND_INITIAL_METADATA; + op->flags = 0; op->data.send_initial_metadata.count = initial_metadata_count_; op->data.send_initial_metadata.metadata = initial_metadata_; } @@ -110,6 +111,7 @@ class CallOpSendMessage { if (send_buf_ == nullptr) return; grpc_op* op = &ops[(*nops)++]; op->op = GRPC_OP_SEND_MESSAGE; + op->flags = 0; op->data.send_message = send_buf_; } void FinishOp(bool* status, int max_message_size) { @@ -141,6 +143,7 @@ class CallOpRecvMessage { if (message_ == nullptr) return; grpc_op* op = &ops[(*nops)++]; op->op = GRPC_OP_RECV_MESSAGE; + op->flags = 0; op->data.recv_message = &recv_buf_; } @@ -188,6 +191,7 @@ class CallOpGenericRecvMessage { if (!deserialize_) return; grpc_op* op = &ops[(*nops)++]; op->op = GRPC_OP_RECV_MESSAGE; + op->flags = 0; op->data.recv_message = &recv_buf_; } @@ -223,7 +227,9 @@ class CallOpClientSendClose { protected: void AddOp(grpc_op* ops, size_t* nops) { if (!send_) return; - ops[(*nops)++].op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; + grpc_op* op = &ops[(*nops)++]; + op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; + op->flags = 0; } void FinishOp(bool* status, int max_message_size) { send_ = false; } @@ -256,6 +262,7 @@ class CallOpServerSendStatus { op->data.send_status_from_server.status = send_status_code_; op->data.send_status_from_server.status_details = send_status_details_.empty() ? nullptr : send_status_details_.c_str(); + op->flags = 0; } void FinishOp(bool* status, int max_message_size) { @@ -288,6 +295,7 @@ class CallOpRecvInitialMetadata { grpc_op* op = &ops[(*nops)++]; op->op = GRPC_OP_RECV_INITIAL_METADATA; op->data.recv_initial_metadata = &recv_initial_metadata_arr_; + op->flags = 0; } void FinishOp(bool* status, int max_message_size) { if (recv_initial_metadata_ == nullptr) return; @@ -324,6 +332,7 @@ class CallOpClientRecvStatus { op->data.recv_status_on_client.status_details = &status_details_; op->data.recv_status_on_client.status_details_capacity = &status_details_capacity_; + op->flags = 0; } void FinishOp(bool* status, int max_message_size) { diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index eea9645e37d..699895a3cfc 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -79,6 +79,7 @@ bool ServerContext::CompletionOp::CheckCancelled(CompletionQueue* cq) { void ServerContext::CompletionOp::FillOps(grpc_op* ops, size_t* nops) { ops->op = GRPC_OP_RECV_CLOSE_ON_SERVER; ops->data.recv_close_on_server.cancelled = &cancelled_; + ops->flags = 0; *nops = 1; }