make grpc-encoding:identity implicit

pull/9531/head
David Garcia Quintas 8 years ago
parent 08a215f72c
commit 7240b54ddb
  1. 10
      src/core/lib/channel/compress_filter.c
  2. 4
      test/core/end2end/bad_server_response_test.c

@ -105,7 +105,6 @@ static grpc_error *process_send_initial_metadata(
static grpc_error *process_send_initial_metadata(
grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_metadata_batch *initial_metadata) {
grpc_error *error;
call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data;
/* Parse incoming request for compression. If any, it'll be available
@ -144,10 +143,13 @@ static grpc_error *process_send_initial_metadata(
calld->has_compression_algorithm = 1; /* GPR_TRUE */
}
grpc_error *error = GRPC_ERROR_NONE;
/* hint compression algorithm */
error = grpc_metadata_batch_add_tail(
exec_ctx, initial_metadata, &calld->compression_algorithm_storage,
grpc_compression_encoding_mdelem(calld->compression_algorithm));
if (calld->compression_algorithm != GRPC_COMPRESS_NONE) {
error = grpc_metadata_batch_add_tail(
exec_ctx, initial_metadata, &calld->compression_algorithm_storage,
grpc_compression_encoding_mdelem(calld->compression_algorithm));
}
if (error != GRPC_ERROR_NONE) return error;

@ -82,7 +82,7 @@
#define HTTP1_DETAIL_MSG "Trying to connect an http1.x server"
/* TODO(zyc) Check the content of incomming data instead of using this length */
#define EXPECTED_INCOMING_DATA_LENGTH (size_t)310
#define EXPECTED_INCOMING_DATA_LENGTH (size_t)300
struct rpc_state {
char *target;
@ -135,7 +135,7 @@ static void handle_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
gpr_log(GPR_DEBUG, "got %" PRIuPTR " bytes, expected %" PRIuPTR " bytes",
state.incoming_data_length, EXPECTED_INCOMING_DATA_LENGTH);
if (state.incoming_data_length > EXPECTED_INCOMING_DATA_LENGTH) {
if (state.incoming_data_length >= EXPECTED_INCOMING_DATA_LENGTH) {
handle_write(exec_ctx);
} else {
grpc_endpoint_read(exec_ctx, state.tcp, &state.temp_incoming_buffer,

Loading…
Cancel
Save