diff options
89 files changed, 424 insertions, 389 deletions
diff --git a/doc/service_config.md b/doc/service_config.md index 7318b69f21..2dabb83a37 100644 --- a/doc/service_config.md +++ b/doc/service_config.md @@ -95,10 +95,7 @@ The service config is a JSON string of the following form: # will not be sent and the client will see an error. # Note that 0 is a valid value, meaning that the request message must # be empty. - # - # The format of the value is that of the 'uint64' type defined here: - # https://developers.google.com/protocol-buffers/docs/proto3#json - 'maxRequestMessageBytes': string, + 'maxRequestMessageBytes': number, # The maximum allowed payload size for an individual response or object # in a stream (server->client) in bytes. The size which is measured is @@ -114,10 +111,7 @@ The service config is a JSON string of the following form: # will not be sent, and the client will see an error. # Note that 0 is a valid value, meaning that the response message must # be empty. - # - # The format of the value is that of the 'uint64' type defined here: - # https://developers.google.com/protocol-buffers/docs/proto3#json - 'maxResponseMessageBytes': string + 'maxResponseMessageBytes': number } ] } diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index 6ab00612f6..6869c4de19 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -175,7 +175,7 @@ template <int I> class CallNoOp { protected: void AddOp(grpc_op* ops, size_t* nops) {} - void FinishOp(bool* status, int max_receive_message_size) {} + void FinishOp(bool* status) {} }; class CallOpSendInitialMetadata { @@ -213,7 +213,7 @@ class CallOpSendInitialMetadata { op->data.send_initial_metadata.maybe_compression_level.level = maybe_compression_level_.level; } - void FinishOp(bool* status, int max_receive_message_size) { + void FinishOp(bool* status) { if (!send_) return; g_core_codegen_interface->gpr_free(initial_metadata_); send_ = false; @@ -249,11 +249,11 @@ class CallOpSendMessage { op->op = GRPC_OP_SEND_MESSAGE; op->flags = write_options_.flags(); op->reserved = NULL; - op->data.send_message = send_buf_; + op->data.send_message.send_message = send_buf_; // Flags are per-message: clear them after use. write_options_.Clear(); } - void FinishOp(bool* status, int max_receive_message_size) { + void FinishOp(bool* status) { if (own_buf_) g_core_codegen_interface->grpc_byte_buffer_destroy(send_buf_); send_buf_ = nullptr; } @@ -298,17 +298,15 @@ class CallOpRecvMessage { op->op = GRPC_OP_RECV_MESSAGE; op->flags = 0; op->reserved = NULL; - op->data.recv_message = &recv_buf_; + op->data.recv_message.recv_message = &recv_buf_; } - void FinishOp(bool* status, int max_receive_message_size) { + void FinishOp(bool* status) { if (message_ == nullptr) return; if (recv_buf_) { if (*status) { got_message = *status = - SerializationTraits<R>::Deserialize(recv_buf_, message_, - max_receive_message_size) - .ok(); + SerializationTraits<R>::Deserialize(recv_buf_, message_).ok(); } else { got_message = false; g_core_codegen_interface->grpc_byte_buffer_destroy(recv_buf_); @@ -331,8 +329,7 @@ class CallOpRecvMessage { namespace CallOpGenericRecvMessageHelper { class DeserializeFunc { public: - virtual Status Deserialize(grpc_byte_buffer* buf, - int max_receive_message_size) = 0; + virtual Status Deserialize(grpc_byte_buffer* buf) = 0; virtual ~DeserializeFunc() {} }; @@ -340,10 +337,8 @@ template <class R> class DeserializeFuncType final : public DeserializeFunc { public: DeserializeFuncType(R* message) : message_(message) {} - Status Deserialize(grpc_byte_buffer* buf, - int max_receive_message_size) override { - return SerializationTraits<R>::Deserialize(buf, message_, - max_receive_message_size); + Status Deserialize(grpc_byte_buffer* buf) override { + return SerializationTraits<R>::Deserialize(buf, message_); } ~DeserializeFuncType() override {} @@ -379,16 +374,15 @@ class CallOpGenericRecvMessage { op->op = GRPC_OP_RECV_MESSAGE; op->flags = 0; op->reserved = NULL; - op->data.recv_message = &recv_buf_; + op->data.recv_message.recv_message = &recv_buf_; } - void FinishOp(bool* status, int max_receive_message_size) { + void FinishOp(bool* status) { if (!deserialize_) return; if (recv_buf_) { if (*status) { got_message = true; - *status = - deserialize_->Deserialize(recv_buf_, max_receive_message_size).ok(); + *status = deserialize_->Deserialize(recv_buf_).ok(); } else { got_message = false; g_core_codegen_interface->grpc_byte_buffer_destroy(recv_buf_); @@ -422,7 +416,7 @@ class CallOpClientSendClose { op->flags = 0; op->reserved = NULL; } - void FinishOp(bool* status, int max_receive_message_size) { send_ = false; } + void FinishOp(bool* status) { send_ = false; } private: bool send_; @@ -457,7 +451,7 @@ class CallOpServerSendStatus { op->reserved = NULL; } - void FinishOp(bool* status, int max_receive_message_size) { + void FinishOp(bool* status) { if (!send_status_available_) return; g_core_codegen_interface->gpr_free(trailing_metadata_); send_status_available_ = false; @@ -486,11 +480,12 @@ class CallOpRecvInitialMetadata { memset(&recv_initial_metadata_arr_, 0, sizeof(recv_initial_metadata_arr_)); grpc_op* op = &ops[(*nops)++]; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &recv_initial_metadata_arr_; + op->data.recv_initial_metadata.recv_initial_metadata = + &recv_initial_metadata_arr_; op->flags = 0; op->reserved = NULL; } - void FinishOp(bool* status, int max_receive_message_size) { + void FinishOp(bool* status) { if (recv_initial_metadata_ == nullptr) return; FillMetadataMap(&recv_initial_metadata_arr_, recv_initial_metadata_); recv_initial_metadata_ = nullptr; @@ -529,7 +524,7 @@ class CallOpClientRecvStatus { op->reserved = NULL; } - void FinishOp(bool* status, int max_receive_message_size) { + void FinishOp(bool* status) { if (recv_status_ == nullptr) return; FillMetadataMap(&recv_trailing_metadata_arr_, recv_trailing_metadata_); *recv_status_ = Status( @@ -566,22 +561,17 @@ class CallOpSetCollectionInterface /// API. class CallOpSetInterface : public CompletionQueueTag { public: - CallOpSetInterface() : max_receive_message_size_(0) {} + CallOpSetInterface() {} /// Fills in grpc_op, starting from ops[*nops] and moving /// upwards. virtual void FillOps(grpc_op* ops, size_t* nops) = 0; - void set_max_receive_message_size(int max_receive_message_size) { - max_receive_message_size_ = max_receive_message_size; - } - /// Mark this as belonging to a collection if needed void SetCollection(std::shared_ptr<CallOpSetCollectionInterface> collection) { collection_ = collection; } protected: - int max_receive_message_size_; std::shared_ptr<CallOpSetCollectionInterface> collection_; }; @@ -613,12 +603,12 @@ class CallOpSet : public CallOpSetInterface, } bool FinalizeResult(void** tag, bool* status) override { - this->Op1::FinishOp(status, max_receive_message_size_); - this->Op2::FinishOp(status, max_receive_message_size_); - this->Op3::FinishOp(status, max_receive_message_size_); - this->Op4::FinishOp(status, max_receive_message_size_); - this->Op5::FinishOp(status, max_receive_message_size_); - this->Op6::FinishOp(status, max_receive_message_size_); + this->Op1::FinishOp(status); + this->Op2::FinishOp(status); + this->Op3::FinishOp(status); + this->Op4::FinishOp(status); + this->Op5::FinishOp(status); + this->Op6::FinishOp(status); *tag = return_tag_; collection_.reset(); // drop the ref at this point return true; @@ -650,35 +640,19 @@ class Call final { public: /* call is owned by the caller */ Call(grpc_call* call, CallHook* call_hook, CompletionQueue* cq) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1) {} - - Call(grpc_call* call, CallHook* call_hook, CompletionQueue* cq, - int max_receive_message_size) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(max_receive_message_size) {} + : call_hook_(call_hook), cq_(cq), call_(call) {} void PerformOps(CallOpSetInterface* ops) { - if (max_receive_message_size_ > 0) { - ops->set_max_receive_message_size(max_receive_message_size_); - } call_hook_->PerformOpsOnCall(ops, this); } grpc_call* call() const { return call_; } CompletionQueue* cq() const { return cq_; } - int max_receive_message_size() { return max_receive_message_size_; } - private: CallHook* call_hook_; CompletionQueue* cq_; grpc_call* call_; - int max_receive_message_size_; }; } // namespace grpc diff --git a/include/grpc++/impl/codegen/method_handler_impl.h b/include/grpc++/impl/codegen/method_handler_impl.h index d5d27e15cd..83b569ce74 100644 --- a/include/grpc++/impl/codegen/method_handler_impl.h +++ b/include/grpc++/impl/codegen/method_handler_impl.h @@ -52,8 +52,8 @@ class RpcMethodHandler : public MethodHandler { void RunHandler(const HandlerParameter& param) final { RequestType req; - Status status = SerializationTraits<RequestType>::Deserialize( - param.request, &req, param.max_receive_message_size); + Status status = + SerializationTraits<RequestType>::Deserialize(param.request, &req); ResponseType rsp; if (status.ok()) { status = func_(service_, param.server_context, &req, &rsp); @@ -138,8 +138,8 @@ class ServerStreamingHandler : public MethodHandler { void RunHandler(const HandlerParameter& param) final { RequestType req; - Status status = SerializationTraits<RequestType>::Deserialize( - param.request, &req, param.max_receive_message_size); + Status status = + SerializationTraits<RequestType>::Deserialize(param.request, &req); if (status.ok()) { ServerWriter<ResponseType> writer(param.call, param.server_context); diff --git a/include/grpc++/impl/codegen/proto_utils.h b/include/grpc++/impl/codegen/proto_utils.h index 2f15487591..2123b62ed9 100644 --- a/include/grpc++/impl/codegen/proto_utils.h +++ b/include/grpc++/impl/codegen/proto_utils.h @@ -203,8 +203,7 @@ class SerializationTraits<T, typename std::enable_if<std::is_base_of< } static Status Deserialize(grpc_byte_buffer* buffer, - grpc::protobuf::Message* msg, - int max_receive_message_size) { + grpc::protobuf::Message* msg) { if (buffer == nullptr) { return Status(StatusCode::INTERNAL, "No payload"); } @@ -215,10 +214,7 @@ class SerializationTraits<T, typename std::enable_if<std::is_base_of< return reader.status(); } ::grpc::protobuf::io::CodedInputStream decoder(&reader); - if (max_receive_message_size > 0) { - decoder.SetTotalBytesLimit(max_receive_message_size, - max_receive_message_size); - } + decoder.SetTotalBytesLimit(INT_MAX, INT_MAX); if (!msg->ParseFromCodedStream(&decoder)) { result = Status(StatusCode::INTERNAL, msg->InitializationErrorString()); } diff --git a/include/grpc++/impl/codegen/rpc_service_method.h b/include/grpc++/impl/codegen/rpc_service_method.h index 78c54e3771..eb8f9a1096 100644 --- a/include/grpc++/impl/codegen/rpc_service_method.h +++ b/include/grpc++/impl/codegen/rpc_service_method.h @@ -57,17 +57,12 @@ class MethodHandler { public: virtual ~MethodHandler() {} struct HandlerParameter { - HandlerParameter(Call* c, ServerContext* context, grpc_byte_buffer* req, - int max_size) - : call(c), - server_context(context), - request(req), - max_receive_message_size(max_size) {} + HandlerParameter(Call* c, ServerContext* context, grpc_byte_buffer* req) + : call(c), server_context(context), request(req) {} Call* call; ServerContext* server_context; // Handler required to grpc_byte_buffer_destroy this grpc_byte_buffer* request; - int max_receive_message_size; }; virtual void RunHandler(const HandlerParameter& param) = 0; }; diff --git a/include/grpc++/impl/codegen/server_interface.h b/include/grpc++/impl/codegen/server_interface.h index 666b9ff66e..752e493a9e 100644 --- a/include/grpc++/impl/codegen/server_interface.h +++ b/include/grpc++/impl/codegen/server_interface.h @@ -199,9 +199,7 @@ class ServerInterface : public CallHook { bool FinalizeResult(void** tag, bool* status) override { bool serialization_status = *status && payload_ && - SerializationTraits<Message>::Deserialize( - payload_, request_, server_->max_receive_message_size()) - .ok(); + SerializationTraits<Message>::Deserialize(payload_, request_).ok(); bool ret = RegisteredAsyncRequest::FinalizeResult(tag, status); *status = serialization_status && *status; return ret; diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h index 4d9b074e95..1f7708bab9 100644 --- a/include/grpc++/impl/codegen/sync_stream.h +++ b/include/grpc++/impl/codegen/sync_stream.h @@ -160,7 +160,7 @@ class ClientReader final : public ClientReaderInterface<R> { } bool NextMessageSize(uint32_t* sz) override { - *sz = call_.max_receive_message_size(); + *sz = INT_MAX; return true; } @@ -310,7 +310,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> { } bool NextMessageSize(uint32_t* sz) override { - *sz = call_.max_receive_message_size(); + *sz = INT_MAX; return true; } @@ -382,7 +382,7 @@ class ServerReader final : public ServerReaderInterface<R> { } bool NextMessageSize(uint32_t* sz) override { - *sz = call_->max_receive_message_size(); + *sz = INT_MAX; return true; } @@ -474,7 +474,7 @@ class ServerReaderWriterBody final { } bool NextMessageSize(uint32_t* sz) { - *sz = call_->max_receive_message_size(); + *sz = INT_MAX; return true; } diff --git a/include/grpc++/support/byte_buffer.h b/include/grpc++/support/byte_buffer.h index 1f317df663..064a03b977 100644 --- a/include/grpc++/support/byte_buffer.h +++ b/include/grpc++/support/byte_buffer.h @@ -95,8 +95,7 @@ class ByteBuffer final { template <> class SerializationTraits<ByteBuffer, void> { public: - static Status Deserialize(grpc_byte_buffer* byte_buffer, ByteBuffer* dest, - int max_receive_message_size) { + static Status Deserialize(grpc_byte_buffer* byte_buffer, ByteBuffer* dest) { dest->set_buffer(byte_buffer); return Status::OK; } diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index ee8101aab8..8d20f705ee 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -418,7 +418,9 @@ typedef struct grpc_op { grpc_compression_level level; } maybe_compression_level; } send_initial_metadata; - struct grpc_byte_buffer *send_message; + struct { + struct grpc_byte_buffer *send_message; + } send_message; struct { size_t trailing_metadata_count; grpc_metadata *trailing_metadata; @@ -430,11 +432,15 @@ typedef struct grpc_op { object, recv_initial_metadata->array is owned by the caller). After the operation completes, call grpc_metadata_array_destroy on this value, or reuse it in a future op. */ - grpc_metadata_array *recv_initial_metadata; + struct { + grpc_metadata_array *recv_initial_metadata; + } recv_initial_metadata; /** ownership of the byte buffer is moved to the caller; the caller must call grpc_byte_buffer_destroy on this value, or reuse it in a future op. */ - struct grpc_byte_buffer **recv_message; + struct { + struct grpc_byte_buffer **recv_message; + } recv_message; struct { /** ownership of the array is with the caller, but ownership of the elements stays with the call object (ie key, value members are owned diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c index 97f98df03a..567e65ac69 100644 --- a/src/core/ext/lb_policy/grpclb/grpclb.c +++ b/src/core/ext/lb_policy/grpclb/grpclb.c @@ -1178,14 +1178,15 @@ static void query_for_backends_locked(grpc_exec_ctx *exec_ctx, op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &glb_policy->lb_initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = + &glb_policy->lb_initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; GPR_ASSERT(glb_policy->lb_request_payload != NULL); op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = glb_policy->lb_request_payload; + op->data.send_message.send_message = glb_policy->lb_request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -1211,7 +1212,7 @@ static void query_for_backends_locked(grpc_exec_ctx *exec_ctx, op = ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &glb_policy->lb_response_payload; + op->data.recv_message.recv_message = &glb_policy->lb_response_payload; op->flags = 0; op->reserved = NULL; op++; @@ -1293,7 +1294,7 @@ static void lb_on_response_received(grpc_exec_ctx *exec_ctx, void *arg, if (!glb_policy->shutting_down) { /* keep listening for serverlist updates */ op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &glb_policy->lb_response_payload; + op->data.recv_message.recv_message = &glb_policy->lb_response_payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/src/core/lib/channel/message_size_filter.c b/src/core/lib/channel/message_size_filter.c index 862090b371..90f470139b 100644 --- a/src/core/lib/channel/message_size_filter.c +++ b/src/core/lib/channel/message_size_filter.c @@ -68,12 +68,16 @@ static void* message_size_limits_create_from_json(const grpc_json* json) { if (field->key == NULL) continue; if (strcmp(field->key, "maxRequestMessageBytes") == 0) { if (max_request_message_bytes >= 0) return NULL; // Duplicate. - if (field->type != GRPC_JSON_STRING) return NULL; + if (field->type != GRPC_JSON_STRING && field->type != GRPC_JSON_NUMBER) { + return NULL; + } max_request_message_bytes = gpr_parse_nonnegative_int(field->value); if (max_request_message_bytes == -1) return NULL; } else if (strcmp(field->key, "maxResponseMessageBytes") == 0) { if (max_response_message_bytes >= 0) return NULL; // Duplicate. - if (field->type != GRPC_JSON_STRING) return NULL; + if (field->type != GRPC_JSON_STRING && field->type != GRPC_JSON_NUMBER) { + return NULL; + } max_response_message_bytes = gpr_parse_nonnegative_int(field->value); if (max_response_message_bytes == -1) return NULL; } diff --git a/src/core/lib/iomgr/ev_epoll_linux.c b/src/core/lib/iomgr/ev_epoll_linux.c index 715d057c51..2a6956ae54 100644 --- a/src/core/lib/iomgr/ev_epoll_linux.c +++ b/src/core/lib/iomgr/ev_epoll_linux.c @@ -1527,7 +1527,8 @@ static void pollset_work_and_unlock(grpc_exec_ctx *exec_ctx, append_error(error, grpc_wakeup_fd_consume_wakeup(&global_wakeup_fd), err_desc); } else if (data_ptr == &pi->workqueue_wakeup_fd) { - append_error(error, grpc_wakeup_fd_consume_wakeup(&global_wakeup_fd), + append_error(error, + grpc_wakeup_fd_consume_wakeup(&pi->workqueue_wakeup_fd), err_desc); maybe_do_workqueue_work(exec_ctx, pi); } else if (data_ptr == &polling_island_wakeup_fd) { diff --git a/src/core/lib/iomgr/resource_quota.c b/src/core/lib/iomgr/resource_quota.c index 31590cd53b..0286309921 100644 --- a/src/core/lib/iomgr/resource_quota.c +++ b/src/core/lib/iomgr/resource_quota.c @@ -804,12 +804,10 @@ void grpc_resource_user_finish_reclamation(grpc_exec_ctx *exec_ctx, void grpc_resource_user_slice_allocator_init( grpc_resource_user_slice_allocator *slice_allocator, grpc_resource_user *resource_user, grpc_iomgr_cb_func cb, void *p) { - grpc_closure_init( - &slice_allocator->on_allocated, ru_allocated_slices, slice_allocator, - grpc_combiner_scheduler(resource_user->resource_quota->combiner, false)); - grpc_closure_init( - &slice_allocator->on_done, cb, p, - grpc_combiner_scheduler(resource_user->resource_quota->combiner, false)); + grpc_closure_init(&slice_allocator->on_allocated, ru_allocated_slices, + slice_allocator, grpc_schedule_on_exec_ctx); + grpc_closure_init(&slice_allocator->on_done, cb, p, + grpc_schedule_on_exec_ctx); slice_allocator->resource_user = resource_user; } diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index 899e8fab3f..cac5737d91 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -1461,7 +1461,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, error = GRPC_CALL_ERROR_INVALID_FLAGS; goto done_with_error; } - if (op->data.send_message == NULL) { + if (op->data.send_message.send_message == NULL) { error = GRPC_CALL_ERROR_INVALID_MESSAGE; goto done_with_error; } @@ -1473,11 +1473,13 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, call->sending_message = 1; grpc_slice_buffer_stream_init( &call->sending_stream, - &op->data.send_message->data.raw.slice_buffer, op->flags); + &op->data.send_message.send_message->data.raw.slice_buffer, + op->flags); /* If the outgoing buffer is already compressed, mark it as so in the flags. These will be picked up by the compression filter and further (wasteful) attempts at compression skipped. */ - if (op->data.send_message->data.raw.compression > GRPC_COMPRESS_NONE) { + if (op->data.send_message.send_message->data.raw.compression > + GRPC_COMPRESS_NONE) { call->sending_stream.base.flags |= GRPC_WRITE_INTERNAL_COMPRESS; } stream_op->send_message = &call->sending_stream.base; @@ -1565,7 +1567,8 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, that case we're not necessarily covered by a poller. */ stream_op->covered_by_poller = call->is_client; call->received_initial_metadata = 1; - call->buffered_metadata[0] = op->data.recv_initial_metadata; + call->buffered_metadata[0] = + op->data.recv_initial_metadata.recv_initial_metadata; grpc_closure_init(&call->receiving_initial_metadata_ready, receiving_initial_metadata_ready, bctl, grpc_schedule_on_exec_ctx); @@ -1588,7 +1591,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, } call->receiving_message = 1; bctl->recv_message = 1; - call->receiving_buffer = op->data.recv_message; + call->receiving_buffer = op->data.recv_message.recv_message; stream_op->recv_message = &call->receiving_stream; grpc_closure_init(&call->receiving_stream_ready, receiving_stream_ready, bctl, grpc_schedule_on_exec_ctx); diff --git a/src/core/lib/surface/call_log_batch.c b/src/core/lib/surface/call_log_batch.c index 31c074f15d..61b73a138f 100644 --- a/src/core/lib/surface/call_log_batch.c +++ b/src/core/lib/surface/call_log_batch.c @@ -63,7 +63,8 @@ char *grpc_op_string(const grpc_op *op) { op->data.send_initial_metadata.count); break; case GRPC_OP_SEND_MESSAGE: - gpr_asprintf(&tmp, "SEND_MESSAGE ptr=%p", op->data.send_message); + gpr_asprintf(&tmp, "SEND_MESSAGE ptr=%p", + op->data.send_message.send_message); gpr_strvec_add(&b, tmp); break; case GRPC_OP_SEND_CLOSE_FROM_CLIENT: @@ -79,11 +80,12 @@ char *grpc_op_string(const grpc_op *op) { break; case GRPC_OP_RECV_INITIAL_METADATA: gpr_asprintf(&tmp, "RECV_INITIAL_METADATA ptr=%p", - op->data.recv_initial_metadata); + op->data.recv_initial_metadata.recv_initial_metadata); gpr_strvec_add(&b, tmp); break; case GRPC_OP_RECV_MESSAGE: - gpr_asprintf(&tmp, "RECV_MESSAGE ptr=%p", op->data.recv_message); + gpr_asprintf(&tmp, "RECV_MESSAGE ptr=%p", + op->data.recv_message.recv_message); gpr_strvec_add(&b, tmp); break; case GRPC_OP_RECV_STATUS_ON_CLIENT: diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index addb7c4fbc..9e916465be 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -609,7 +609,7 @@ static void finish_start_new_rpc( grpc_op op; memset(&op, 0, sizeof(op)); op.op = GRPC_OP_RECV_MESSAGE; - op.data.recv_message = &calld->payload; + op.data.recv_message.recv_message = &calld->payload; grpc_closure_init(&calld->publish, publish_new_rpc, elem, grpc_schedule_on_exec_ctx); grpc_call_start_batch_and_execute(exec_ctx, calld->call, &op, 1, @@ -857,7 +857,8 @@ static void accept_stream(grpc_exec_ctx *exec_ctx, void *cd, grpc_op op; memset(&op, 0, sizeof(op)); op.op = GRPC_OP_RECV_INITIAL_METADATA; - op.data.recv_initial_metadata = &calld->initial_metadata; + op.data.recv_initial_metadata.recv_initial_metadata = + &calld->initial_metadata; grpc_closure_init(&calld->got_initial_metadata, got_initial_metadata, elem, grpc_schedule_on_exec_ctx); grpc_call_start_batch_and_execute(exec_ctx, call, &op, 1, diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 817d85a81c..7785a1f124 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -186,7 +186,7 @@ class Server::SyncRequest final : public CompletionQueueTag { public: explicit CallData(Server* server, SyncRequest* mrd) : cq_(mrd->cq_), - call_(mrd->call_, server, &cq_, server->max_receive_message_size_), + call_(mrd->call_, server, &cq_), ctx_(mrd->deadline_, mrd->request_metadata_.metadata, mrd->request_metadata_.count), has_request_payload_(mrd->has_request_payload_), @@ -208,8 +208,8 @@ class Server::SyncRequest final : public CompletionQueueTag { void Run(std::shared_ptr<GlobalCallbacks> global_callbacks) { ctx_.BeginCompletionOp(&call_); global_callbacks->PreSynchronousRequest(&ctx_); - method_->handler()->RunHandler(MethodHandler::HandlerParameter( - &call_, &ctx_, request_payload_, call_.max_receive_message_size())); + method_->handler()->RunHandler( + MethodHandler::HandlerParameter(&call_, &ctx_, request_payload_)); global_callbacks->PostSynchronousRequest(&ctx_); request_payload_ = nullptr; void* ignored_tag; @@ -598,7 +598,7 @@ bool ServerInterface::BaseAsyncRequest::FinalizeResult(void** tag, grpc_metadata_array_destroy(&initial_metadata_array_); context_->set_call(call_); context_->cq_ = call_cq_; - Call call(call_, server_, call_cq_, server_->max_receive_message_size()); + Call call(call_, server_, call_cq_); if (*status && call_) { context_->BeginCompletionOp(&call); } diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c index 946f5872c0..7239606c64 100644 --- a/src/csharp/ext/grpc_csharp_ext.c +++ b/src/csharp/ext/grpc_csharp_ext.c @@ -537,7 +537,7 @@ grpcsharp_call_start_unary(grpc_call *call, grpcsharp_batch_context *ctx, ops[1].op = GRPC_OP_SEND_MESSAGE; ctx->send_message = string_to_byte_buffer(send_buffer, send_buffer_len); - ops[1].data.send_message = ctx->send_message; + ops[1].data.send_message.send_message = ctx->send_message; ops[1].flags = write_flags; ops[1].reserved = NULL; @@ -546,12 +546,13 @@ grpcsharp_call_start_unary(grpc_call *call, grpcsharp_batch_context *ctx, ops[2].reserved = NULL; ops[3].op = GRPC_OP_RECV_INITIAL_METADATA; - ops[3].data.recv_initial_metadata = &(ctx->recv_initial_metadata); + ops[3].data.recv_initial_metadata.recv_initial_metadata = + &(ctx->recv_initial_metadata); ops[3].flags = 0; ops[3].reserved = NULL; ops[4].op = GRPC_OP_RECV_MESSAGE; - ops[4].data.recv_message = &(ctx->recv_message); + ops[4].data.recv_message.recv_message = &(ctx->recv_message); ops[4].flags = 0; ops[4].reserved = NULL; @@ -590,12 +591,13 @@ grpcsharp_call_start_client_streaming(grpc_call *call, ops[0].reserved = NULL; ops[1].op = GRPC_OP_RECV_INITIAL_METADATA; - ops[1].data.recv_initial_metadata = &(ctx->recv_initial_metadata); + ops[1].data.recv_initial_metadata.recv_initial_metadata = + &(ctx->recv_initial_metadata); ops[1].flags = 0; ops[1].reserved = NULL; ops[2].op = GRPC_OP_RECV_MESSAGE; - ops[2].data.recv_message = &(ctx->recv_message); + ops[2].data.recv_message.recv_message = &(ctx->recv_message); ops[2].flags = 0; ops[2].reserved = NULL; @@ -634,7 +636,7 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_server_streaming( ops[1].op = GRPC_OP_SEND_MESSAGE; ctx->send_message = string_to_byte_buffer(send_buffer, send_buffer_len); - ops[1].data.send_message = ctx->send_message; + ops[1].data.send_message.send_message = ctx->send_message; ops[1].flags = write_flags; ops[1].reserved = NULL; @@ -698,7 +700,8 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_recv_initial_metadata( /* TODO: don't use magic number */ grpc_op ops[1]; ops[0].op = GRPC_OP_RECV_INITIAL_METADATA; - ops[0].data.recv_initial_metadata = &(ctx->recv_initial_metadata); + ops[0].data.recv_initial_metadata.recv_initial_metadata = + &(ctx->recv_initial_metadata); ops[0].flags = 0; ops[0].reserved = NULL; @@ -717,7 +720,7 @@ grpcsharp_call_send_message(grpc_call *call, grpcsharp_batch_context *ctx, size_t nops = send_empty_initial_metadata ? 2 : 1; ops[0].op = GRPC_OP_SEND_MESSAGE; ctx->send_message = string_to_byte_buffer(send_buffer, send_buffer_len); - ops[0].data.send_message = ctx->send_message; + ops[0].data.send_message.send_message = ctx->send_message; ops[0].flags = write_flags; ops[0].reserved = NULL; ops[1].op = GRPC_OP_SEND_INITIAL_METADATA; @@ -765,7 +768,7 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_status_from_server( ops[nops].op = GRPC_OP_SEND_MESSAGE; ctx->send_message = string_to_byte_buffer(optional_send_buffer, optional_send_buffer_len); - ops[nops].data.send_message = ctx->send_message; + ops[nops].data.send_message.send_message = ctx->send_message; ops[nops].flags = write_flags; ops[nops].reserved = NULL; nops ++; @@ -784,7 +787,7 @@ grpcsharp_call_recv_message(grpc_call *call, grpcsharp_batch_context *ctx) { /* TODO: don't use magic number */ grpc_op ops[1]; ops[0].op = GRPC_OP_RECV_MESSAGE; - ops[0].data.recv_message = &(ctx->recv_message); + ops[0].data.recv_message.recv_message = &(ctx->recv_message); ops[0].flags = 0; ops[0].reserved = NULL; return grpc_call_start_batch(call, ops, sizeof(ops) / sizeof(ops[0]), ctx, diff --git a/src/node/ext/call.cc b/src/node/ext/call.cc index 191e763e0e..96f66a48d2 100644 --- a/src/node/ext/call.cc +++ b/src/node/ext/call.cc @@ -262,7 +262,7 @@ class SendMessageOp : public Op { } } send_message = BufferToByteBuffer(value); - out->data.send_message = send_message; + out->data.send_message.send_message = send_message; PersistentValue *handle = new PersistentValue(value); resources->handles.push_back(unique_ptr<PersistentValue>(handle)); return true; @@ -377,7 +377,7 @@ class GetMetadataOp : public Op { bool ParseOp(Local<Value> value, grpc_op *out, shared_ptr<Resources> resources) { - out->data.recv_initial_metadata = &recv_metadata; + out->data.recv_initial_metadata.recv_initial_metadata = &recv_metadata; return true; } bool IsFinalOp() { @@ -410,7 +410,7 @@ class ReadMessageOp : public Op { bool ParseOp(Local<Value> value, grpc_op *out, shared_ptr<Resources> resources) { - out->data.recv_message = &recv_message; + out->data.recv_message.recv_message = &recv_message; return true; } bool IsFinalOp() { diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m index 38fcae0299..45d0aae203 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m @@ -105,14 +105,14 @@ } if (self = [super init]) { _op.op = GRPC_OP_SEND_MESSAGE; - _op.data.send_message = message.grpc_byteBuffer; + _op.data.send_message.send_message = message.grpc_byteBuffer; _handler = handler; } return self; } - (void)dealloc { - grpc_byte_buffer_destroy(_op.data.send_message); + grpc_byte_buffer_destroy(_op.data.send_message.send_message); } @end @@ -145,7 +145,7 @@ if (self = [super init]) { _op.op = GRPC_OP_RECV_INITIAL_METADATA; grpc_metadata_array_init(&_headers); - _op.data.recv_initial_metadata = &_headers; + _op.data.recv_initial_metadata.recv_initial_metadata = &_headers; if (handler) { // Prevent reference cycle with _handler __weak typeof(self) weakSelf = self; @@ -177,7 +177,7 @@ - (instancetype)initWithHandler:(void (^)(grpc_byte_buffer *))handler { if (self = [super init]) { _op.op = GRPC_OP_RECV_MESSAGE; - _op.data.recv_message = &_receivedMessage; + _op.data.recv_message.recv_message = &_receivedMessage; if (handler) { // Prevent reference cycle with _handler __weak typeof(self) weakSelf = self; diff --git a/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m b/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m index dbd28076dd..43b91a072b 100644 --- a/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m +++ b/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m @@ -142,7 +142,7 @@ static void drain_cq(grpc_completion_queue *cq) { op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -151,12 +151,12 @@ static void drain_cq(grpc_completion_queue *cq) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 64b1137c2a..be11e63d62 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -335,7 +335,7 @@ PHP_METHOD(Call, startBatch) { 1 TSRMLS_CC); goto cleanup; } - ops[op_num].data.send_message = + ops[op_num].data.send_message.send_message = string_to_byte_buffer(Z_STRVAL_P(message_value), Z_STRLEN_P(message_value)); break; @@ -390,10 +390,11 @@ PHP_METHOD(Call, startBatch) { } break; case GRPC_OP_RECV_INITIAL_METADATA: - ops[op_num].data.recv_initial_metadata = &recv_metadata; + ops[op_num].data.recv_initial_metadata.recv_initial_metadata = + &recv_metadata; break; case GRPC_OP_RECV_MESSAGE: - ops[op_num].data.recv_message = &message; + ops[op_num].data.recv_message.recv_message = &message; break; case GRPC_OP_RECV_STATUS_ON_CLIENT: ops[op_num].data.recv_status_on_client.trailing_metadata = @@ -498,7 +499,7 @@ cleanup: } for (int i = 0; i < op_num; i++) { if (ops[i].op == GRPC_OP_SEND_MESSAGE) { - grpc_byte_buffer_destroy(ops[i].data.send_message); + grpc_byte_buffer_destroy(ops[i].data.send_message.send_message); } if (ops[i].op == GRPC_OP_RECV_MESSAGE) { grpc_byte_buffer_destroy(message); diff --git a/src/php/lib/Grpc/AbstractCall.php b/src/php/lib/Grpc/AbstractCall.php index 9f0b02b8bb..40387abdc0 100644 --- a/src/php/lib/Grpc/AbstractCall.php +++ b/src/php/lib/Grpc/AbstractCall.php @@ -58,12 +58,11 @@ abstract class AbstractCall * the response * @param array $options Call options (optional) */ - public function __construct( - Channel $channel, - $method, - $deserialize, - array $options = [] - ) { + public function __construct(Channel $channel, + $method, + $deserialize, + array $options = []) + { if (array_key_exists('timeout', $options) && is_numeric($timeout = $options['timeout']) ) { @@ -127,7 +126,7 @@ abstract class AbstractCall * * @return string The protobuf binary format */ - protected function serializeMessage($data) + protected function _serializeMessage($data) { // Proto3 implementation if (method_exists($data, 'encode')) { @@ -145,7 +144,7 @@ abstract class AbstractCall * * @return mixed The deserialized value */ - protected function deserializeResponse($value) + protected function _deserializeResponse($value) { if ($value === null) { return; diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php index a9e77b9396..ed504f85a8 100644 --- a/src/php/lib/Grpc/BaseStub.php +++ b/src/php/lib/Grpc/BaseStub.php @@ -146,6 +146,14 @@ class BaseStub } /** + * Close the communication channel associated with this stub. + */ + public function close() + { + $this->channel->close(); + } + + /** * @param $new_state Connect state * * @return bool true if state is CHANNEL_READY @@ -164,14 +172,6 @@ class BaseStub } /** - * Close the communication channel associated with this stub. - */ - public function close() - { - $this->channel->close(); - } - - /** * constructs the auth uri for the jwt. * * @param string $method The method string @@ -235,7 +235,7 @@ class BaseStub * * @return SimpleSurfaceActiveCall The active call object */ - public function _simpleRequest($method, + protected function _simpleRequest($method, $argument, $deserialize, array $metadata = [], @@ -270,7 +270,7 @@ class BaseStub * * @return ClientStreamingSurfaceActiveCall The active call object */ - public function _clientStreamRequest($method, + protected function _clientStreamRequest($method, $deserialize, array $metadata = [], array $options = []) @@ -305,7 +305,7 @@ class BaseStub * * @return ServerStreamingSurfaceActiveCall The active call object */ - public function _serverStreamRequest($method, + protected function _serverStreamRequest($method, $argument, $deserialize, array $metadata = [], @@ -339,7 +339,7 @@ class BaseStub * * @return BidiStreamingSurfaceActiveCall The active call object */ - public function _bidiRequest($method, + protected function _bidiRequest($method, $deserialize, array $metadata = [], array $options = []) diff --git a/src/php/lib/Grpc/BidiStreamingCall.php b/src/php/lib/Grpc/BidiStreamingCall.php index b03bbd204f..7cb200d141 100644 --- a/src/php/lib/Grpc/BidiStreamingCall.php +++ b/src/php/lib/Grpc/BidiStreamingCall.php @@ -69,7 +69,7 @@ class BidiStreamingCall extends AbstractCall $this->metadata = $read_event->metadata; } - return $this->deserializeResponse($read_event->message); + return $this->_deserializeResponse($read_event->message); } /** @@ -82,7 +82,7 @@ class BidiStreamingCall extends AbstractCall */ public function write($data, array $options = []) { - $message_array = ['message' => $this->serializeMessage($data)]; + $message_array = ['message' => $this->_serializeMessage($data)]; if (array_key_exists('flags', $options)) { $message_array['flags'] = $options['flags']; } diff --git a/src/php/lib/Grpc/ClientStreamingCall.php b/src/php/lib/Grpc/ClientStreamingCall.php index c542f08872..6454cbcb21 100644 --- a/src/php/lib/Grpc/ClientStreamingCall.php +++ b/src/php/lib/Grpc/ClientStreamingCall.php @@ -63,7 +63,7 @@ class ClientStreamingCall extends AbstractCall */ public function write($data, array $options = []) { - $message_array = ['message' => $this->serializeMessage($data)]; + $message_array = ['message' => $this->_serializeMessage($data)]; if (array_key_exists('flags', $options)) { $message_array['flags'] = $options['flags']; } @@ -90,6 +90,6 @@ class ClientStreamingCall extends AbstractCall $status = $event->status; $this->trailing_metadata = $status->metadata; - return [$this->deserializeResponse($event->message), $status]; + return [$this->_deserializeResponse($event->message), $status]; } } diff --git a/src/php/lib/Grpc/ServerStreamingCall.php b/src/php/lib/Grpc/ServerStreamingCall.php index 406512bf57..8659f6bc22 100644 --- a/src/php/lib/Grpc/ServerStreamingCall.php +++ b/src/php/lib/Grpc/ServerStreamingCall.php @@ -51,7 +51,7 @@ class ServerStreamingCall extends AbstractCall */ public function start($data, array $metadata = [], array $options = []) { - $message_array = ['message' => $this->serializeMessage($data)]; + $message_array = ['message' => $this->_serializeMessage($data)]; if (array_key_exists('flags', $options)) { $message_array['flags'] = $options['flags']; } @@ -73,7 +73,7 @@ class ServerStreamingCall extends AbstractCall OP_RECV_MESSAGE => true, ])->message; while ($response !== null) { - yield $this->deserializeResponse($response); + yield $this->_deserializeResponse($response); $response = $this->call->startBatch([ OP_RECV_MESSAGE => true, ])->message; diff --git a/src/php/lib/Grpc/UnaryCall.php b/src/php/lib/Grpc/UnaryCall.php index 3c1cb158ea..b8b1ed6eae 100644 --- a/src/php/lib/Grpc/UnaryCall.php +++ b/src/php/lib/Grpc/UnaryCall.php @@ -51,7 +51,7 @@ class UnaryCall extends AbstractCall */ public function start($data, array $metadata = [], array $options = []) { - $message_array = ['message' => $this->serializeMessage($data)]; + $message_array = ['message' => $this->_serializeMessage($data)]; if (isset($options['flags'])) { $message_array['flags'] = $options['flags']; } @@ -79,6 +79,6 @@ class UnaryCall extends AbstractCall $status = $event->status; $this->trailing_metadata = $status->metadata; - return [$this->deserializeResponse($event->message), $status]; + return [$this->_deserializeResponse($event->message), $status]; } } diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi index ad766186bd..348d42cb0b 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi @@ -279,12 +279,21 @@ cdef extern from "grpc/grpc.h": ctypedef struct grpc_op_data_recv_close_on_server: int *cancelled + ctypedef struct grpc_op_data_send_message: + grpc_byte_buffer *send_message + + ctypedef struct grpc_op_data_receive_message: + grpc_byte_buffer **receive_message "recv_message" + + ctypedef struct grpc_op_data_receive_initial_metadata: + grpc_metadata_array *receive_initial_metadata "recv_initial_metadata" + union grpc_op_data: grpc_op_data_send_initial_metadata send_initial_metadata - grpc_byte_buffer *send_message + grpc_op_data_send_message send_message grpc_op_data_send_status_from_server send_status_from_server - grpc_metadata_array *receive_initial_metadata "recv_initial_metadata" - grpc_byte_buffer **receive_message "recv_message" + grpc_op_data_receive_initial_metadata receive_initial_metadata "recv_initial_metadata" + grpc_op_data_receive_message receive_message "recv_message" grpc_op_data_recv_status_on_client receive_status_on_client "recv_status_on_client" grpc_op_data_recv_close_on_server receive_close_on_server "recv_close_on_server" diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi index 69b837c4db..07385129ef 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi @@ -606,7 +606,7 @@ def operation_send_message(data, int flags): op.c_op.type = GRPC_OP_SEND_MESSAGE op.c_op.flags = flags byte_buffer = ByteBuffer(data) - op.c_op.data.send_message = byte_buffer.c_byte_buffer + op.c_op.data.send_message.send_message = byte_buffer.c_byte_buffer op.references.append(byte_buffer) op.is_valid = True return op @@ -639,7 +639,7 @@ def operation_receive_initial_metadata(int flags): op.c_op.type = GRPC_OP_RECV_INITIAL_METADATA op.c_op.flags = flags op._received_metadata = Metadata([]) - op.c_op.data.receive_initial_metadata = ( + op.c_op.data.receive_initial_metadata.receive_initial_metadata = ( &op._received_metadata.c_metadata_array) op.is_valid = True return op @@ -652,7 +652,8 @@ def operation_receive_message(int flags): # n.b. the c_op.data.receive_message field needs to be deleted by us, # anyway, so we just let that be handled by the ByteBuffer() we allocated # the line before. - op.c_op.data.receive_message = &op._received_message.c_byte_buffer + op.c_op.data.receive_message.receive_message = ( + &op._received_message.c_byte_buffer) op.is_valid = True return op diff --git a/src/ruby/ext/grpc/rb_call.c b/src/ruby/ext/grpc/rb_call.c index 67a42af619..fbc68c4e59 100644 --- a/src/ruby/ext/grpc/rb_call.c +++ b/src/ruby/ext/grpc/rb_call.c @@ -641,7 +641,7 @@ static void grpc_run_batch_stack_cleanup(run_batch_stack *st) { for (i = 0; i < st->op_num; i++) { if (st->ops[i].op == GRPC_OP_SEND_MESSAGE) { - grpc_byte_buffer_destroy(st->ops[i].data.send_message); + grpc_byte_buffer_destroy(st->ops[i].data.send_message.send_message); } } } @@ -673,8 +673,9 @@ static void grpc_run_batch_stack_fill_ops(run_batch_stack *st, VALUE ops_hash) { st->send_metadata.metadata; break; case GRPC_OP_SEND_MESSAGE: - st->ops[st->op_num].data.send_message = grpc_rb_s_to_byte_buffer( - RSTRING_PTR(this_value), RSTRING_LEN(this_value)); + st->ops[st->op_num].data.send_message.send_message = + grpc_rb_s_to_byte_buffer(RSTRING_PTR(this_value), + RSTRING_LEN(this_value)); st->ops[st->op_num].flags = st->write_flag; break; case GRPC_OP_SEND_CLOSE_FROM_CLIENT: @@ -686,10 +687,11 @@ static void grpc_run_batch_stack_fill_ops(run_batch_stack *st, VALUE ops_hash) { &st->ops[st->op_num], &st->send_trailing_metadata, this_value); break; case GRPC_OP_RECV_INITIAL_METADATA: - st->ops[st->op_num].data.recv_initial_metadata = &st->recv_metadata; + st->ops[st->op_num].data.recv_initial_metadata.recv_initial_metadata = + &st->recv_metadata; break; case GRPC_OP_RECV_MESSAGE: - st->ops[st->op_num].data.recv_message = &st->recv_message; + st->ops[st->op_num].data.recv_message.recv_message = &st->recv_message; break; case GRPC_OP_RECV_STATUS_ON_CLIENT: st->ops[st->op_num].data.recv_status_on_client.trailing_metadata = diff --git a/test/core/bad_ssl/bad_ssl_test.c b/test/core/bad_ssl/bad_ssl_test.c index f8a9fe6cac..41b514be1c 100644 --- a/test/core/bad_ssl/bad_ssl_test.c +++ b/test/core/bad_ssl/bad_ssl_test.c @@ -100,7 +100,7 @@ static void run_test(const char *target, size_t nops) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/client_channel/lb_policies_test.c b/test/core/client_channel/lb_policies_test.c index f46982a387..a34741ee47 100644 --- a/test/core/client_channel/lb_policies_test.c +++ b/test/core/client_channel/lb_policies_test.c @@ -312,7 +312,8 @@ static request_sequences perform_request(servers_fixture *f, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &rdata->initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = + &rdata->initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/bad_server_response_test.c b/test/core/end2end/bad_server_response_test.c index a052016883..d3a47ab34d 100644 --- a/test/core/end2end/bad_server_response_test.c +++ b/test/core/end2end/bad_server_response_test.c @@ -198,7 +198,7 @@ static void start_rpc(int target_port, grpc_status_code expected_status, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c index 11e8604f56..59079f5445 100644 --- a/test/core/end2end/dualstack_socket_test.c +++ b/test/core/end2end/dualstack_socket_test.c @@ -184,7 +184,7 @@ void test_connect(const char *server_host, const char *client_host, int port, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/fixtures/proxy.c b/test/core/end2end/fixtures/proxy.c index beed80df81..70d8da48ae 100644 --- a/test/core/end2end/fixtures/proxy.c +++ b/test/core/end2end/fixtures/proxy.c @@ -203,7 +203,7 @@ static void on_p2s_sent_message(void *arg, int success) { op.op = GRPC_OP_RECV_MESSAGE; op.flags = 0; op.reserved = NULL; - op.data.recv_message = &pc->c2p_msg; + op.data.recv_message.recv_message = &pc->c2p_msg; refpc(pc, "on_c2p_recv_msg"); err = grpc_call_start_batch(pc->c2p, &op, 1, new_closure(on_c2p_recv_msg, pc), NULL); @@ -228,7 +228,7 @@ static void on_c2p_recv_msg(void *arg, int success) { op.op = GRPC_OP_SEND_MESSAGE; op.flags = 0; op.reserved = NULL; - op.data.send_message = pc->c2p_msg; + op.data.send_message.send_message = pc->c2p_msg; refpc(pc, "on_p2s_sent_message"); err = grpc_call_start_batch(pc->p2s, &op, 1, new_closure(on_p2s_sent_message, pc), NULL); @@ -259,7 +259,7 @@ static void on_c2p_sent_message(void *arg, int success) { op.op = GRPC_OP_RECV_MESSAGE; op.flags = 0; op.reserved = NULL; - op.data.recv_message = &pc->p2s_msg; + op.data.recv_message.recv_message = &pc->p2s_msg; refpc(pc, "on_p2s_recv_msg"); err = grpc_call_start_batch(pc->p2s, &op, 1, new_closure(on_p2s_recv_msg, pc), NULL); @@ -278,7 +278,7 @@ static void on_p2s_recv_msg(void *arg, int success) { op.op = GRPC_OP_SEND_MESSAGE; op.flags = 0; op.reserved = NULL; - op.data.send_message = pc->p2s_msg; + op.data.send_message.send_message = pc->p2s_msg; refpc(pc, "on_c2p_sent_message"); err = grpc_call_start_batch(pc->c2p, &op, 1, new_closure(on_c2p_sent_message, pc), NULL); @@ -347,7 +347,8 @@ static void on_new_call(void *arg, int success) { op.op = GRPC_OP_RECV_INITIAL_METADATA; op.flags = 0; - op.data.recv_initial_metadata = &pc->p2s_initial_metadata; + op.data.recv_initial_metadata.recv_initial_metadata = + &pc->p2s_initial_metadata; refpc(pc, "on_p2s_recv_initial_metadata"); err = grpc_call_start_batch( pc->p2s, &op, 1, new_closure(on_p2s_recv_initial_metadata, pc), NULL); @@ -364,7 +365,7 @@ static void on_new_call(void *arg, int success) { op.op = GRPC_OP_RECV_MESSAGE; op.flags = 0; - op.data.recv_message = &pc->c2p_msg; + op.data.recv_message.recv_message = &pc->c2p_msg; refpc(pc, "on_c2p_recv_msg"); err = grpc_call_start_batch(pc->c2p, &op, 1, new_closure(on_c2p_recv_msg, pc), NULL); @@ -372,7 +373,7 @@ static void on_new_call(void *arg, int success) { op.op = GRPC_OP_RECV_MESSAGE; op.flags = 0; - op.data.recv_message = &pc->p2s_msg; + op.data.recv_message.recv_message = &pc->p2s_msg; refpc(pc, "on_p2s_recv_msg"); err = grpc_call_start_batch(pc->p2s, &op, 1, new_closure(on_p2s_recv_msg, pc), NULL); diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index 200a51858a..690c1a4582 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -933,8 +933,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { ok = false; } else { has_ops |= 1 << GRPC_OP_SEND_MESSAGE; - g_active_call->send_message = op->data.send_message = - read_message(&inp); + g_active_call->send_message = + op->data.send_message.send_message = read_message(&inp); } break; case GRPC_OP_SEND_CLOSE_FROM_CLIENT: @@ -956,13 +956,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { case GRPC_OP_RECV_INITIAL_METADATA: op->op = GRPC_OP_RECV_INITIAL_METADATA; has_ops |= 1 << GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = + op->data.recv_initial_metadata.recv_initial_metadata = &g_active_call->recv_initial_metadata; break; case GRPC_OP_RECV_MESSAGE: op->op = GRPC_OP_RECV_MESSAGE; has_ops |= 1 << GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &g_active_call->recv_message; + op->data.recv_message.recv_message = &g_active_call->recv_message; break; case GRPC_OP_RECV_STATUS_ON_CLIENT: op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; diff --git a/test/core/end2end/fuzzers/client_fuzzer.c b/test/core/end2end/fuzzers/client_fuzzer.c index 26b520885b..ab708bc7d8 100644 --- a/test/core/end2end/fuzzers/client_fuzzer.c +++ b/test/core/end2end/fuzzers/client_fuzzer.c @@ -97,12 +97,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/invalid_call_argument_test.c b/test/core/end2end/invalid_call_argument_test.c index d974d2c8ff..5ce7ca0243 100644 --- a/test/core/end2end/invalid_call_argument_test.c +++ b/test/core/end2end/invalid_call_argument_test.c @@ -237,7 +237,7 @@ static void test_send_null_message() { op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = NULL; + op->data.send_message.send_message = NULL; op->flags = 0; op->reserved = NULL; op++; @@ -263,12 +263,12 @@ static void test_send_messages_at_the_same_time() { op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = tag(2); + op->data.send_message.send_message = tag(2); op->flags = 0; op->reserved = NULL; op++; @@ -306,7 +306,8 @@ static void test_receive_initial_metadata_twice_at_client() { prepare_test(1); op = g_state.ops; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &g_state.initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = + &g_state.initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -317,7 +318,8 @@ static void test_receive_initial_metadata_twice_at_client() { cq_verify(g_state.cqv); op = g_state.ops; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &g_state.initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = + &g_state.initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -335,7 +337,7 @@ static void test_receive_message_with_invalid_flags() { prepare_test(1); op = g_state.ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &payload; + op->data.recv_message.recv_message = &payload; op->flags = 1; op->reserved = NULL; op++; @@ -353,12 +355,12 @@ static void test_receive_two_messages_at_the_same_time() { prepare_test(1); op = g_state.ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &payload; + op->data.recv_message.recv_message = &payload; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &payload; + op->data.recv_message.recv_message = &payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/authority_not_supported.c b/test/core/end2end/tests/authority_not_supported.c index 09defe9c8b..8188da0cb5 100644 --- a/test/core/end2end/tests/authority_not_supported.c +++ b/test/core/end2end/tests/authority_not_supported.c @@ -135,7 +135,7 @@ static void test_with_authority_header(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -144,12 +144,12 @@ static void test_with_authority_header(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/bad_hostname.c b/test/core/end2end/tests/bad_hostname.c index 9c8262737e..dff24fbd02 100644 --- a/test/core/end2end/tests/bad_hostname.c +++ b/test/core/end2end/tests/bad_hostname.c @@ -133,7 +133,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/binary_metadata.c b/test/core/end2end/tests/binary_metadata.c index d1a53d67e0..10f7e6cd53 100644 --- a/test/core/end2end/tests/binary_metadata.c +++ b/test/core/end2end/tests/binary_metadata.c @@ -168,7 +168,7 @@ static void test_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -177,12 +177,12 @@ static void test_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -213,7 +213,7 @@ static void test_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -231,7 +231,7 @@ static void test_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.c index 0bd3d34b3a..63547ce13e 100644 --- a/test/core/end2end/tests/call_creds.c +++ b/test/core/end2end/tests/call_creds.c @@ -203,7 +203,7 @@ static void request_response_with_payload_and_call_creds( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -212,12 +212,12 @@ static void request_response_with_payload_and_call_creds( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -259,7 +259,7 @@ static void request_response_with_payload_and_call_creds( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -277,7 +277,7 @@ static void request_response_with_payload_and_call_creds( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; @@ -435,7 +435,7 @@ static void test_request_with_server_rejecting_client_creds( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -444,12 +444,12 @@ static void test_request_with_server_rejecting_client_creds( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c index 96784bae6c..59be0b7a46 100644 --- a/test/core/end2end/tests/cancel_after_accept.c +++ b/test/core/end2end/tests/cancel_after_accept.c @@ -180,17 +180,17 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -206,7 +206,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -216,7 +216,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/cancel_after_client_done.c b/test/core/end2end/tests/cancel_after_client_done.c index 2ab1412f3a..1680312492 100644 --- a/test/core/end2end/tests/cancel_after_client_done.c +++ b/test/core/end2end/tests/cancel_after_client_done.c @@ -154,7 +154,7 @@ static void test_cancel_after_accept_and_writes_closed( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -163,12 +163,12 @@ static void test_cancel_after_accept_and_writes_closed( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -184,7 +184,7 @@ static void test_cancel_after_accept_and_writes_closed( memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -199,7 +199,7 @@ static void test_cancel_after_accept_and_writes_closed( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c index cad7282f67..0004ea71af 100644 --- a/test/core/end2end/tests/cancel_after_invoke.c +++ b/test/core/end2end/tests/cancel_after_invoke.c @@ -149,7 +149,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -158,12 +158,12 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c index 53ea6fb05a..f1958ff8ee 100644 --- a/test/core/end2end/tests/cancel_before_invoke.c +++ b/test/core/end2end/tests/cancel_before_invoke.c @@ -148,7 +148,7 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -157,12 +157,12 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/cancel_with_status.c b/test/core/end2end/tests/cancel_with_status.c index fa804a22a0..759b74033e 100644 --- a/test/core/end2end/tests/cancel_with_status.c +++ b/test/core/end2end/tests/cancel_with_status.c @@ -133,7 +133,7 @@ static void simple_request_body(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/compressed_payload.c b/test/core/end2end/tests/compressed_payload.c index f20efbc8ec..ecc3a78942 100644 --- a/test/core/end2end/tests/compressed_payload.c +++ b/test/core/end2end/tests/compressed_payload.c @@ -174,7 +174,7 @@ static void request_for_disabled_algorithm( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = send_flags_bitmask; op->reserved = NULL; op++; @@ -183,7 +183,7 @@ static void request_for_disabled_algorithm( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -212,7 +212,7 @@ static void request_for_disabled_algorithm( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -354,7 +354,7 @@ static void request_with_payload_template( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -412,12 +412,12 @@ static void request_with_payload_template( memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = client_send_flags_bitmask; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -427,7 +427,7 @@ static void request_with_payload_template( memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -444,7 +444,7 @@ static void request_with_payload_template( memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/default_host.c b/test/core/end2end/tests/default_host.c index 962e7efe01..3e18209dfb 100644 --- a/test/core/end2end/tests/default_host.c +++ b/test/core/end2end/tests/default_host.c @@ -141,7 +141,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/disappearing_server.c b/test/core/end2end/tests/disappearing_server.c index c746695d3d..7ee147457b 100644 --- a/test/core/end2end/tests/disappearing_server.c +++ b/test/core/end2end/tests/disappearing_server.c @@ -120,7 +120,7 @@ static void do_request_and_shutdown_server(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/filter_call_init_fails.c b/test/core/end2end/tests/filter_call_init_fails.c index 8f5d90cfa6..78975c4d9f 100644 --- a/test/core/end2end/tests/filter_call_init_fails.c +++ b/test/core/end2end/tests/filter_call_init_fails.c @@ -148,7 +148,7 @@ static void test_request(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -157,7 +157,7 @@ static void test_request(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c index b154b595a3..cf9766ca42 100644 --- a/test/core/end2end/tests/filter_causes_close.c +++ b/test/core/end2end/tests/filter_causes_close.c @@ -144,7 +144,7 @@ static void test_request(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -153,7 +153,7 @@ static void test_request(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/filter_latency.c b/test/core/end2end/tests/filter_latency.c index f5f3016669..f2cf0048af 100644 --- a/test/core/end2end/tests/filter_latency.c +++ b/test/core/end2end/tests/filter_latency.c @@ -156,7 +156,7 @@ static void test_request(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -165,7 +165,7 @@ static void test_request(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.c index 263ce4d68e..909d7fa5b5 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.c +++ b/test/core/end2end/tests/graceful_server_shutdown.c @@ -135,7 +135,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/high_initial_seqno.c b/test/core/end2end/tests/high_initial_seqno.c index af423895d2..d4a153e8d2 100644 --- a/test/core/end2end/tests/high_initial_seqno.c +++ b/test/core/end2end/tests/high_initial_seqno.c @@ -140,7 +140,7 @@ static void simple_request_body(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/hpack_size.c b/test/core/end2end/tests/hpack_size.c index d3e7565d1b..d636062b35 100644 --- a/test/core/end2end/tests/hpack_size.c +++ b/test/core/end2end/tests/hpack_size.c @@ -293,7 +293,7 @@ static void simple_request_body(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/idempotent_request.c b/test/core/end2end/tests/idempotent_request.c index bd9e0a9f6d..6826d99046 100644 --- a/test/core/end2end/tests/idempotent_request.c +++ b/test/core/end2end/tests/idempotent_request.c @@ -144,7 +144,7 @@ static void simple_request_body(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c index 6d9946ad57..3045ecff61 100644 --- a/test/core/end2end/tests/invoke_large_request.c +++ b/test/core/end2end/tests/invoke_large_request.c @@ -163,7 +163,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -172,12 +172,12 @@ static void test_invoke_large_request(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -207,7 +207,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -225,7 +225,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.c index 770691cbba..dc0cd4aa1f 100644 --- a/test/core/end2end/tests/large_metadata.c +++ b/test/core/end2end/tests/large_metadata.c @@ -153,7 +153,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -162,7 +162,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -194,7 +194,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.c index f410854206..63fb50e3c3 100644 --- a/test/core/end2end/tests/load_reporting_hook.c +++ b/test/core/end2end/tests/load_reporting_hook.c @@ -171,7 +171,7 @@ static void request_response_with_payload( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -180,12 +180,12 @@ static void request_response_with_payload( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -215,7 +215,7 @@ static void request_response_with_payload( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -233,7 +233,7 @@ static void request_response_with_payload( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c index d5375a62ab..27a96efb41 100644 --- a/test/core/end2end/tests/max_concurrent_streams.c +++ b/test/core/end2end/tests/max_concurrent_streams.c @@ -136,7 +136,7 @@ static void simple_request_body(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -300,7 +300,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv1; + op->data.recv_initial_metadata.recv_initial_metadata = + &initial_metadata_recv1; op->flags = 0; op->reserved = NULL; op++; @@ -332,7 +333,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv1; + op->data.recv_initial_metadata.recv_initial_metadata = + &initial_metadata_recv1; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c index f176104fd3..59aba5b782 100644 --- a/test/core/end2end/tests/max_message_length.c +++ b/test/core/end2end/tests/max_message_length.c @@ -108,9 +108,12 @@ static void end_test(grpc_end2end_test_fixture *f) { // recv limit on server. static void test_max_message_length_on_request(grpc_end2end_test_config config, bool send_limit, - bool use_service_config) { - gpr_log(GPR_INFO, "testing request with send_limit=%d use_service_config=%d", - send_limit, use_service_config); + bool use_service_config, + bool use_string_json_value) { + gpr_log(GPR_INFO, + "testing request with send_limit=%d use_service_config=%d " + "use_string_json_value=%d", + send_limit, use_service_config, use_string_json_value); grpc_end2end_test_fixture f; grpc_call *c = NULL; @@ -142,14 +145,23 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, arg.type = GRPC_ARG_STRING; arg.key = GRPC_ARG_SERVICE_CONFIG; arg.value.string = - "{\n" - " \"methodConfig\": [ {\n" - " \"name\": [\n" - " { \"service\": \"service\", \"method\": \"method\" }\n" - " ],\n" - " \"maxRequestMessageBytes\": \"5\"\n" - " } ]\n" - "}"; + use_string_json_value + ? "{\n" + " \"methodConfig\": [ {\n" + " \"name\": [\n" + " { \"service\": \"service\", \"method\": \"method\" }\n" + " ],\n" + " \"maxRequestMessageBytes\": \"5\"\n" + " } ]\n" + "}" + : "{\n" + " \"methodConfig\": [ {\n" + " \"name\": [\n" + " { \"service\": \"service\", \"method\": \"method\" }\n" + " ],\n" + " \"maxRequestMessageBytes\": 5\n" + " } ]\n" + "}"; client_args = grpc_channel_args_copy_and_add(NULL, &arg, 1); } else { // Set limit via channel args. @@ -196,7 +208,7 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -205,7 +217,7 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -241,7 +253,7 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &recv_payload; + op->data.recv_message.recv_message = &recv_payload; op->flags = 0; op->reserved = NULL; op++; @@ -286,9 +298,12 @@ done: // recv limit on client. static void test_max_message_length_on_response(grpc_end2end_test_config config, bool send_limit, - bool use_service_config) { - gpr_log(GPR_INFO, "testing response with send_limit=%d use_service_config=%d", - send_limit, use_service_config); + bool use_service_config, + bool use_string_json_value) { + gpr_log(GPR_INFO, + "testing response with send_limit=%d use_service_config=%d " + "use_string_json_value=%d", + send_limit, use_service_config, use_string_json_value); grpc_end2end_test_fixture f; grpc_call *c = NULL; @@ -320,14 +335,23 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, arg.type = GRPC_ARG_STRING; arg.key = GRPC_ARG_SERVICE_CONFIG; arg.value.string = - "{\n" - " \"methodConfig\": [ {\n" - " \"name\": [\n" - " { \"service\": \"service\", \"method\": \"method\" }\n" - " ],\n" - " \"maxResponseMessageBytes\": \"5\"\n" - " } ]\n" - "}"; + use_string_json_value + ? "{\n" + " \"methodConfig\": [ {\n" + " \"name\": [\n" + " { \"service\": \"service\", \"method\": \"method\" }\n" + " ],\n" + " \"maxResponseMessageBytes\": \"5\"\n" + " } ]\n" + "}" + : "{\n" + " \"methodConfig\": [ {\n" + " \"name\": [\n" + " { \"service\": \"service\", \"method\": \"method\" }\n" + " ],\n" + " \"maxResponseMessageBytes\": 5\n" + " } ]\n" + "}"; client_args = grpc_channel_args_copy_and_add(NULL, &arg, 1); } else { // Set limit via channel args. @@ -376,12 +400,12 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &recv_payload; + op->data.recv_message.recv_message = &recv_payload; op->flags = 0; op->reserved = NULL; op++; @@ -416,7 +440,7 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; @@ -462,17 +486,29 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, void max_message_length(grpc_end2end_test_config config) { test_max_message_length_on_request(config, false /* send_limit */, - false /* use_service_config */); + false /* use_service_config */, + false /* use_string_json_value */); test_max_message_length_on_request(config, true /* send_limit */, - false /* use_service_config */); + false /* use_service_config */, + false /* use_string_json_value */); test_max_message_length_on_response(config, false /* send_limit */, - false /* use_service_config */); + false /* use_service_config */, + false /* use_string_json_value */); test_max_message_length_on_response(config, true /* send_limit */, - false /* use_service_config */); + false /* use_service_config */, + false /* use_string_json_value */); test_max_message_length_on_request(config, true /* send_limit */, - true /* use_service_config */); + true /* use_service_config */, + false /* use_string_json_value */); + test_max_message_length_on_request(config, true /* send_limit */, + true /* use_service_config */, + true /* use_string_json_value */); + test_max_message_length_on_response(config, false /* send_limit */, + true /* use_service_config */, + false /* use_string_json_value */); test_max_message_length_on_response(config, false /* send_limit */, - true /* use_service_config */); + true /* use_service_config */, + true /* use_string_json_value */); } void max_message_length_pre_init(void) {} diff --git a/test/core/end2end/tests/negative_deadline.c b/test/core/end2end/tests/negative_deadline.c index 5a22d626a0..a94b0f8e6e 100644 --- a/test/core/end2end/tests/negative_deadline.c +++ b/test/core/end2end/tests/negative_deadline.c @@ -133,7 +133,7 @@ static void simple_request_body(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/network_status_change.c b/test/core/end2end/tests/network_status_change.c index bd5bae5be7..4bcc3a24f9 100644 --- a/test/core/end2end/tests/network_status_change.c +++ b/test/core/end2end/tests/network_status_change.c @@ -142,7 +142,7 @@ static void test_invoke_network_status_change(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -151,7 +151,7 @@ static void test_invoke_network_status_change(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -179,7 +179,7 @@ static void test_invoke_network_status_change(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/no_logging.c b/test/core/end2end/tests/no_logging.c index aadfbc1e94..850e333719 100644 --- a/test/core/end2end/tests/no_logging.c +++ b/test/core/end2end/tests/no_logging.c @@ -171,7 +171,7 @@ static void simple_request_body(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/payload.c b/test/core/end2end/tests/payload.c index 21a9ddaaa4..4f5c3c6858 100644 --- a/test/core/end2end/tests/payload.c +++ b/test/core/end2end/tests/payload.c @@ -161,7 +161,7 @@ static void request_response_with_payload(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -170,12 +170,12 @@ static void request_response_with_payload(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -205,7 +205,7 @@ static void request_response_with_payload(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -223,7 +223,7 @@ static void request_response_with_payload(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c index a5fa31081c..65e43a6c9a 100644 --- a/test/core/end2end/tests/ping_pong_streaming.c +++ b/test/core/end2end/tests/ping_pong_streaming.c @@ -144,7 +144,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -188,12 +188,12 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -203,7 +203,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -215,7 +215,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/registered_call.c b/test/core/end2end/tests/registered_call.c index c30c9a3a7d..56305767d8 100644 --- a/test/core/end2end/tests/registered_call.c +++ b/test/core/end2end/tests/registered_call.c @@ -136,7 +136,7 @@ static void simple_request_body(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.c index 94e13f5faa..d821bae751 100644 --- a/test/core/end2end/tests/request_with_flags.c +++ b/test/core/end2end/tests/request_with_flags.c @@ -140,7 +140,7 @@ static void test_invoke_request_with_flags( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = flags_for_op[op->op]; op->reserved = NULL; op++; @@ -149,7 +149,7 @@ static void test_invoke_request_with_flags( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = flags_for_op[op->op]; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c index 667e4b9de6..b622fc9b60 100644 --- a/test/core/end2end/tests/request_with_payload.c +++ b/test/core/end2end/tests/request_with_payload.c @@ -139,7 +139,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -148,7 +148,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -177,7 +177,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.c index 7da5efe286..559281c77a 100644 --- a/test/core/end2end/tests/resource_quota_server.c +++ b/test/core/end2end/tests/resource_quota_server.c @@ -201,7 +201,7 @@ void resource_quota_server(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -210,7 +210,8 @@ void resource_quota_server(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv[i]; + op->data.recv_initial_metadata.recv_initial_metadata = + &initial_metadata_recv[i]; op->flags = 0; op->reserved = NULL; op++; @@ -277,7 +278,7 @@ void resource_quota_server(grpc_end2end_test_config config) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv[call_id]; + op->data.recv_message.recv_message = &request_payload_recv[call_id]; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/server_finishes_request.c b/test/core/end2end/tests/server_finishes_request.c index c4a9657ba3..e1f0878e8f 100644 --- a/test/core/end2end/tests/server_finishes_request.c +++ b/test/core/end2end/tests/server_finishes_request.c @@ -134,7 +134,7 @@ static void simple_request_body(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/shutdown_finishes_calls.c b/test/core/end2end/tests/shutdown_finishes_calls.c index 812d43e908..81e9acb3ba 100644 --- a/test/core/end2end/tests/shutdown_finishes_calls.c +++ b/test/core/end2end/tests/shutdown_finishes_calls.c @@ -128,7 +128,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/simple_cacheable_request.c b/test/core/end2end/tests/simple_cacheable_request.c index d48b09c19d..9779d49017 100644 --- a/test/core/end2end/tests/simple_cacheable_request.c +++ b/test/core/end2end/tests/simple_cacheable_request.c @@ -155,7 +155,7 @@ static void test_cacheable_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -164,12 +164,12 @@ static void test_cacheable_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -200,7 +200,7 @@ static void test_cacheable_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -218,7 +218,7 @@ static void test_cacheable_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.c index 413f256e37..df800e5948 100644 --- a/test/core/end2end/tests/simple_delayed_request.c +++ b/test/core/end2end/tests/simple_delayed_request.c @@ -129,7 +129,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/simple_metadata.c b/test/core/end2end/tests/simple_metadata.c index 1451c381f7..ed3e5d0440 100644 --- a/test/core/end2end/tests/simple_metadata.c +++ b/test/core/end2end/tests/simple_metadata.c @@ -152,7 +152,7 @@ static void test_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -161,12 +161,12 @@ static void test_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -197,7 +197,7 @@ static void test_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -215,7 +215,7 @@ static void test_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/simple_request.c b/test/core/end2end/tests/simple_request.c index 7ba01c201e..45b2036d32 100644 --- a/test/core/end2end/tests/simple_request.c +++ b/test/core/end2end/tests/simple_request.c @@ -144,7 +144,7 @@ static void simple_request_body(grpc_end2end_test_config config, op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/streaming_error_response.c b/test/core/end2end/tests/streaming_error_response.c index 3a7704ef12..3cfc18f33b 100644 --- a/test/core/end2end/tests/streaming_error_response.c +++ b/test/core/end2end/tests/streaming_error_response.c @@ -144,10 +144,10 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload1_recv; + op->data.recv_message.recv_message = &response_payload1_recv; op++; if (request_status_early) { op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; @@ -172,7 +172,7 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { op->data.send_initial_metadata.count = 0; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload1; + op->data.send_message.send_message = response_payload1; op++; error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL); GPR_ASSERT(GRPC_CALL_OK == error); @@ -183,7 +183,7 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload2; + op->data.send_message.send_message = response_payload2; op++; error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL); GPR_ASSERT(GRPC_CALL_OK == error); @@ -211,7 +211,7 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload2_recv; + op->data.recv_message.recv_message = &response_payload2_recv; op++; error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL); GPR_ASSERT(GRPC_CALL_OK == error); diff --git a/test/core/end2end/tests/trailing_metadata.c b/test/core/end2end/tests/trailing_metadata.c index 8346cc13dd..7ec96f7f44 100644 --- a/test/core/end2end/tests/trailing_metadata.c +++ b/test/core/end2end/tests/trailing_metadata.c @@ -155,7 +155,7 @@ static void test_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; @@ -164,12 +164,12 @@ static void test_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -200,7 +200,7 @@ static void test_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -218,7 +218,7 @@ static void test_request_response_with_metadata_and_payload( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/core/end2end/tests/write_buffering.c b/test/core/end2end/tests/write_buffering.c index d832991ec6..71c4db67ce 100644 --- a/test/core/end2end/tests/write_buffering.c +++ b/test/core/end2end/tests/write_buffering.c @@ -146,7 +146,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -163,7 +163,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload1; + op->data.send_message.send_message = request_payload1; op->flags = GRPC_WRITE_BUFFER_HINT; op++; error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL); @@ -181,7 +181,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv1; + op->data.recv_message.recv_message = &request_payload_recv1; op++; error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL); GPR_ASSERT(GRPC_CALL_OK == error); @@ -195,7 +195,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload2; + op->data.send_message.send_message = request_payload2; op->flags = 0; op++; error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL); @@ -210,7 +210,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv2; + op->data.recv_message.recv_message = &request_payload_recv2; op++; error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL); GPR_ASSERT(GRPC_CALL_OK == error); diff --git a/test/core/end2end/tests/write_buffering_at_end.c b/test/core/end2end/tests/write_buffering_at_end.c index 60f8da52c6..8d71d02d0a 100644 --- a/test/core/end2end/tests/write_buffering_at_end.c +++ b/test/core/end2end/tests/write_buffering_at_end.c @@ -143,7 +143,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -160,7 +160,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = GRPC_WRITE_BUFFER_HINT; op++; error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL); @@ -178,7 +178,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv1; + op->data.recv_message.recv_message = &request_payload_recv1; op++; error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL); GPR_ASSERT(GRPC_CALL_OK == error); @@ -205,7 +205,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv2; + op->data.recv_message.recv_message = &request_payload_recv2; op++; error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL); GPR_ASSERT(GRPC_CALL_OK == error); diff --git a/test/core/fling/client.c b/test/core/fling/client.c index e717b7f7fe..e1a4630094 100644 --- a/test/core/fling/client.c +++ b/test/core/fling/client.c @@ -72,15 +72,15 @@ static void init_ping_pong_request(void) { op->data.send_initial_metadata.count = 0; op++; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = the_buffer; + op->data.send_message.send_message = the_buffer; op++; op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op++; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; @@ -115,7 +115,8 @@ static void init_ping_pong_stream(void) { stream_init_ops[0].op = GRPC_OP_SEND_INITIAL_METADATA; stream_init_ops[0].data.send_initial_metadata.count = 0; stream_init_ops[1].op = GRPC_OP_RECV_INITIAL_METADATA; - stream_init_ops[1].data.recv_initial_metadata = &initial_metadata_recv; + stream_init_ops[1].data.recv_initial_metadata.recv_initial_metadata = + &initial_metadata_recv; error = grpc_call_start_batch(call, stream_init_ops, 2, (void *)1, NULL); GPR_ASSERT(GRPC_CALL_OK == error); grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); @@ -123,9 +124,9 @@ static void init_ping_pong_stream(void) { grpc_metadata_array_init(&initial_metadata_recv); stream_step_ops[0].op = GRPC_OP_SEND_MESSAGE; - stream_step_ops[0].data.send_message = the_buffer; + stream_step_ops[0].data.send_message.send_message = the_buffer; stream_step_ops[1].op = GRPC_OP_RECV_MESSAGE; - stream_step_ops[1].data.recv_message = &response_payload_recv; + stream_step_ops[1].data.recv_message.recv_message = &response_payload_recv; } static void step_ping_pong_stream(void) { diff --git a/test/core/fling/server.c b/test/core/fling/server.c index fd446f1128..79e5e35211 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.c @@ -107,13 +107,13 @@ static void handle_unary_method(void) { op->data.send_initial_metadata.count = 0; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &terminal_buffer; + op->data.recv_message.recv_message = &terminal_buffer; op++; op->op = GRPC_OP_SEND_MESSAGE; if (payload_buffer == NULL) { gpr_log(GPR_INFO, "NULL payload buffer !!!"); } - op->data.send_message = payload_buffer; + op->data.send_message.send_message = payload_buffer; op++; op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; op->data.send_status_from_server.status = GRPC_STATUS_OK; @@ -144,7 +144,7 @@ static void start_read_op(int t) { grpc_call_error error; /* Starting read at server */ read_op.op = GRPC_OP_RECV_MESSAGE; - read_op.data.recv_message = &payload_buffer; + read_op.data.recv_message.recv_message = &payload_buffer; error = grpc_call_start_batch(call, &read_op, 1, tag(t), NULL); GPR_ASSERT(GRPC_CALL_OK == error); } @@ -157,7 +157,7 @@ static void start_write_op(void) { if (payload_buffer == NULL) { gpr_log(GPR_INFO, "NULL payload buffer !!!"); } - write_op.data.send_message = payload_buffer; + write_op.data.send_message.send_message = payload_buffer; error = grpc_call_start_batch(call, &write_op, 1, tagarg, NULL); GPR_ASSERT(GRPC_CALL_OK == error); } diff --git a/test/core/memory_usage/client.c b/test/core/memory_usage/client.c index f4432bf572..827a39540d 100644 --- a/test/core/memory_usage/client.c +++ b/test/core/memory_usage/client.c @@ -82,7 +82,8 @@ static void init_ping_pong_request(int call_idx) { op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &calls[call_idx].initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = + &calls[call_idx].initial_metadata_recv; op++; calls[call_idx].call = grpc_channel_create_call( @@ -139,10 +140,11 @@ static struct grpc_memory_counters send_snapshot_request( op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &calls[call_idx].initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = + &calls[call_idx].initial_metadata_recv; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op++; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = diff --git a/test/core/memory_usage/server.c b/test/core/memory_usage/server.c index c0710930b0..cd7f2aabdd 100644 --- a/test/core/memory_usage/server.c +++ b/test/core/memory_usage/server.c @@ -129,13 +129,13 @@ static void send_snapshot(void *tag, struct grpc_memory_counters *snapshot) { op->data.send_initial_metadata.count = 0; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &terminal_buffer; + op->data.recv_message.recv_message = &terminal_buffer; op++; op->op = GRPC_OP_SEND_MESSAGE; if (payload_buffer == NULL) { gpr_log(GPR_INFO, "NULL payload buffer !!!"); } - op->data.send_message = payload_buffer; + op->data.send_message.send_message = payload_buffer; op++; op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; op->data.send_status_from_server.status = GRPC_STATUS_OK; diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c index b6db6a6b08..b78361aacb 100644 --- a/test/core/surface/lame_client_test.c +++ b/test/core/surface/lame_client_test.c @@ -125,7 +125,7 @@ int main(int argc, char **argv) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 1a1a94e87c..edd56cef88 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -891,6 +891,8 @@ TEST_P(End2endTest, RpcMaxMessageSize) { EchoRequest request; EchoResponse response; request.set_message(string(kMaxMessageSize_ * 2, 'a')); + // cancelled is not guaranteed to appear before the end of the service handler + request.mutable_param()->set_skip_cancelled_check(true); ClientContext context; Status s = stub_->Echo(&context, request, &response); diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc index de304b9f89..3637190b6d 100644 --- a/test/cpp/grpclb/grpclb_test.cc +++ b/test/cpp/grpclb/grpclb_test.cc @@ -213,7 +213,7 @@ static void start_lb_server(server_fixture *sf, int *ports, size_t nports, // receive request for backends op = ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -268,7 +268,7 @@ static void start_lb_server(server_fixture *sf, int *ports, size_t nports, response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); op = ops; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; @@ -372,7 +372,7 @@ static void start_backend_server(server_fixture *sf) { while (!exit) { op = ops; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->data.recv_message.recv_message = &request_payload_recv; op->flags = 0; op->reserved = NULL; op++; @@ -401,7 +401,7 @@ static void start_backend_server(server_fixture *sf) { grpc_raw_byte_buffer_create(&response_payload_slice, 1); op = ops; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; + op->data.send_message.send_message = response_payload; op->flags = 0; op->reserved = NULL; op++; @@ -489,7 +489,7 @@ static void perform_request(client_fixture *cf) { op->reserved = NULL; op++; op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; op->flags = 0; op->reserved = NULL; op++; @@ -509,12 +509,12 @@ static void perform_request(client_fixture *cf) { op = ops; op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; + op->data.send_message.send_message = request_payload; op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; + op->data.recv_message.recv_message = &response_payload_recv; op->flags = 0; op->reserved = NULL; op++; |