diff options
author | 2016-11-16 16:05:01 -0800 | |
---|---|---|
committer | 2016-11-16 16:05:01 -0800 | |
commit | 66b14c125ef7a792ce277021619e8a14a2619dda (patch) | |
tree | 53aa69cb045258a49bb4b974742030e900d5f9f5 /include | |
parent | 8cfe059dbc82bcfbd35647654a869369978b052e (diff) | |
parent | 1094c32f358cef7df323952c117a6773809019c0 (diff) |
Merge branch 'slice_interning' into eliminate_mdstr
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc++/impl/codegen/completion_queue.h | 2 | ||||
-rw-r--r-- | include/grpc++/support/channel_arguments.h | 14 | ||||
-rw-r--r-- | include/grpc/impl/codegen/connectivity_state.h | 2 | ||||
-rw-r--r-- | include/grpc/impl/codegen/exec_ctx_fwd.h | 6 | ||||
-rw-r--r-- | include/grpc/impl/codegen/grpc_types.h | 9 | ||||
-rw-r--r-- | include/grpc/impl/codegen/port_platform.h | 8 | ||||
-rw-r--r-- | include/grpc/slice.h | 4 | ||||
-rw-r--r-- | include/grpc/support/log.h | 2 | ||||
-rw-r--r-- | include/grpc/support/string_util.h | 2 |
9 files changed, 36 insertions, 13 deletions
diff --git a/include/grpc++/impl/codegen/completion_queue.h b/include/grpc++/impl/codegen/completion_queue.h index 29bc97fdf7..ef00163b7e 100644 --- a/include/grpc++/impl/codegen/completion_queue.h +++ b/include/grpc++/impl/codegen/completion_queue.h @@ -240,7 +240,7 @@ class ServerCompletionQueue : public CompletionQueue { private: bool is_frequently_polled_; friend class ServerBuilder; - /// \param is_frequently_polled Informs the GPRC library about whether the + /// \param is_frequently_polled Informs the GRPC library about whether the /// server completion queue would be actively polled (by calling Next() or /// AsyncNext()). By default all server completion queues are assumed to be /// frequently polled. diff --git a/include/grpc++/support/channel_arguments.h b/include/grpc++/support/channel_arguments.h index 49a3e9461c..220b6ef1dd 100644 --- a/include/grpc++/support/channel_arguments.h +++ b/include/grpc++/support/channel_arguments.h @@ -79,6 +79,9 @@ class ChannelArguments { /// Set the compression algorithm for the channel. void SetCompressionAlgorithm(grpc_compression_algorithm algorithm); + /// Set the socket mutator for the channel. + void SetSocketMutator(grpc_socket_mutator* mutator); + /// The given string will be sent at the front of the user agent string. void SetUserAgentPrefix(const grpc::string& user_agent_prefix); @@ -104,6 +107,15 @@ class ChannelArguments { /// Set a textual argument \a value under \a key. void SetString(const grpc::string& key, const grpc::string& value); + /// Return (by value) a c grpc_channel_args structure which points to + /// arguments owned by this ChannelArguments instance + grpc_channel_args c_channel_args() { + grpc_channel_args out; + out.num_args = args_.size(); + out.args = args_.empty() ? NULL : &args_[0]; + return out; + } + private: friend class SecureChannelCredentials; friend class testing::ChannelArgumentsTest; @@ -111,7 +123,7 @@ class ChannelArguments { /// Default pointer argument operations. struct PointerVtableMembers { static void* Copy(void* in) { return in; } - static void Destroy(void* in) {} + static void Destroy(grpc_exec_ctx* exec_ctx, void* in) {} static int Compare(void* a, void* b) { if (a < b) return -1; if (a > b) return 1; diff --git a/include/grpc/impl/codegen/connectivity_state.h b/include/grpc/impl/codegen/connectivity_state.h index 71865d8a56..c6d1a33405 100644 --- a/include/grpc/impl/codegen/connectivity_state.h +++ b/include/grpc/impl/codegen/connectivity_state.h @@ -40,6 +40,8 @@ extern "C" { /** Connectivity state of a channel. */ typedef enum { + /** channel has just been initialized */ + GRPC_CHANNEL_INIT = -1, /** channel is idle */ GRPC_CHANNEL_IDLE, /** channel is connecting */ diff --git a/include/grpc/impl/codegen/exec_ctx_fwd.h b/include/grpc/impl/codegen/exec_ctx_fwd.h index 6dff2d248c..32edcedbb3 100644 --- a/include/grpc/impl/codegen/exec_ctx_fwd.h +++ b/include/grpc/impl/codegen/exec_ctx_fwd.h @@ -31,11 +31,11 @@ * */ -#ifndef GRPC_EXEC_CTX_H -#define GRPC_EXEC_CTX_H +#ifndef GRPC_IMPL_CODEGEN_EXEC_CTX_FWD_H +#define GRPC_IMPL_CODEGEN_EXEC_CTX_FWD_H /* forward declaration for exec_ctx.h */ struct grpc_exec_ctx; typedef struct grpc_exec_ctx grpc_exec_ctx; -#endif +#endif /* GRPC_IMPL_CODEGEN_EXEC_CTX_FWD_H */ diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index e507e012e2..1d9402cf33 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -34,10 +34,10 @@ #ifndef GRPC_IMPL_CODEGEN_GRPC_TYPES_H #define GRPC_IMPL_CODEGEN_GRPC_TYPES_H +#include <grpc/impl/codegen/compression_types.h> +#include <grpc/impl/codegen/exec_ctx_fwd.h> #include <grpc/impl/codegen/gpr_types.h> #include <grpc/impl/codegen/slice.h> - -#include <grpc/impl/codegen/compression_types.h> #include <grpc/impl/codegen/status.h> #include <stddef.h> @@ -84,6 +84,9 @@ typedef struct grpc_server grpc_server; can have messages written to it and read from it. */ typedef struct grpc_call grpc_call; +/** The Socket Mutator interface allows changes on socket options */ +typedef struct grpc_socket_mutator grpc_socket_mutator; + /** Type specifier for grpc_arg */ typedef enum { GRPC_ARG_STRING, @@ -215,6 +218,8 @@ typedef struct { /** Resolved addresses in a form used by the LB policy. Not intended for external use. */ #define GRPC_ARG_LB_ADDRESSES "grpc.lb_addresses" +/** The grpc_socket_mutator instance that set the socket options. A pointer. */ +#define GRPC_ARG_SOCKET_MUTATOR "grpc.socket_mutator" /** \} */ /** Result of a grpc call. If the caller satisfies the prerequisites of a diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index 34df89700d..cd989d664c 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -368,14 +368,14 @@ typedef unsigned __int64 uint64_t; #endif #endif -#ifndef GPRC_PRINT_FORMAT_CHECK +#ifndef GPR_PRINT_FORMAT_CHECK #ifdef __GNUC__ -#define GPRC_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS) \ +#define GPR_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS) \ __attribute__((format(printf, FORMAT_STR, ARGS))) #else -#define GPRC_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS) +#define GPR_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS) #endif -#endif /* GPRC_PRINT_FORMAT_CHECK */ +#endif /* GPR_PRINT_FORMAT_CHECK */ #if GPR_FORBID_UNREACHABLE_CODE #define GPR_UNREACHABLE_CODE(STATEMENT) diff --git a/include/grpc/slice.h b/include/grpc/slice.h index 6017726704..34c1ee93d6 100644 --- a/include/grpc/slice.h +++ b/include/grpc/slice.h @@ -134,6 +134,10 @@ GPRAPI int grpc_slice_rchr(grpc_slice s, char c); GPRAPI uint32_t grpc_slice_hash(grpc_slice s); +/* Do two slices point at the same memory, with the same length + If a or b is inlined, actually compares data */ +GPRAPI int grpc_slice_is_equivalent(grpc_slice a, grpc_slice b); + #ifdef __cplusplus } #endif diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h index 5acf17fc2c..88346cc9f4 100644 --- a/include/grpc/support/log.h +++ b/include/grpc/support/log.h @@ -75,7 +75,7 @@ const char *gpr_log_severity_string(gpr_log_severity severity); /* Log a message. It's advised to use GPR_xxx above to generate the context * for each message */ GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, - const char *format, ...) GPRC_PRINT_FORMAT_CHECK(4, 5); + const char *format, ...) GPR_PRINT_FORMAT_CHECK(4, 5); GPRAPI void gpr_log_message(const char *file, int line, gpr_log_severity severity, const char *message); diff --git a/include/grpc/support/string_util.h b/include/grpc/support/string_util.h index 952cbfc26b..5ab983d15d 100644 --- a/include/grpc/support/string_util.h +++ b/include/grpc/support/string_util.h @@ -55,7 +55,7 @@ GPRAPI char *gpr_strdup(const char *src); On error, returns -1 and sets *strp to NULL. If the format string is bad, the result is undefined. */ GPRAPI int gpr_asprintf(char **strp, const char *format, ...) - GPRC_PRINT_FORMAT_CHECK(2, 3); + GPR_PRINT_FORMAT_CHECK(2, 3); #ifdef __cplusplus } |