aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-07-08 10:54:46 -0700
committerGravatar Muxi Yan <mxyan@google.com>2017-07-08 10:54:46 -0700
commitfbd06f720297b4e622eabf4d1d8f7cdcbc3fde5a (patch)
tree6998537396bf417265a6d6b351e63157c21235cb /src
parent4f85558ba829e5ad072f54d58b49de7710ba585c (diff)
Comments and fixes
Diffstat (limited to 'src')
-rw-r--r--src/core/lib/compression/stream_compression.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/lib/compression/stream_compression.h b/src/core/lib/compression/stream_compression.h
index 41a7b669f7..cf009fdadd 100644
--- a/src/core/lib/compression/stream_compression.h
+++ b/src/core/lib/compression/stream_compression.h
@@ -31,14 +31,15 @@ typedef struct grpc_stream_compression_context {
} grpc_stream_compression_context;
typedef enum grpc_stream_compression_method {
- GRPC_STREAM_COMPRESSION_COMPRESS,
+ GRPC_STREAM_COMPRESSION_COMPRESS = 0,
GRPC_STREAM_COMPRESSION_DECOMPRESS
} grpc_stream_compression_method;
typedef enum grpc_stream_compression_flush {
- GRPC_STREAM_COMPRESSION_FLUSH_NONE,
+ GRPC_STREAM_COMPRESSION_FLUSH_NONE = 0,
GRPC_STREAM_COMPRESSION_FLUSH_SYNC,
- GRPC_STREAM_COMPRESSION_FLUSH_FINISH
+ GRPC_STREAM_COMPRESSION_FLUSH_FINISH,
+ GRPC_STREAM_COMPRESSION_FLUSH_COUNT
} grpc_stream_compression_flush;
/**
@@ -47,6 +48,12 @@ typedef enum grpc_stream_compression_flush {
* into \a out. If all the bytes in input buffer \a in are depleted and \a flush
* is not GRPC_STREAM_COMPRESSION_FLUSH_NONE, the corresponding flush method is
* executed. The total number of bytes emitted is outputed in \a output_size.
+ *
+ * A SYNC flush indicates that the entire messages in \a in can be decompressed
+ * from \a out. A FINISH flush implies a SYNC flush, and that any further
+ * compression will not be dependent on the state of the current context and any
+ * previous compressed bytes. It allows corresponding decompression context to
+ * be dropped when reaching this boundary.
*/
bool grpc_stream_compress(grpc_stream_compression_context *ctx,
grpc_slice_buffer *in, grpc_slice_buffer *out,