aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2015-07-17 14:21:15 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2015-07-17 14:21:15 -0700
commit7c4fdb5628209b47e9099b99b35284005c79f0fa (patch)
treea9b7b11b426640c246a5f1e28d89e4674ac41981 /src/core
parent7cceb09b793ac3110acc4b36b6f1a284958bc730 (diff)
Added comments
Diffstat (limited to 'src/core')
-rw-r--r--src/core/channel/compress_filter.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/core/channel/compress_filter.c b/src/core/channel/compress_filter.c
index 7d6f1a87a6..93b9b203e5 100644
--- a/src/core/channel/compress_filter.c
+++ b/src/core/channel/compress_filter.c
@@ -43,18 +43,25 @@
#include "src/core/compression/message_compress.h"
typedef struct call_data {
- gpr_slice_buffer slices;
+ gpr_slice_buffer slices; /**< Buffers up input slices to be compressed */
grpc_linked_mdelem compression_algorithm_storage;
- int remaining_slice_bytes;
- int written_initial_metadata;
+ int remaining_slice_bytes; /**< Input data to be read, as per BEGIN_MESSAGE */
+ int written_initial_metadata; /**< Already processed initial md? */
+ /** Compression algorithm we'll try to use. It may be given by incoming
+ * metadata, or by the channel's default compression settings. */
grpc_compression_algorithm compression_algorithm;
- gpr_uint8 has_compression_algorithm;
+ /** If true, contents of \a compression_algorithm are authoritative */
+ int has_compression_algorithm;
} call_data;
typedef struct channel_data {
+ /** Metadata key for the incoming (requested) compression algorithm */
grpc_mdstr *mdstr_request_compression_algorithm_key;
+ /** Metadata key for the outgoing (used) compression algorithm */
grpc_mdstr *mdstr_outgoing_compression_algorithm_key;
+ /** Precomputed metadata elements for all available compression algorithms */
grpc_mdelem *mdelem_compression_algorithms[GRPC_COMPRESS_ALGORITHMS_COUNT];
+ /** The default, channel-level, compression algorithm */
grpc_compression_algorithm default_compression_algorithm;
} channel_data;
@@ -157,6 +164,9 @@ static void finish_compressed_sopb(grpc_stream_op_buffer *send_ops,
grpc_sopb_destroy(&new_send_ops);
}
+/** Filter's "main" function, called for any incoming grpc_transport_stream_op
+ * instance that holds a non-zero number of send operations, accesible to this
+ * function in \a send_ops. */
static void process_send_ops(grpc_call_element *elem,
grpc_stream_op_buffer *send_ops) {
call_data *calld = elem->call_data;