|
|
|
@ -42,9 +42,10 @@ extern "C" { |
|
|
|
|
|
|
|
|
|
/** To be used in channel arguments */ |
|
|
|
|
#define GRPC_COMPRESSION_ALGORITHM_ARG "grpc.compression_algorithm" |
|
|
|
|
#define GRPC_COMPRESSION_LEVEL_ARG "grpc.compression_level" |
|
|
|
|
#define GRPC_COMPRESSION_ALGORITHM_STATE_ARG "grpc.compression_algorithm_state" |
|
|
|
|
|
|
|
|
|
/* The various compression algorithms supported by GRPC */ |
|
|
|
|
/* The various compression algorithms supported by gRPC */ |
|
|
|
|
typedef enum { |
|
|
|
|
GRPC_COMPRESS_NONE = 0, |
|
|
|
|
GRPC_COMPRESS_DEFLATE, |
|
|
|
@ -53,6 +54,10 @@ typedef enum { |
|
|
|
|
GRPC_COMPRESS_ALGORITHMS_COUNT |
|
|
|
|
} grpc_compression_algorithm; |
|
|
|
|
|
|
|
|
|
/** Compression levels allow a party with knowledge of its peer's accepted
|
|
|
|
|
* encodings to request compression in an abstract way. The level-algorithm |
|
|
|
|
* mapping is performed internally and depends on the peer's supported |
|
|
|
|
* compression algorithms. */ |
|
|
|
|
typedef enum { |
|
|
|
|
GRPC_COMPRESS_LEVEL_NONE = 0, |
|
|
|
|
GRPC_COMPRESS_LEVEL_LOW, |
|
|
|
@ -62,8 +67,19 @@ typedef enum { |
|
|
|
|
} grpc_compression_level; |
|
|
|
|
|
|
|
|
|
typedef struct grpc_compression_options { |
|
|
|
|
uint32_t enabled_algorithms_bitset; /**< All algs are enabled by default */ |
|
|
|
|
grpc_compression_algorithm default_compression_algorithm; /**< for channel */ |
|
|
|
|
/** All algs are enabled by default. This option corresponds to the channel
|
|
|
|
|
* argument key behind \a GRPC_COMPRESSION_ALGORITHM_STATE_ARG */ |
|
|
|
|
uint32_t enabled_algorithms_bitset; |
|
|
|
|
|
|
|
|
|
/** The default channel compression algorithm. It'll be used in the absence of
|
|
|
|
|
* call specific settings. This option corresponds to the channel argument key |
|
|
|
|
* behind \a GRPC_COMPRESSION_ALGORITHM_ARG */ |
|
|
|
|
grpc_compression_algorithm default_compression_algorithm; |
|
|
|
|
|
|
|
|
|
/** The default channel compression level. It'll be used in the absence of
|
|
|
|
|
* call specific settings. This option corresponds to the channel argument key |
|
|
|
|
* behind \a GRPC_COMPRESSION_ALGORITHM_ARG */ |
|
|
|
|
grpc_compression_algorithm default_compression_level; |
|
|
|
|
} grpc_compression_options; |
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus |
|
|
|
|