|
|
@ -198,7 +198,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { |
|
|
|
public: |
|
|
|
public: |
|
|
|
// always allocated against a call arena, no memory free required
|
|
|
|
// always allocated against a call arena, no memory free required
|
|
|
|
static void operator delete(void* /*ptr*/, std::size_t size) { |
|
|
|
static void operator delete(void* /*ptr*/, std::size_t size) { |
|
|
|
assert(size == sizeof(ClientAsyncReader)); |
|
|
|
GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// This operator should never be called as the memory should be freed as part
|
|
|
|
// This operator should never be called as the memory should be freed as part
|
|
|
@ -206,10 +206,10 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { |
|
|
|
// delete to the operator new so that some compilers will not complain (see
|
|
|
|
// delete to the operator new so that some compilers will not complain (see
|
|
|
|
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
|
|
|
|
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
|
|
|
|
// there are no tests catching the compiler warning.
|
|
|
|
// there are no tests catching the compiler warning.
|
|
|
|
static void operator delete(void*, void*) { assert(0); } |
|
|
|
static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } |
|
|
|
|
|
|
|
|
|
|
|
void StartCall(void* tag) override { |
|
|
|
void StartCall(void* tag) override { |
|
|
|
assert(!started_); |
|
|
|
GPR_CODEGEN_ASSERT(!started_); |
|
|
|
started_ = true; |
|
|
|
started_ = true; |
|
|
|
StartCallInternal(tag); |
|
|
|
StartCallInternal(tag); |
|
|
|
} |
|
|
|
} |
|
|
@ -223,7 +223,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { |
|
|
|
/// calling code can access the received metadata through the
|
|
|
|
/// calling code can access the received metadata through the
|
|
|
|
/// \a ClientContext.
|
|
|
|
/// \a ClientContext.
|
|
|
|
void ReadInitialMetadata(void* tag) override { |
|
|
|
void ReadInitialMetadata(void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); |
|
|
|
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); |
|
|
|
|
|
|
|
|
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
@ -232,7 +232,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Read(R* msg, void* tag) override { |
|
|
|
void Read(R* msg, void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
read_ops_.set_output_tag(tag); |
|
|
|
read_ops_.set_output_tag(tag); |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
read_ops_.RecvInitialMetadata(context_); |
|
|
|
read_ops_.RecvInitialMetadata(context_); |
|
|
@ -247,7 +247,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { |
|
|
|
/// - the \a ClientContext associated with this call is updated with
|
|
|
|
/// - the \a ClientContext associated with this call is updated with
|
|
|
|
/// possible initial and trailing metadata received from the server.
|
|
|
|
/// possible initial and trailing metadata received from the server.
|
|
|
|
void Finish(::grpc::Status* status, void* tag) override { |
|
|
|
void Finish(::grpc::Status* status, void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
finish_ops_.RecvInitialMetadata(context_); |
|
|
|
finish_ops_.RecvInitialMetadata(context_); |
|
|
@ -269,7 +269,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { |
|
|
|
if (start) { |
|
|
|
if (start) { |
|
|
|
StartCallInternal(tag); |
|
|
|
StartCallInternal(tag); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
assert(tag == nullptr); |
|
|
|
GPR_CODEGEN_ASSERT(tag == nullptr); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -347,7 +347,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
public: |
|
|
|
public: |
|
|
|
// always allocated against a call arena, no memory free required
|
|
|
|
// always allocated against a call arena, no memory free required
|
|
|
|
static void operator delete(void* /*ptr*/, std::size_t size) { |
|
|
|
static void operator delete(void* /*ptr*/, std::size_t size) { |
|
|
|
assert(size == sizeof(ClientAsyncWriter)); |
|
|
|
GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// This operator should never be called as the memory should be freed as part
|
|
|
|
// This operator should never be called as the memory should be freed as part
|
|
|
@ -355,10 +355,10 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
// delete to the operator new so that some compilers will not complain (see
|
|
|
|
// delete to the operator new so that some compilers will not complain (see
|
|
|
|
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
|
|
|
|
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
|
|
|
|
// there are no tests catching the compiler warning.
|
|
|
|
// there are no tests catching the compiler warning.
|
|
|
|
static void operator delete(void*, void*) { assert(0); } |
|
|
|
static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } |
|
|
|
|
|
|
|
|
|
|
|
void StartCall(void* tag) override { |
|
|
|
void StartCall(void* tag) override { |
|
|
|
assert(!started_); |
|
|
|
GPR_CODEGEN_ASSERT(!started_); |
|
|
|
started_ = true; |
|
|
|
started_ = true; |
|
|
|
StartCallInternal(tag); |
|
|
|
StartCallInternal(tag); |
|
|
|
} |
|
|
|
} |
|
|
@ -371,7 +371,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
/// associated with this call is updated, and the calling code can access
|
|
|
|
/// associated with this call is updated, and the calling code can access
|
|
|
|
/// the received metadata through the \a ClientContext.
|
|
|
|
/// the received metadata through the \a ClientContext.
|
|
|
|
void ReadInitialMetadata(void* tag) override { |
|
|
|
void ReadInitialMetadata(void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); |
|
|
|
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); |
|
|
|
|
|
|
|
|
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
@ -380,7 +380,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Write(const W& msg, void* tag) override { |
|
|
|
void Write(const W& msg, void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); |
|
|
|
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); |
|
|
@ -388,7 +388,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override { |
|
|
|
void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
if (options.is_last_message()) { |
|
|
|
if (options.is_last_message()) { |
|
|
|
options.set_buffer_hint(); |
|
|
|
options.set_buffer_hint(); |
|
|
@ -400,7 +400,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WritesDone(void* tag) override { |
|
|
|
void WritesDone(void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.ClientSendClose(); |
|
|
|
write_ops_.ClientSendClose(); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
@ -414,7 +414,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
/// - attempts to fill in the \a response parameter passed to this class's
|
|
|
|
/// - attempts to fill in the \a response parameter passed to this class's
|
|
|
|
/// constructor with the server's response message.
|
|
|
|
/// constructor with the server's response message.
|
|
|
|
void Finish(::grpc::Status* status, void* tag) override { |
|
|
|
void Finish(::grpc::Status* status, void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
finish_ops_.RecvInitialMetadata(context_); |
|
|
|
finish_ops_.RecvInitialMetadata(context_); |
|
|
@ -435,7 +435,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
if (start) { |
|
|
|
if (start) { |
|
|
|
StartCallInternal(tag); |
|
|
|
StartCallInternal(tag); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
assert(tag == nullptr); |
|
|
|
GPR_CODEGEN_ASSERT(tag == nullptr); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -515,7 +515,7 @@ class ClientAsyncReaderWriter final |
|
|
|
public: |
|
|
|
public: |
|
|
|
// always allocated against a call arena, no memory free required
|
|
|
|
// always allocated against a call arena, no memory free required
|
|
|
|
static void operator delete(void* /*ptr*/, std::size_t size) { |
|
|
|
static void operator delete(void* /*ptr*/, std::size_t size) { |
|
|
|
assert(size == sizeof(ClientAsyncReaderWriter)); |
|
|
|
GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// This operator should never be called as the memory should be freed as part
|
|
|
|
// This operator should never be called as the memory should be freed as part
|
|
|
@ -523,10 +523,10 @@ class ClientAsyncReaderWriter final |
|
|
|
// delete to the operator new so that some compilers will not complain (see
|
|
|
|
// delete to the operator new so that some compilers will not complain (see
|
|
|
|
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
|
|
|
|
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
|
|
|
|
// there are no tests catching the compiler warning.
|
|
|
|
// there are no tests catching the compiler warning.
|
|
|
|
static void operator delete(void*, void*) { assert(0); } |
|
|
|
static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } |
|
|
|
|
|
|
|
|
|
|
|
void StartCall(void* tag) override { |
|
|
|
void StartCall(void* tag) override { |
|
|
|
assert(!started_); |
|
|
|
GPR_CODEGEN_ASSERT(!started_); |
|
|
|
started_ = true; |
|
|
|
started_ = true; |
|
|
|
StartCallInternal(tag); |
|
|
|
StartCallInternal(tag); |
|
|
|
} |
|
|
|
} |
|
|
@ -539,7 +539,7 @@ class ClientAsyncReaderWriter final |
|
|
|
/// is updated with it, and then the receiving initial metadata can
|
|
|
|
/// is updated with it, and then the receiving initial metadata can
|
|
|
|
/// be accessed through this \a ClientContext.
|
|
|
|
/// be accessed through this \a ClientContext.
|
|
|
|
void ReadInitialMetadata(void* tag) override { |
|
|
|
void ReadInitialMetadata(void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); |
|
|
|
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); |
|
|
|
|
|
|
|
|
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
@ -548,7 +548,7 @@ class ClientAsyncReaderWriter final |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Read(R* msg, void* tag) override { |
|
|
|
void Read(R* msg, void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
read_ops_.set_output_tag(tag); |
|
|
|
read_ops_.set_output_tag(tag); |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
read_ops_.RecvInitialMetadata(context_); |
|
|
|
read_ops_.RecvInitialMetadata(context_); |
|
|
@ -558,7 +558,7 @@ class ClientAsyncReaderWriter final |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Write(const W& msg, void* tag) override { |
|
|
|
void Write(const W& msg, void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); |
|
|
|
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); |
|
|
@ -566,7 +566,7 @@ class ClientAsyncReaderWriter final |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override { |
|
|
|
void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
if (options.is_last_message()) { |
|
|
|
if (options.is_last_message()) { |
|
|
|
options.set_buffer_hint(); |
|
|
|
options.set_buffer_hint(); |
|
|
@ -578,7 +578,7 @@ class ClientAsyncReaderWriter final |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WritesDone(void* tag) override { |
|
|
|
void WritesDone(void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.ClientSendClose(); |
|
|
|
write_ops_.ClientSendClose(); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
@ -589,7 +589,7 @@ class ClientAsyncReaderWriter final |
|
|
|
/// - the \a ClientContext associated with this call is updated with
|
|
|
|
/// - the \a ClientContext associated with this call is updated with
|
|
|
|
/// possible initial and trailing metadata sent from the server.
|
|
|
|
/// possible initial and trailing metadata sent from the server.
|
|
|
|
void Finish(::grpc::Status* status, void* tag) override { |
|
|
|
void Finish(::grpc::Status* status, void* tag) override { |
|
|
|
assert(started_); |
|
|
|
GPR_CODEGEN_ASSERT(started_); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
finish_ops_.RecvInitialMetadata(context_); |
|
|
|
finish_ops_.RecvInitialMetadata(context_); |
|
|
@ -607,7 +607,7 @@ class ClientAsyncReaderWriter final |
|
|
|
if (start) { |
|
|
|
if (start) { |
|
|
|
StartCallInternal(tag); |
|
|
|
StartCallInternal(tag); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
assert(tag == nullptr); |
|
|
|
GPR_CODEGEN_ASSERT(tag == nullptr); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|