aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/impl
diff options
context:
space:
mode:
Diffstat (limited to 'include/grpc++/impl')
-rw-r--r--include/grpc++/impl/codegen/call.h15
-rw-r--r--include/grpc++/impl/codegen/server_context.h12
-rw-r--r--include/grpc++/impl/codegen/sync_stream.h8
3 files changed, 26 insertions, 9 deletions
diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h
index a17cdf9236..19a5ca2b2e 100644
--- a/include/grpc++/impl/codegen/call.h
+++ b/include/grpc++/impl/codegen/call.h
@@ -618,7 +618,17 @@ 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) {}
+ : 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) {}
void PerformOps(CallOpSetInterface* ops) {
call_hook_->PerformOpsOnCall(ops, this);
@@ -627,10 +637,13 @@ class Call final {
grpc_call* call() const { return call_; }
CompletionQueue* cq() const { return cq_; }
+ int max_receive_message_size() const { 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/server_context.h b/include/grpc++/impl/codegen/server_context.h
index 8c7fe0809e..bf9a9b6f1a 100644
--- a/include/grpc++/impl/codegen/server_context.h
+++ b/include/grpc++/impl/codegen/server_context.h
@@ -36,6 +36,10 @@
#include <map>
#include <memory>
+#include <vector>
+
+#include <grpc/impl/codegen/compression_types.h>
+#include <grpc/load_reporting.h>
#include <grpc++/impl/codegen/config.h>
#include <grpc++/impl/codegen/create_auth_context.h>
@@ -43,14 +47,12 @@
#include <grpc++/impl/codegen/security/auth_context.h>
#include <grpc++/impl/codegen/string_ref.h>
#include <grpc++/impl/codegen/time.h>
-#include <grpc/impl/codegen/compression_types.h>
struct grpc_metadata;
struct grpc_call;
struct census_context;
namespace grpc {
-
class ClientContext;
template <class W, class R>
class ServerAsyncReader;
@@ -143,6 +145,9 @@ class ServerContext {
}
void set_compression_algorithm(grpc_compression_algorithm algorithm);
+ // Set the load reporting costs in \a cost_data for the call.
+ void SetLoadReportingCosts(const std::vector<grpc::string>& cost_data);
+
std::shared_ptr<const AuthContext> auth_context() const {
if (auth_context_.get() == nullptr) {
auth_context_ = CreateAuthContext(call_);
@@ -208,8 +213,7 @@ class ServerContext {
void BeginCompletionOp(Call* call);
- ServerContext(gpr_timespec deadline, grpc_metadata* metadata,
- size_t metadata_count);
+ ServerContext(gpr_timespec deadline, grpc_metadata_array* arr);
void set_call(grpc_call* call) { call_ = call; }
diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h
index 1f7708bab9..4d9b074e95 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 = INT_MAX;
+ *sz = call_.max_receive_message_size();
return true;
}
@@ -310,7 +310,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
}
bool NextMessageSize(uint32_t* sz) override {
- *sz = INT_MAX;
+ *sz = call_.max_receive_message_size();
return true;
}
@@ -382,7 +382,7 @@ class ServerReader final : public ServerReaderInterface<R> {
}
bool NextMessageSize(uint32_t* sz) override {
- *sz = INT_MAX;
+ *sz = call_->max_receive_message_size();
return true;
}
@@ -474,7 +474,7 @@ class ServerReaderWriterBody final {
}
bool NextMessageSize(uint32_t* sz) {
- *sz = INT_MAX;
+ *sz = call_->max_receive_message_size();
return true;
}