aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Muxi Yan <muxi@users.noreply.github.com>2018-10-25 15:43:09 -0700
committerGravatar GitHub <noreply@github.com>2018-10-25 15:43:09 -0700
commitc88e509ba6510c3bc24de55662e5ee0cba718f98 (patch)
tree44a60388b8cfcab3ab46d890ee1b90625ac6e1fd /include
parenta8a7c2bdd10eb7dc9e072327da2ddb70e5785cf7 (diff)
parent08ef3bca1a10cb3ee46aa2037fe412c75407a067 (diff)
Merge branch 'master' into config-isolation
Diffstat (limited to 'include')
-rw-r--r--include/grpc/grpc.h5
-rw-r--r--include/grpc/impl/codegen/grpc_types.h3
-rw-r--r--include/grpcpp/impl/codegen/call.h13
-rw-r--r--include/grpcpp/impl/codegen/callback_common.h8
-rw-r--r--include/grpcpp/impl/codegen/completion_queue.h1
-rw-r--r--include/grpcpp/impl/codegen/config_protobuf.h12
6 files changed, 37 insertions, 5 deletions
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index 02ab6e8ba4..514d9ddc4b 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -248,10 +248,13 @@ GRPCAPI void* grpc_call_arena_alloc(grpc_call* call, size_t size);
appropriate to call grpc_completion_queue_next or
grpc_completion_queue_pluck consequent to the failed grpc_call_start_batch
call.
+ If a call to grpc_call_start_batch with an empty batch returns
+ GRPC_CALL_OK, the tag is put in the completion queue immediately.
THREAD SAFETY: access to grpc_call_start_batch in multi-threaded environment
needs to be synchronized. As an optimization, you may synchronize batches
containing just send operations independently from batches containing just
- receive operations. */
+ receive operations. Access to grpc_call_start_batch with an empty batch is
+ thread-compatible. */
GRPCAPI grpc_call_error grpc_call_start_batch(grpc_call* call,
const grpc_op* ops, size_t nops,
void* tag, void* reserved);
diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h
index 4cf13edca9..402e490e34 100644
--- a/include/grpc/impl/codegen/grpc_types.h
+++ b/include/grpc/impl/codegen/grpc_types.h
@@ -347,6 +347,9 @@ typedef struct {
/** If set to non zero, surfaces the user agent string to the server. User
agent is surfaced by default. */
#define GRPC_ARG_SURFACE_USER_AGENT "grpc.surface_user_agent"
+/** If set, inhibits health checking (which may be enabled via the
+ * service config.) */
+#define GRPC_ARG_INHIBIT_HEALTH_CHECKING "grpc.inhibit_health_checking"
/** gRPC Objective-C channel pooling domain string. */
#define GRPC_ARG_CHANNEL_POOL_DOMAIN "grpc.channel_pooling_domain"
/** gRPC Objective-C channel pooling id. */
diff --git a/include/grpcpp/impl/codegen/call.h b/include/grpcpp/impl/codegen/call.h
index 7cadea0055..789ea805a3 100644
--- a/include/grpcpp/impl/codegen/call.h
+++ b/include/grpcpp/impl/codegen/call.h
@@ -624,6 +624,19 @@ class CallOpSet : public CallOpSetInterface,
public Op6 {
public:
CallOpSet() : cq_tag_(this), return_tag_(this), call_(nullptr) {}
+
+ // The copy constructor and assignment operator reset the value of
+ // cq_tag_ and return_tag_ since those are only meaningful on a specific
+ // object, not across objects.
+ CallOpSet(const CallOpSet& other)
+ : cq_tag_(this), return_tag_(this), call_(other.call_) {}
+ CallOpSet& operator=(const CallOpSet& other) {
+ cq_tag_ = this;
+ return_tag_ = this;
+ call_ = other.call_;
+ return *this;
+ }
+
void FillOps(grpc_call* call, grpc_op* ops, size_t* nops) override {
this->Op1::AddOp(ops, nops);
this->Op2::AddOp(ops, nops);
diff --git a/include/grpcpp/impl/codegen/callback_common.h b/include/grpcpp/impl/codegen/callback_common.h
index ca2f867d04..a9835973ac 100644
--- a/include/grpcpp/impl/codegen/callback_common.h
+++ b/include/grpcpp/impl/codegen/callback_common.h
@@ -32,16 +32,16 @@ namespace grpc {
namespace internal {
/// An exception-safe way of invoking a user-specified callback function
-template <class Func, class Arg>
-void CatchingCallback(Func&& func, Arg&& arg) {
+template <class Func, class... Args>
+void CatchingCallback(Func&& func, Args&&... args) {
#if GRPC_ALLOW_EXCEPTIONS
try {
- func(arg);
+ func(std::forward<Args>(args)...);
} catch (...) {
// nothing to return or change here, just don't crash the library
}
#else // GRPC_ALLOW_EXCEPTIONS
- func(arg);
+ func(std::forward<Args>(args)...);
#endif // GRPC_ALLOW_EXCEPTIONS
}
diff --git a/include/grpcpp/impl/codegen/completion_queue.h b/include/grpcpp/impl/codegen/completion_queue.h
index f52f9a53be..a62d48abe7 100644
--- a/include/grpcpp/impl/codegen/completion_queue.h
+++ b/include/grpcpp/impl/codegen/completion_queue.h
@@ -387,6 +387,7 @@ class ServerCompletionQueue : public CompletionQueue {
grpc_cq_polling_type polling_type_;
friend class ServerBuilder;
+ friend class Server;
};
} // namespace grpc
diff --git a/include/grpcpp/impl/codegen/config_protobuf.h b/include/grpcpp/impl/codegen/config_protobuf.h
index 94e593d1ef..8c2e9e6792 100644
--- a/include/grpcpp/impl/codegen/config_protobuf.h
+++ b/include/grpcpp/impl/codegen/config_protobuf.h
@@ -66,6 +66,12 @@
#define GRPC_CUSTOM_CODEDINPUTSTREAM ::google::protobuf::io::CodedInputStream
#endif
+#ifndef GRPC_CUSTOM_JSONUTIL
+#include <google/protobuf/util/json_util.h>
+#define GRPC_CUSTOM_JSONUTIL ::google::protobuf::util
+#define GRPC_CUSTOM_UTIL_STATUS ::google::protobuf::util::Status
+#endif
+
namespace grpc {
namespace protobuf {
@@ -83,6 +89,12 @@ typedef GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor;
typedef GRPC_CUSTOM_SIMPLEDESCRIPTORDATABASE SimpleDescriptorDatabase;
typedef GRPC_CUSTOM_SOURCELOCATION SourceLocation;
+namespace util {
+typedef GRPC_CUSTOM_UTIL_STATUS Status;
+} // namespace util
+
+namespace json = GRPC_CUSTOM_JSONUTIL;
+
namespace io {
typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream;
typedef GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream;