3 * Copyright 2015 gRPC authors.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 #ifndef GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H
20 #define GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H
22 #include <grpc/support/port_platform.h>
24 #include <grpc/impl/codegen/compression_types.h>
26 #include "src/core/lib/channel/channel_stack.h"
28 /** Compression filter for outgoing data.
30 * See <grpc/compression.h> for the available compression settings.
32 * Compression settings may come from:
33 * - Channel configuration, as established at channel creation time.
34 * - The metadata accompanying the outgoing data to be compressed. This is
35 * taken as a request only. We may choose not to honor it. The metadata key
36 * is given by \a GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY.
38 * Compression can be disabled for concrete messages (for instance in order to
39 * prevent CRIME/BEAST type attacks) by having the GRPC_WRITE_NO_COMPRESS set in
40 * the BEGIN_MESSAGE flags.
42 * The attempted compression mechanism is added to the resulting initial
43 * metadata under the'grpc-encoding' key.
45 * If compression is actually performed, BEGIN_MESSAGE's flag is modified to
46 * incorporate GRPC_WRITE_INTERNAL_COMPRESS. Otherwise, and regardless of the
47 * aforementioned 'grpc-encoding' metadata value, data will pass through
50 extern const grpc_channel_filter grpc_message_compress_filter;
52 #endif /* GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H \