Fix stack corruption

reviewable/pr8842/r2
Craig Tiller 8 years ago
parent cadabdf1f3
commit 78bc54e7d9
  1. 5
      include/grpc++/impl/codegen/call.h
  2. 1
      include/grpc++/impl/codegen/server_interface.h
  3. 3
      src/cpp/server/server_cc.cc

@ -438,9 +438,9 @@ class CallOpServerSendStatus {
trailing_metadata_count_;
op->data.send_status_from_server.trailing_metadata = trailing_metadata_;
op->data.send_status_from_server.status = send_status_code_;
grpc_slice status_details = SliceReferencingString(send_status_details_);
status_details_slice_ = SliceReferencingString(send_status_details_);
op->data.send_status_from_server.status_details =
send_status_details_.empty() ? nullptr : &status_details;
send_status_details_.empty() ? nullptr : &status_details_slice_;
op->flags = 0;
op->reserved = NULL;
}
@ -457,6 +457,7 @@ class CallOpServerSendStatus {
grpc::string send_status_details_;
size_t trailing_metadata_count_;
grpc_metadata* trailing_metadata_;
grpc_slice status_details_slice_;
};
class CallOpRecvInitialMetadata {

@ -152,7 +152,6 @@ class ServerInterface : public CallHook {
void* const tag_;
const bool delete_on_finalize_;
grpc_call* call_;
grpc_metadata_array initial_metadata_array_;
};
class RegisteredAsyncRequest : public BaseAsyncRequest {

@ -576,7 +576,6 @@ ServerInterface::BaseAsyncRequest::BaseAsyncRequest(
delete_on_finalize_(delete_on_finalize),
call_(nullptr) {
call_cq_->RegisterAvalanching(); // This op will trigger more ops
memset(&initial_metadata_array_, 0, sizeof(initial_metadata_array_));
}
ServerInterface::BaseAsyncRequest::~BaseAsyncRequest() {
@ -627,7 +626,7 @@ ServerInterface::GenericAsyncRequest::GenericAsyncRequest(
GPR_ASSERT(notification_cq);
GPR_ASSERT(call_cq);
grpc_server_request_call(server->server(), &call_, &call_details_,
&initial_metadata_array_, call_cq->cq(),
context->client_metadata_.arr(), call_cq->cq(),
notification_cq->cq(), this);
}

Loading…
Cancel
Save