diff options
Diffstat (limited to 'include/grpc++/impl/codegen')
-rw-r--r-- | include/grpc++/impl/codegen/fc_unary.h | 5 | ||||
-rw-r--r-- | include/grpc++/impl/codegen/sync_stream.h | 22 |
2 files changed, 21 insertions, 6 deletions
diff --git a/include/grpc++/impl/codegen/fc_unary.h b/include/grpc++/impl/codegen/fc_unary.h index 22e40ab02e..768443912b 100644 --- a/include/grpc++/impl/codegen/fc_unary.h +++ b/include/grpc++/impl/codegen/fc_unary.h @@ -56,7 +56,10 @@ template <class RequestType, class ResponseType> public: FCUnary(Call* call, ServerContext* ctx): call_(call), ctx_(ctx), read_done_(false), write_done_(false) {} ~FCUnary() {} - uint32_t NextMessageSize() {return call_->max_message_size();} + bool NextMessageSize(uint32_t *sz) { + *sz = call_->max_message_size(); + return true; + } bool Read(RequestType *request) { if (read_done_) { return false; diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h index 0afa8b6aa4..930c72056c 100644 --- a/include/grpc++/impl/codegen/sync_stream.h +++ b/include/grpc++/impl/codegen/sync_stream.h @@ -71,7 +71,7 @@ class ReaderInterface { virtual ~ReaderInterface() {} /// Upper bound on the next message size available for reading on this stream - virtual uint32_t NextMessageSize() = 0; + virtual bool NextMessageSize(uint32_t *sz) = 0; /// Blocking read a message and parse to \a msg. Returns \a true on success. /// This is thread-safe with respect to \a Write or \WritesDone methods on @@ -151,7 +151,10 @@ class ClientReader GRPC_FINAL : public ClientReaderInterface<R> { cq_.Pluck(&ops); /// status ignored } - uint32_t NextMessageSize() GRPC_OVERRIDE {return call_.max_message_size();} + bool NextMessageSize(uint32_t *sz) GRPC_OVERRIDE { + *sz = call_.max_message_size(); + return true; + } bool Read(R* msg) GRPC_OVERRIDE { CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> ops; @@ -298,7 +301,10 @@ class ClientReaderWriter GRPC_FINAL : public ClientReaderWriterInterface<W, R> { cq_.Pluck(&ops); // status ignored } - uint32_t NextMessageSize() GRPC_OVERRIDE {return call_.max_message_size();} + bool NextMessageSize(uint32_t *sz) GRPC_OVERRIDE { + *sz = call_.max_message_size(); + return true; + } bool Read(R* msg) GRPC_OVERRIDE { CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> ops; @@ -359,7 +365,10 @@ class ServerReader GRPC_FINAL : public ReaderInterface<R> { call_->cq()->Pluck(&ops); } - uint32_t NextMessageSize() GRPC_OVERRIDE {return call_->max_message_size();} + bool NextMessageSize(uint32_t *sz) GRPC_OVERRIDE { + *sz = call_->max_message_size(); + return true; + } bool Read(R* msg) GRPC_OVERRIDE { CallOpSet<CallOpRecvMessage<R>> ops; @@ -427,7 +436,10 @@ class ServerReaderWriter GRPC_FINAL : public WriterInterface<W>, call_->cq()->Pluck(&ops); } - uint32_t NextMessageSize() GRPC_OVERRIDE {return call_->max_message_size();} + bool NextMessageSize(uint32_t *sz) GRPC_OVERRIDE { + *sz = call_->max_message_size(); + return true; + } bool Read(R* msg) GRPC_OVERRIDE { CallOpSet<CallOpRecvMessage<R>> ops; |