aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2015-07-31 14:15:36 -0700
committerGravatar yang-g <yangg@google.com>2015-07-31 14:15:36 -0700
commitb803313b2c39d6d0f2ed64253db89c910a8c39e2 (patch)
tree9e840d685a009b1a5afc0d06094e535a3b645bb3 /include
parent61fcb185dd66b8634e042973be294a7c6c174da4 (diff)
parent11af9747152565c4f5bfe0acb453715521e8af7f (diff)
merge with head and resolve conflicts
Diffstat (limited to 'include')
-rw-r--r--include/grpc++/client_context.h8
-rw-r--r--include/grpc++/server_context.h4
-rw-r--r--include/grpc/grpc.h48
-rw-r--r--include/grpc/support/atm_gcc_atomic.h2
-rw-r--r--include/grpc/support/atm_gcc_sync.h5
-rw-r--r--include/grpc/support/atm_win32.h5
6 files changed, 49 insertions, 23 deletions
diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h
index bb39042bcb..10c967d85b 100644
--- a/include/grpc++/client_context.h
+++ b/include/grpc++/client_context.h
@@ -110,7 +110,7 @@ class ClientContext {
creds_ = creds;
}
- grpc_compression_algorithm get_compression_algorithm() const {
+ grpc_compression_algorithm compression_algorithm() const {
return compression_algorithm_;
}
@@ -125,8 +125,8 @@ class ClientContext {
grpc::string peer() const;
// Get and set census context
- void set_census_context(census_context* ccp) { census_context_ = ccp; }
- census_context* get_census_context() const { return census_context_; }
+ void set_census_context(struct census_context* ccp) { census_context_ = ccp; }
+ struct census_context* census_context() const { return census_context_; }
void TryCancel();
@@ -176,7 +176,7 @@ class ClientContext {
grpc::string authority_;
std::shared_ptr<Credentials> creds_;
mutable std::shared_ptr<const AuthContext> auth_context_;
- census_context* census_context_;
+ struct census_context* census_context_;
std::multimap<grpc::string, grpc::string> send_initial_metadata_;
std::multimap<grpc::string, grpc::string> recv_initial_metadata_;
std::multimap<grpc::string, grpc::string> trailing_metadata_;
diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h
index 13bba45fe9..cf2732b33d 100644
--- a/include/grpc++/server_context.h
+++ b/include/grpc++/server_context.h
@@ -105,12 +105,12 @@ class ServerContext {
return client_metadata_;
}
- grpc_compression_level get_compression_level() const {
+ grpc_compression_level compression_level() const {
return compression_level_;
}
void set_compression_level(grpc_compression_level level);
- grpc_compression_algorithm get_compression_algorithm() const {
+ grpc_compression_algorithm compression_algorithm() const {
return compression_algorithm_;
}
void set_compression_algorithm(grpc_compression_algorithm algorithm);
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index cf59b943e9..b33d2cd68c 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -50,7 +50,7 @@ extern "C" {
* \section intro_sec The GRPC Core library is a low-level library designed
* to be wrapped by higher level libraries.
*
- * The top-level API is provided in grpc.h.
+ * The top-level API is provided in grpc.h.
* Security related functionality lives in grpc_security.h.
*/
@@ -175,7 +175,7 @@ typedef enum grpc_call_error {
GRPC_CALL_ERROR_INVALID_FLAGS,
/** invalid metadata was passed to this call */
GRPC_CALL_ERROR_INVALID_METADATA,
- /** completion queue for notification has not been registered with the
+ /** completion queue for notification has not been registered with the
server */
GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE
} grpc_call_error;
@@ -198,7 +198,8 @@ typedef struct grpc_metadata {
size_t value_length;
/** The following fields are reserved for grpc internal use.
- There is no need to initialize them, and they will be set to garbage during
+ There is no need to initialize them, and they will be set to garbage
+ during
calls to grpc. */
struct {
void *obfuscated[3];
@@ -256,24 +257,25 @@ typedef enum {
/** Send a message: 0 or more of these operations can occur for each call */
GRPC_OP_SEND_MESSAGE,
/** Send a close from the client: one and only one instance MUST be sent from
- the client, unless the call was cancelled - in which case this can be
+ the client, unless the call was cancelled - in which case this can be
skipped */
GRPC_OP_SEND_CLOSE_FROM_CLIENT,
/** Send status from the server: one and only one instance MUST be sent from
- the server unless the call was cancelled - in which case this can be
+ the server unless the call was cancelled - in which case this can be
skipped */
GRPC_OP_SEND_STATUS_FROM_SERVER,
- /** Receive initial metadata: one and only one MUST be made on the client,
+ /** Receive initial metadata: one and only one MUST be made on the client,
must not be made on the server */
GRPC_OP_RECV_INITIAL_METADATA,
- /** Receive a message: 0 or more of these operations can occur for each call */
+ /** Receive a message: 0 or more of these operations can occur for each call
+ */
GRPC_OP_RECV_MESSAGE,
/** Receive status on the client: one and only one must be made on the client.
This operation always succeeds, meaning ops paired with this operation
will also appear to succeed, even though they may not have. In that case
the status will indicate some failure. */
GRPC_OP_RECV_STATUS_ON_CLIENT,
- /** Receive close on the server: one and only one must be made on the
+ /** Receive close on the server: one and only one must be made on the
server */
GRPC_OP_RECV_CLOSE_ON_SERVER
} grpc_op_type;
@@ -284,7 +286,7 @@ typedef struct grpc_op {
/** Operation type, as defined by grpc_op_type */
grpc_op_type op;
/** Write flags bitset for grpc_begin_messages */
- gpr_uint32 flags;
+ gpr_uint32 flags;
union {
struct {
size_t count;
@@ -303,21 +305,23 @@ typedef struct grpc_op {
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;
- /** ownership of the byte buffer is moved to the caller; the caller must call
+ /** 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. */
grpc_byte_buffer **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
+ elements stays with the call object (ie key, value members are owned
by the call object, trailing_metadata->array is owned by the caller).
- After the operation completes, call grpc_metadata_array_destroy on this
+ After the operation completes, call grpc_metadata_array_destroy on
+ this
value, or reuse it in a future op. */
grpc_metadata_array *trailing_metadata;
grpc_status_code *status;
/** status_details is a buffer owned by the application before the op
completes and after the op has completed. During the operation
- status_details may be reallocated to a size larger than
- *status_details_capacity, in which case *status_details_capacity will
+ status_details may be reallocated to a size larger than
+ *status_details_capacity, in which case *status_details_capacity will
be updated with the new array capacity.
Pre-allocating space:
@@ -460,6 +464,16 @@ grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops,
functionality. Instead, use grpc_auth_context. */
char *grpc_call_get_peer(grpc_call *call);
+struct census_context;
+
+/* Set census context for a call; Must be called before first call to
+ grpc_call_start_batch(). */
+void grpc_census_call_set_context(grpc_call *call,
+ struct census_context *context);
+
+/* Retrieve the calls current census context. */
+struct census_context *grpc_census_call_get_context(grpc_call *call);
+
/** Return a newly allocated string representing the target a channel was
created for. */
char *grpc_channel_get_target(grpc_channel *channel);
@@ -506,7 +520,7 @@ grpc_call_error grpc_call_cancel_with_status(grpc_call *call,
void grpc_call_destroy(grpc_call *call);
/** Request notification of a new call. 'cq_for_notification' must
- have been registered to the server via
+ have been registered to the server via
grpc_server_register_completion_queue. */
grpc_call_error grpc_server_request_call(
grpc_server *server, grpc_call **call, grpc_call_details *details,
@@ -524,8 +538,8 @@ grpc_call_error grpc_server_request_call(
void *grpc_server_register_method(grpc_server *server, const char *method,
const char *host);
-/** Request notification of a new pre-registered call. 'cq_for_notification'
- must have been registered to the server via
+/** Request notification of a new pre-registered call. 'cq_for_notification'
+ must have been registered to the server via
grpc_server_register_completion_queue. */
grpc_call_error grpc_server_request_registered_call(
grpc_server *server, void *registered_method, grpc_call **call,
diff --git a/include/grpc/support/atm_gcc_atomic.h b/include/grpc/support/atm_gcc_atomic.h
index 65d3d0c60f..a2c8386028 100644
--- a/include/grpc/support/atm_gcc_atomic.h
+++ b/include/grpc/support/atm_gcc_atomic.h
@@ -46,6 +46,8 @@ typedef gpr_intptr gpr_atm;
#define gpr_atm_no_barrier_load(p) (__atomic_load_n((p), __ATOMIC_RELAXED))
#define gpr_atm_rel_store(p, value) \
(__atomic_store_n((p), (gpr_intptr)(value), __ATOMIC_RELEASE))
+#define gpr_atm_no_barrier_store(p, value) \
+ (__atomic_store_n((p), (gpr_intptr)(value), __ATOMIC_RELAXED))
#define gpr_atm_no_barrier_fetch_add(p, delta) \
(__atomic_fetch_add((p), (gpr_intptr)(delta), __ATOMIC_RELAXED))
diff --git a/include/grpc/support/atm_gcc_sync.h b/include/grpc/support/atm_gcc_sync.h
index 4955e4436f..38b5a9eec2 100644
--- a/include/grpc/support/atm_gcc_sync.h
+++ b/include/grpc/support/atm_gcc_sync.h
@@ -68,6 +68,11 @@ static __inline void gpr_atm_rel_store(gpr_atm *p, gpr_atm value) {
*p = value;
}
+static __inline void gpr_atm_no_barrier_store(gpr_atm *p, gpr_atm value) {
+ GPR_ATM_COMPILE_BARRIER_();
+ *p = value;
+}
+
#undef GPR_ATM_LS_BARRIER_
#undef GPR_ATM_COMPILE_BARRIER_
diff --git a/include/grpc/support/atm_win32.h b/include/grpc/support/atm_win32.h
index da99021c24..694528a9ba 100644
--- a/include/grpc/support/atm_win32.h
+++ b/include/grpc/support/atm_win32.h
@@ -57,6 +57,11 @@ static __inline void gpr_atm_rel_store(gpr_atm *p, gpr_atm value) {
*p = value;
}
+static __inline void gpr_atm_no_barrier_store(gpr_atm *p, gpr_atm value) {
+ /* TODO(ctiller): Can we implement something better here? */
+ gpr_atm_rel_store(p, value);
+}
+
static __inline int gpr_atm_no_barrier_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
/* InterlockedCompareExchangePointerNoFence() not available on vista or
windows7 */