From 1dc0833bed2b62c520c1382462413c8054aed595 Mon Sep 17 00:00:00 2001 From: Ken Payson Date: Thu, 25 Jan 2018 16:52:51 -0800 Subject: Don't segfault on header replay --- test/core/bad_client/gen_build_yaml.py | 1 + test/core/bad_client/generate_tests.bzl | 1 + test/core/bad_client/tests/duplicate_header.cc | 134 +++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 test/core/bad_client/tests/duplicate_header.cc (limited to 'test/core') diff --git a/test/core/bad_client/gen_build_yaml.py b/test/core/bad_client/gen_build_yaml.py index 14c8a27334..c0922fc3c4 100755 --- a/test/core/bad_client/gen_build_yaml.py +++ b/test/core/bad_client/gen_build_yaml.py @@ -27,6 +27,7 @@ default_test_options = TestOptions(False, 1.0) BAD_CLIENT_TESTS = { 'badreq': default_test_options, 'connection_prefix': default_test_options._replace(cpu_cost=0.2), + 'duplicate_header': default_test_options, 'headers': default_test_options._replace(cpu_cost=0.2), 'initial_settings_frame': default_test_options._replace(cpu_cost=0.2), 'head_of_line_blocking': default_test_options, diff --git a/test/core/bad_client/generate_tests.bzl b/test/core/bad_client/generate_tests.bzl index 022edf3ff3..0dbf5013d4 100755 --- a/test/core/bad_client/generate_tests.bzl +++ b/test/core/bad_client/generate_tests.bzl @@ -25,6 +25,7 @@ def test_options(): BAD_CLIENT_TESTS = { 'badreq': test_options(), 'connection_prefix': test_options(), + 'duplicate_header': test_options(), 'headers': test_options(), 'initial_settings_frame': test_options(), 'head_of_line_blocking': test_options(), diff --git a/test/core/bad_client/tests/duplicate_header.cc b/test/core/bad_client/tests/duplicate_header.cc new file mode 100644 index 0000000000..0d689bbb7e --- /dev/null +++ b/test/core/bad_client/tests/duplicate_header.cc @@ -0,0 +1,134 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "test/core/bad_client/bad_client.h" + +#include + +#include + +#include "src/core/lib/surface/server.h" +#include "test/core/end2end/cq_verifier.h" + +#define PFX_STR \ + "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \ + "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */ + +#define HEADER_STR \ + "\x00\x00\xc9\x01\x04\x00\x00\x00\x01" /* headers: generated from \ + simple_request.headers in this \ + directory */ \ + "\x10\x05:path\x08/foo/bar" \ + "\x10\x07:scheme\x04http" \ + "\x10\x07:method\x04POST" \ + "\x10\x0a:authority\x09localhost" \ + "\x10\x0c" \ + "content-type\x10" \ + "application/grpc" \ + "\x10\x14grpc-accept-encoding\x15" \ + "deflate,identity,gzip" \ + "\x10\x02te\x08trailers" \ + "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)" + +#define PAYLOAD_STR \ + "\x00\x00\x20\x00\x00\x00\x00\x00\x01" \ + "\x00\x00\x00\x00" + +static void* tag(intptr_t t) { return (void*)t; } + +static void verifier(grpc_server* server, grpc_completion_queue* cq, + void* registered_method) { + grpc_call_error error; + grpc_call* s; + grpc_call_details call_details; + grpc_byte_buffer* request_payload_recv = nullptr; + grpc_op* op; + grpc_op ops[6]; + cq_verifier* cqv = cq_verifier_create(cq); + grpc_metadata_array request_metadata_recv; + int was_cancelled = 2; + + grpc_call_details_init(&call_details); + grpc_metadata_array_init(&request_metadata_recv); + + error = grpc_server_request_call(server, &s, &call_details, + &request_metadata_recv, cq, cq, tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); + CQ_EXPECT_COMPLETION(cqv, tag(101), 1); + cq_verify(cqv); + + GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.host, "localhost")); + GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo/bar")); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_SEND_INITIAL_METADATA; + op->data.send_initial_metadata.count = 0; + op->flags = 0; + op->reserved = nullptr; + op++; + op->op = GRPC_OP_RECV_MESSAGE; + op->data.recv_message.recv_message = &request_payload_recv; + op->flags = 0; + op->reserved = nullptr; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + GPR_ASSERT(GRPC_CALL_OK == error); + + CQ_EXPECT_COMPLETION(cqv, tag(102), 1); + cq_verify(cqv); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; + op->data.recv_close_on_server.cancelled = &was_cancelled; + op->flags = 0; + op->reserved = nullptr; + op++; + op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; + op->data.send_status_from_server.trailing_metadata_count = 0; + op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED; + grpc_slice status_details = grpc_slice_from_static_string("xyz"); + op->data.send_status_from_server.status_details = &status_details; + op->flags = 0; + op->reserved = nullptr; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + GPR_ASSERT(GRPC_CALL_OK == error); + + CQ_EXPECT_COMPLETION(cqv, tag(103), 1); + + grpc_metadata_array_destroy(&request_metadata_recv); + grpc_call_details_destroy(&call_details); + grpc_call_unref(s); + cq_verifier_destroy(cqv); +} + +int main(int argc, char** argv) { + grpc_test_init(argc, argv); + grpc_init(); + + /* Verify that sending multiple headers doesn't segfault */ + GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, + PFX_STR HEADER_STR HEADER_STR PAYLOAD_STR, 0); + GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, + PFX_STR HEADER_STR HEADER_STR HEADER_STR PAYLOAD_STR, + 0); + grpc_shutdown(); + return 0; +} -- cgit v1.2.3 From d82e137c7bf94301c95b38018d637b0166e199d7 Mon Sep 17 00:00:00 2001 From: Juanli Shen Date: Thu, 1 Feb 2018 14:47:38 -0800 Subject: Add a results_upon_error setter to fake resolver --- .../client_channel/resolver/fake/fake_resolver.cc | 69 ++++++-- .../client_channel/resolver/fake/fake_resolver.h | 15 +- .../client_channel/resolvers/fake_resolver_test.cc | 194 +++++++++++++++------ test/cpp/end2end/grpclb_end2end_test.cc | 23 ++- 4 files changed, 223 insertions(+), 78 deletions(-) (limited to 'test/core') diff --git a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc index eaa5e6ac49..e945d08202 100644 --- a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc @@ -47,10 +47,10 @@ // typedef struct { - // base class -- must be first + // Base class -- must be first grpc_resolver base; - // passed-in parameters + // Passed-in parameters grpc_channel_args* channel_args; // If not NULL, the next set of resolution results to be returned to @@ -61,9 +61,16 @@ typedef struct { // fake_resolver_channel_saw_error_locked(). grpc_channel_args* results_upon_error; - // pending next completion, or NULL + // TODO(juanlishen): This can go away once pick_first is changed to not throw + // away its subchannels, since that will eliminate its dependence on + // channel_saw_error_locked() causing an immediate resolver return. + // A copy of the most-recently used resolution results. + grpc_channel_args* last_used_results; + + // Pending next completion, or NULL grpc_closure* next_completion; - // target result address for next completion + + // Target result address for next completion grpc_channel_args** target_result; } fake_resolver; @@ -71,6 +78,7 @@ static void fake_resolver_destroy(grpc_resolver* gr) { fake_resolver* r = (fake_resolver*)gr; grpc_channel_args_destroy(r->next_results); grpc_channel_args_destroy(r->results_upon_error); + grpc_channel_args_destroy(r->last_used_results); grpc_channel_args_destroy(r->channel_args); gpr_free(r); } @@ -98,9 +106,15 @@ static void fake_resolver_maybe_finish_next_locked(fake_resolver* r) { static void fake_resolver_channel_saw_error_locked(grpc_resolver* resolver) { fake_resolver* r = (fake_resolver*)resolver; - if (r->next_results == nullptr && r->results_upon_error != nullptr) { - // Pretend we re-resolved. + // A resolution must have been returned before an error is seen. + GPR_ASSERT(r->last_used_results != nullptr); + grpc_channel_args_destroy(r->next_results); + if (r->results_upon_error != nullptr) { r->next_results = grpc_channel_args_copy(r->results_upon_error); + } else { + // If results_upon_error is unavailable, re-resolve with the most-recently + // used results to avoid a no-op re-resolution. + r->next_results = grpc_channel_args_copy(r->last_used_results); } fake_resolver_maybe_finish_next_locked(r); } @@ -149,35 +163,56 @@ void grpc_fake_resolver_response_generator_unref( typedef struct set_response_closure_arg { grpc_closure set_response_closure; grpc_fake_resolver_response_generator* generator; - grpc_channel_args* next_response; + grpc_channel_args* response; + bool upon_error; } set_response_closure_arg; -static void set_response_closure_fn(void* arg, grpc_error* error) { +static void set_response_closure_locked(void* arg, grpc_error* error) { set_response_closure_arg* closure_arg = (set_response_closure_arg*)arg; grpc_fake_resolver_response_generator* generator = closure_arg->generator; fake_resolver* r = generator->resolver; - if (r->next_results != nullptr) { + if (!closure_arg->upon_error) { grpc_channel_args_destroy(r->next_results); - } - r->next_results = closure_arg->next_response; - if (r->results_upon_error != nullptr) { + r->next_results = closure_arg->response; + grpc_channel_args_destroy(r->last_used_results); + r->last_used_results = grpc_channel_args_copy(closure_arg->response); + fake_resolver_maybe_finish_next_locked(r); + } else { grpc_channel_args_destroy(r->results_upon_error); + r->results_upon_error = closure_arg->response; } - r->results_upon_error = grpc_channel_args_copy(closure_arg->next_response); gpr_free(closure_arg); - fake_resolver_maybe_finish_next_locked(r); } void grpc_fake_resolver_response_generator_set_response( grpc_fake_resolver_response_generator* generator, - grpc_channel_args* next_response) { + grpc_channel_args* response) { + GPR_ASSERT(generator->resolver != nullptr); + GPR_ASSERT(response != nullptr); + set_response_closure_arg* closure_arg = + (set_response_closure_arg*)gpr_zalloc(sizeof(*closure_arg)); + closure_arg->generator = generator; + closure_arg->response = grpc_channel_args_copy(response); + closure_arg->upon_error = false; + GRPC_CLOSURE_SCHED(GRPC_CLOSURE_INIT(&closure_arg->set_response_closure, + set_response_closure_locked, closure_arg, + grpc_combiner_scheduler( + generator->resolver->base.combiner)), + GRPC_ERROR_NONE); +} + +void grpc_fake_resolver_response_generator_set_response_upon_error( + grpc_fake_resolver_response_generator* generator, + grpc_channel_args* response) { GPR_ASSERT(generator->resolver != nullptr); set_response_closure_arg* closure_arg = (set_response_closure_arg*)gpr_zalloc(sizeof(*closure_arg)); closure_arg->generator = generator; - closure_arg->next_response = grpc_channel_args_copy(next_response); + closure_arg->response = + response != nullptr ? grpc_channel_args_copy(response) : nullptr; + closure_arg->upon_error = true; GRPC_CLOSURE_SCHED(GRPC_CLOSURE_INIT(&closure_arg->set_response_closure, - set_response_closure_fn, closure_arg, + set_response_closure_locked, closure_arg, grpc_combiner_scheduler( generator->resolver->base.combiner)), GRPC_ERROR_NONE); diff --git a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h index a8977e5980..94f9a8e6ca 100644 --- a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +++ b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h @@ -36,11 +36,20 @@ typedef struct grpc_fake_resolver_response_generator grpc_fake_resolver_response_generator* grpc_fake_resolver_response_generator_create(); -// Instruct the fake resolver associated with the \a response_generator instance -// to trigger a new resolution for \a uri and \a args. +// Set next response of the fake resolver associated with the \a +// response_generator instance and trigger a new resolution. void grpc_fake_resolver_response_generator_set_response( grpc_fake_resolver_response_generator* generator, - grpc_channel_args* next_response); + grpc_channel_args* response); + +// Set results_upon_error of the fake resolver associated with the \a +// response_generator instance. When fake_resolver_channel_saw_error_locked() is +// called, results_upon_error will be returned as long as it's non-NULL, +// otherwise the last value set by +// grpc_fake_resolver_response_generator_set_response() will be returned. +void grpc_fake_resolver_response_generator_set_response_upon_error( + grpc_fake_resolver_response_generator* generator, + grpc_channel_args* response); // Return a \a grpc_arg for a \a grpc_fake_resolver_response_generator instance. grpc_arg grpc_fake_resolver_response_generator_arg( diff --git a/test/core/client_channel/resolvers/fake_resolver_test.cc b/test/core/client_channel/resolvers/fake_resolver_test.cc index d85cbb1d03..9c11c01021 100644 --- a/test/core/client_channel/resolvers/fake_resolver_test.cc +++ b/test/core/client_channel/resolvers/fake_resolver_test.cc @@ -55,6 +55,7 @@ typedef struct on_resolution_arg { gpr_event ev; } on_resolution_arg; +// Callback to check the resolution result is as expected. void on_resolution_cb(void* arg, grpc_error* error) { on_resolution_arg* res = static_cast(arg); // We only check the addresses channel arg because that's the only one @@ -71,85 +72,167 @@ void on_resolution_cb(void* arg, grpc_error* error) { gpr_event_set(&res->ev, (void*)1); } -static void test_fake_resolver() { - grpc_core::ExecCtx exec_ctx; - grpc_combiner* combiner = grpc_combiner_create(); - // Create resolver. - grpc_fake_resolver_response_generator* response_generator = - grpc_fake_resolver_response_generator_create(); - grpc_resolver* resolver = build_fake_resolver(combiner, response_generator); - GPR_ASSERT(resolver != nullptr); - - // Setup expectations. - grpc_uri* uris[] = {grpc_uri_parse("ipv4:10.2.1.1:1234", true), - grpc_uri_parse("ipv4:127.0.0.1:4321", true)}; - const char* balancer_names[] = {"name1", "name2"}; - const bool is_balancer[] = {true, false}; - grpc_lb_addresses* addresses = grpc_lb_addresses_create(3, nullptr); - for (size_t i = 0; i < GPR_ARRAY_SIZE(uris); ++i) { +// Create a new resolution containing 2 addresses. +static grpc_channel_args* create_new_resolver_result() { + static size_t test_counter = 0; + const size_t num_addresses = 2; + char* uri_string; + char* balancer_name; + // Create grpc_lb_addresses. + grpc_lb_addresses* addresses = + grpc_lb_addresses_create(num_addresses, nullptr); + for (size_t i = 0; i < num_addresses; ++i) { + gpr_asprintf(&uri_string, "ipv4:127.0.0.1:100%" PRIuPTR, + test_counter * num_addresses + i); + grpc_uri* uri = grpc_uri_parse(uri_string, true); + gpr_asprintf(&balancer_name, "balancer%" PRIuPTR, + test_counter * num_addresses + i); grpc_lb_addresses_set_address_from_uri( - addresses, i, uris[i], is_balancer[i], balancer_names[i], nullptr); - grpc_uri_destroy(uris[i]); + addresses, i, uri, bool(num_addresses % 2), balancer_name, nullptr); + gpr_free(balancer_name); + grpc_uri_destroy(uri); + gpr_free(uri_string); } + // Convert grpc_lb_addresses to grpc_channel_args. const grpc_arg addresses_arg = grpc_lb_addresses_create_channel_arg(addresses); grpc_channel_args* results = grpc_channel_args_copy_and_add(nullptr, &addresses_arg, 1); grpc_lb_addresses_destroy(addresses); + ++test_counter; + return results; +} + +static on_resolution_arg create_on_resolution_arg(grpc_channel_args* results) { on_resolution_arg on_res_arg; memset(&on_res_arg, 0, sizeof(on_res_arg)); on_res_arg.expected_resolver_result = results; gpr_event_init(&on_res_arg.ev); + return on_res_arg; +} + +static void test_fake_resolver() { + grpc_core::ExecCtx exec_ctx; + grpc_combiner* combiner = grpc_combiner_create(); + // Create resolver. + grpc_fake_resolver_response_generator* response_generator = + grpc_fake_resolver_response_generator_create(); + grpc_resolver* resolver = build_fake_resolver(combiner, response_generator); + GPR_ASSERT(resolver != nullptr); + // Test 1: normal resolution. + // next_results != NULL, results_upon_error == NULL, last_used_results == + // NULL. Expected response is next_results. + grpc_channel_args* results = create_new_resolver_result(); + on_resolution_arg on_res_arg = create_on_resolution_arg(results); grpc_closure* on_resolution = GRPC_CLOSURE_CREATE( on_resolution_cb, &on_res_arg, grpc_combiner_scheduler(combiner)); - - // Set resolver results and trigger first resolution. on_resolution_cb - // performs the checks. + // Resolution won't be triggered until next_results is set. + grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, + on_resolution); grpc_fake_resolver_response_generator_set_response(response_generator, results); + grpc_core::ExecCtx::Get()->Flush(); + GPR_ASSERT(gpr_event_wait(&on_res_arg.ev, + grpc_timeout_seconds_to_deadline(5)) != nullptr); + // Test 2: update resolution. + // next_results != NULL, results_upon_error == NULL, last_used_results != + // NULL. Expected response is next_results. + results = create_new_resolver_result(); + grpc_channel_args* last_used_results = grpc_channel_args_copy(results); + on_res_arg = create_on_resolution_arg(results); + on_resolution = GRPC_CLOSURE_CREATE(on_resolution_cb, &on_res_arg, + grpc_combiner_scheduler(combiner)); + // Resolution won't be triggered until next_results is set. grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, on_resolution); + grpc_fake_resolver_response_generator_set_response(response_generator, + results); grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&on_res_arg.ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); - - // Setup update. - grpc_uri* uris_update[] = {grpc_uri_parse("ipv4:192.168.1.0:31416", true)}; - const char* balancer_names_update[] = {"name3"}; - const bool is_balancer_update[] = {false}; - grpc_lb_addresses* addresses_update = grpc_lb_addresses_create(1, nullptr); - for (size_t i = 0; i < GPR_ARRAY_SIZE(uris_update); ++i) { - grpc_lb_addresses_set_address_from_uri(addresses_update, i, uris_update[i], - is_balancer_update[i], - balancer_names_update[i], nullptr); - grpc_uri_destroy(uris_update[i]); - } - - grpc_arg addresses_update_arg = - grpc_lb_addresses_create_channel_arg(addresses_update); - grpc_channel_args* results_update = - grpc_channel_args_copy_and_add(nullptr, &addresses_update_arg, 1); - grpc_lb_addresses_destroy(addresses_update); - - // Setup expectations for the update. - on_resolution_arg on_res_arg_update; - memset(&on_res_arg_update, 0, sizeof(on_res_arg_update)); - on_res_arg_update.expected_resolver_result = results_update; - gpr_event_init(&on_res_arg_update.ev); - on_resolution = GRPC_CLOSURE_CREATE(on_resolution_cb, &on_res_arg_update, + // Test 3: fallback re-resolution. + // next_results == NULL, results_upon_error == NULL, last_used_results != + // NULL. Expected response is last_used_results. + on_res_arg = create_on_resolution_arg(last_used_results); + on_resolution = GRPC_CLOSURE_CREATE(on_resolution_cb, &on_res_arg, grpc_combiner_scheduler(combiner)); - - // Set updated resolver results and trigger a second resolution. + grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, + on_resolution); + // Trigger a re-resolution. + grpc_resolver_channel_saw_error_locked(resolver); + grpc_core::ExecCtx::Get()->Flush(); + GPR_ASSERT(gpr_event_wait(&on_res_arg.ev, + grpc_timeout_seconds_to_deadline(5)) != nullptr); + // Test 4: normal re-resolution. + // next_results == NULL, results_upon_error != NULL, last_used_results != + // NULL. Expected response is results_upon_error. + grpc_channel_args* results_upon_error = create_new_resolver_result(); + on_res_arg = + create_on_resolution_arg(grpc_channel_args_copy(results_upon_error)); + on_resolution = GRPC_CLOSURE_CREATE(on_resolution_cb, &on_res_arg, + grpc_combiner_scheduler(combiner)); + grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, + on_resolution); + // Set results_upon_error. + grpc_fake_resolver_response_generator_set_response_upon_error( + response_generator, results_upon_error); + // Flush here to guarantee that the response has been set. + grpc_core::ExecCtx::Get()->Flush(); + // Trigger a re-resolution. + grpc_resolver_channel_saw_error_locked(resolver); + grpc_core::ExecCtx::Get()->Flush(); + GPR_ASSERT(gpr_event_wait(&on_res_arg.ev, + grpc_timeout_seconds_to_deadline(5)) != nullptr); + // Test 5: repeat re-resolution. + // next_results == NULL, results_upon_error != NULL, last_used_results != + // NULL. Expected response is results_upon_error. + on_res_arg = create_on_resolution_arg(results_upon_error); + on_resolution = GRPC_CLOSURE_CREATE(on_resolution_cb, &on_res_arg, + grpc_combiner_scheduler(combiner)); + grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, + on_resolution); + // Trigger a re-resolution. + grpc_resolver_channel_saw_error_locked(resolver); + grpc_core::ExecCtx::Get()->Flush(); + GPR_ASSERT(gpr_event_wait(&on_res_arg.ev, + grpc_timeout_seconds_to_deadline(5)) != nullptr); + // Test 6: normal resolution. + // next_results != NULL, results_upon_error != NULL, last_used_results != + // NULL. Expected response is next_results. + results = create_new_resolver_result(); + last_used_results = grpc_channel_args_copy(results); + on_res_arg = create_on_resolution_arg(results); + on_resolution = GRPC_CLOSURE_CREATE(on_resolution_cb, &on_res_arg, + grpc_combiner_scheduler(combiner)); + // Resolution won't be triggered until next_results is set. + grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, + on_resolution); grpc_fake_resolver_response_generator_set_response(response_generator, - results_update); - grpc_resolver_next_locked(resolver, &on_res_arg_update.resolver_result, + results); + grpc_core::ExecCtx::Get()->Flush(); + GPR_ASSERT(gpr_event_wait(&on_res_arg.ev, + grpc_timeout_seconds_to_deadline(5)) != nullptr); + // Test 7: fallback re-resolution. + // next_results == NULL, results_upon_error == NULL, last_used_results != + // NULL. Expected response is last_used_results. + on_res_arg = create_on_resolution_arg(last_used_results); + on_resolution = GRPC_CLOSURE_CREATE(on_resolution_cb, &on_res_arg, + grpc_combiner_scheduler(combiner)); + grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, on_resolution); + // Reset results_upon_error. + grpc_fake_resolver_response_generator_set_response_upon_error( + response_generator, nullptr); + // Flush here to guarantee that results_upon_error has been reset. + grpc_core::ExecCtx::Get()->Flush(); + // Trigger a re-resolution. + grpc_resolver_channel_saw_error_locked(resolver); grpc_core::ExecCtx::Get()->Flush(); - GPR_ASSERT(gpr_event_wait(&on_res_arg_update.ev, + GPR_ASSERT(gpr_event_wait(&on_res_arg.ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); - - // Requesting a new resolution without re-senting the response shouldn't - // trigger the resolution callback. + // Test 8: no-op. + // Requesting a new resolution without setting the response shouldn't trigger + // the resolution callback. memset(&on_res_arg, 0, sizeof(on_res_arg)); grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, on_resolution); @@ -157,10 +240,9 @@ static void test_fake_resolver() { GPR_ASSERT(gpr_event_wait(&on_res_arg.ev, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); - + // Clean up. GRPC_COMBINER_UNREF(combiner, "test_fake_resolver"); GRPC_RESOLVER_UNREF(resolver, "test_fake_resolver"); - grpc_fake_resolver_response_generator_unref(response_generator); } diff --git a/test/cpp/end2end/grpclb_end2end_test.cc b/test/cpp/end2end/grpclb_end2end_test.cc index 78527587cf..5591acf880 100644 --- a/test/cpp/end2end/grpclb_end2end_test.cc +++ b/test/cpp/end2end/grpclb_end2end_test.cc @@ -454,8 +454,8 @@ class GrpclbEnd2endTest : public ::testing::Test { grpc::string balancer_name; }; - void SetNextResolution(const std::vector& address_data) { - grpc_core::ExecCtx exec_ctx; + grpc_lb_addresses* CreateLbAddressesFromAddressDataList( + const std::vector& address_data) { grpc_lb_addresses* addresses = grpc_lb_addresses_create(address_data.size(), nullptr); for (size_t i = 0; i < address_data.size(); ++i) { @@ -469,6 +469,13 @@ class GrpclbEnd2endTest : public ::testing::Test { grpc_uri_destroy(lb_uri); gpr_free(lb_uri_str); } + return addresses; + } + + void SetNextResolution(const std::vector& address_data) { + grpc_core::ExecCtx exec_ctx; + grpc_lb_addresses* addresses = + CreateLbAddressesFromAddressDataList(address_data); grpc_arg fake_addresses = grpc_lb_addresses_create_channel_arg(addresses); grpc_channel_args fake_result = {1, &fake_addresses}; grpc_fake_resolver_response_generator_set_response(response_generator_, @@ -476,6 +483,18 @@ class GrpclbEnd2endTest : public ::testing::Test { grpc_lb_addresses_destroy(addresses); } + void SetNextResolutionUponError( + const std::vector& address_data) { + grpc_core::ExecCtx exec_ctx; + grpc_lb_addresses* addresses = + CreateLbAddressesFromAddressDataList(address_data); + grpc_arg fake_addresses = grpc_lb_addresses_create_channel_arg(addresses); + grpc_channel_args fake_result = {1, &fake_addresses}; + grpc_fake_resolver_response_generator_set_response_upon_error( + response_generator_, &fake_result); + grpc_lb_addresses_destroy(addresses); + } + const std::vector GetBackendPorts(const size_t start_index = 0) const { std::vector backend_ports; for (size_t i = start_index; i < backend_servers_.size(); ++i) { -- cgit v1.2.3 From 461d59cf0855995bd6cac49d81497250421dee0c Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Mon, 5 Feb 2018 11:02:02 -0800 Subject: Add BUILD file --- test/core/channel/BUILD | 12 ++++++++++++ test/core/client_channel/BUILD | 23 +++++++++++++++++++++++ test/core/http/BUILD | 13 +++++++++++++ test/cpp/performance/BUILD | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 test/cpp/performance/BUILD (limited to 'test/core') diff --git a/test/core/channel/BUILD b/test/core/channel/BUILD index 92f5907aac..c5dfd8ef37 100644 --- a/test/core/channel/BUILD +++ b/test/core/channel/BUILD @@ -53,3 +53,15 @@ grpc_cc_test( "//test/core/util:grpc_test_util", ], ) + +grpc_cc_test( + name = "minimal_stack_is_minimal_test", + srcs = ["minimal_stack_is_minimal_test.cc"], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//test/core/util:gpr_test_util", + "//test/core/util:grpc_test_util", + ], +) diff --git a/test/core/client_channel/BUILD b/test/core/client_channel/BUILD index 890e03fec1..c4d12fe3a1 100644 --- a/test/core/client_channel/BUILD +++ b/test/core/client_channel/BUILD @@ -31,3 +31,26 @@ grpc_fuzzer( "//test/core/util:grpc_test_util", ], ) + +grpc_cc_test( + name = "parse_address_test", + srcs = ["parse_address_test.cc"], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//test/core/util:grpc_test_util", + ], +) + +grpc_cc_test( + name = "uri_parser_test", + srcs = ["uri_parser_test.cc"], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//test/core/util:grpc_test_util", + ], +) + diff --git a/test/core/http/BUILD b/test/core/http/BUILD index 03b8f4edfe..be51ea0737 100644 --- a/test/core/http/BUILD +++ b/test/core/http/BUILD @@ -113,3 +113,16 @@ grpc_cc_test( "//test/core/util:grpc_test_util", ], ) + +grpc_cc_test( + name = "format_request_test", + srcs = ["format_request_test.cc"], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//test/core/end2end:ssl_test_data", + "//test/core/util:gpr_test_util", + "//test/core/util:grpc_test_util", + ], +) diff --git a/test/cpp/performance/BUILD b/test/cpp/performance/BUILD new file mode 100644 index 0000000000..4fe95d5905 --- /dev/null +++ b/test/cpp/performance/BUILD @@ -0,0 +1,34 @@ +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache v2 + +load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_package") + +grpc_package(name = "test/cpp/performance") + +grpc_cc_test( + name = "writes_per_rpc_test", + srcs = ["writes_per_rpc_test.cc"], + external_deps = [ + "gtest", + ], + deps = [ + "//:gpr", + "//:grpc", + "//:grpc++", + "//src/proto/grpc/testing:echo_proto", + "//test/core/util:grpc_test_util_base", + ], +) -- cgit v1.2.3 From 5b30e468548a345a773ebdecab466ce7ad45ab0f Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Mon, 5 Feb 2018 14:22:24 -0800 Subject: Define the tests as grpc_cc_test to automatically test against all polling strategies --- test/core/bad_client/generate_tests.bzl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/core') diff --git a/test/core/bad_client/generate_tests.bzl b/test/core/bad_client/generate_tests.bzl index b595defb8c..ba91e2c213 100755 --- a/test/core/bad_client/generate_tests.bzl +++ b/test/core/bad_client/generate_tests.bzl @@ -16,6 +16,7 @@ """Generates the appropriate build.json data for all the bad_client tests.""" +load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library") def test_options(): return struct() @@ -36,14 +37,14 @@ BAD_CLIENT_TESTS = { } def grpc_bad_client_tests(): - native.cc_library( + grpc_cc_library( name = 'bad_client_test', srcs = ['bad_client.cc'], hdrs = ['bad_client.h'], deps = ['//test/core/util:grpc_test_util', '//:grpc', '//:gpr', '//test/core/end2end:cq_verifier'] ) for t, topt in BAD_CLIENT_TESTS.items(): - native.cc_test( + grpc_cc_test( name = '%s_bad_client_test' % t, srcs = ['tests/%s.cc' % t], deps = [':bad_client_test'], -- cgit v1.2.3 From a3b99294a09485b62715d76ebffd09a01f474216 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Mon, 5 Feb 2018 14:44:59 -0800 Subject: Get bazel tests for bad_ssl working --- test/core/bad_ssl/generate_tests.bzl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'test/core') diff --git a/test/core/bad_ssl/generate_tests.bzl b/test/core/bad_ssl/generate_tests.bzl index b7cb8f86e6..f2eab54904 100755 --- a/test/core/bad_ssl/generate_tests.bzl +++ b/test/core/bad_ssl/generate_tests.bzl @@ -26,12 +26,22 @@ def grpc_bad_ssl_tests(): name = 'bad_ssl_test_server', srcs = ['server_common.cc'], hdrs = ['server_common.h'], - deps = ['//test/core/util:grpc_test_util', '//:grpc', '//test/core/end2end:ssl_test_data'] + deps = ['//test/core/util:grpc_test_util', + '//:grpc', + '//test/core/end2end:ssl_test_data'] ) for t in BAD_SSL_TESTS: - native.cc_test( + native.cc_binary( name = 'bad_ssl_%s_server' % t, srcs = ['servers/%s.cc' % t], deps = [':bad_ssl_test_server'], ) + native.cc_test( + name = 'bad_ssl_%s_test' % t, + srcs = ['bad_ssl_test.cc'], + data = [':bad_ssl_%s_server' % t], + deps = ['//test/core/util:grpc_test_util', + '//:gpr', + '//test/core/end2end:cq_verifier'], + ) -- cgit v1.2.3 From 08d9f3df3038a88d7ae69aa9e65da29e296946d2 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 6 Feb 2018 07:58:17 -0800 Subject: Change Ref() methods to return a RefCountedPtr<>. --- BUILD | 2 ++ src/core/ext/filters/client_channel/subchannel.cc | 8 +++-- src/core/ext/filters/client_channel/subchannel.h | 4 ++- src/core/lib/gprpp/orphanable.h | 41 ++++++++++++++++++----- src/core/lib/gprpp/ref_counted.h | 40 +++++++++++++++++++--- src/core/lib/gprpp/ref_counted_ptr.h | 18 +++++++--- test/core/gprpp/orphanable_test.cc | 20 +++++++---- test/core/gprpp/ref_counted_ptr_test.cc | 7 ++-- test/core/gprpp/ref_counted_test.cc | 13 ++++--- 9 files changed, 119 insertions(+), 34 deletions(-) (limited to 'test/core') diff --git a/BUILD b/BUILD index 1779575c42..78479ce787 100644 --- a/BUILD +++ b/BUILD @@ -599,6 +599,7 @@ grpc_cc_library( public_hdrs = ["src/core/lib/gprpp/orphanable.h"], deps = [ "debug_location", + "ref_counted_ptr", "gpr++_base", "grpc_trace", ], @@ -610,6 +611,7 @@ grpc_cc_library( public_hdrs = ["src/core/lib/gprpp/ref_counted.h"], deps = [ "debug_location", + "ref_counted_ptr", "gpr++_base", "grpc_trace", ], diff --git a/src/core/ext/filters/client_channel/subchannel.cc b/src/core/ext/filters/client_channel/subchannel.cc index dc1beee165..6bf710c948 100644 --- a/src/core/ext/filters/client_channel/subchannel.cc +++ b/src/core/ext/filters/client_channel/subchannel.cc @@ -738,8 +738,9 @@ grpc_arg grpc_create_subchannel_address_arg(const grpc_resolved_address* addr) { } namespace grpc_core { + ConnectedSubchannel::ConnectedSubchannel(grpc_channel_stack* channel_stack) - : grpc_core::RefCountedWithTracing(&grpc_trace_stream_refcount), + : RefCountedWithTracing(&grpc_trace_stream_refcount), channel_stack_(channel_stack) {} ConnectedSubchannel::~ConnectedSubchannel() { @@ -774,7 +775,9 @@ grpc_error* ConnectedSubchannel::CreateCall(const CallArgs& args, args.arena, sizeof(grpc_subchannel_call) + channel_stack_->call_stack_size); grpc_call_stack* callstk = SUBCHANNEL_CALL_TO_CALL_STACK(*call); - Ref(DEBUG_LOCATION, "subchannel_call"); + RefCountedPtr connection = + Ref(DEBUG_LOCATION, "subchannel_call"); + connection.release(); // Ref is passed to the grpc_subchannel_call object. (*call)->connection = this; const grpc_call_element_args call_args = { callstk, /* call_stack */ @@ -796,4 +799,5 @@ grpc_error* ConnectedSubchannel::CreateCall(const CallArgs& args, grpc_call_stack_set_pollset_or_pollset_set(callstk, args.pollent); return GRPC_ERROR_NONE; } + } // namespace grpc_core diff --git a/src/core/ext/filters/client_channel/subchannel.h b/src/core/ext/filters/client_channel/subchannel.h index b7593ec911..d2b45ae9c8 100644 --- a/src/core/ext/filters/client_channel/subchannel.h +++ b/src/core/ext/filters/client_channel/subchannel.h @@ -68,7 +68,8 @@ typedef struct grpc_subchannel_key grpc_subchannel_key; #endif namespace grpc_core { -class ConnectedSubchannel : public grpc_core::RefCountedWithTracing { + +class ConnectedSubchannel : public RefCountedWithTracing { public: struct CallArgs { grpc_polling_entity* pollent; @@ -93,6 +94,7 @@ class ConnectedSubchannel : public grpc_core::RefCountedWithTracing { private: grpc_channel_stack* channel_stack_; }; + } // namespace grpc_core grpc_subchannel* grpc_subchannel_ref( diff --git a/src/core/lib/gprpp/orphanable.h b/src/core/lib/gprpp/orphanable.h index 50199730c9..6e127c2861 100644 --- a/src/core/lib/gprpp/orphanable.h +++ b/src/core/lib/gprpp/orphanable.h @@ -28,6 +28,7 @@ #include "src/core/lib/gprpp/abstract.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/memory.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" namespace grpc_core { @@ -69,6 +70,7 @@ inline OrphanablePtr MakeOrphanable(Args&&... args) { } // A type of Orphanable with internal ref-counting. +template class InternallyRefCounted : public Orphanable { public: // Not copyable nor movable. @@ -78,10 +80,20 @@ class InternallyRefCounted : public Orphanable { GRPC_ABSTRACT_BASE_CLASS protected: + // Allow Delete() to access destructor. + template + friend void Delete(T*); + + // Allow RefCountedPtr<> to access Unref() and IncrementRefCount(). + friend class RefCountedPtr; + InternallyRefCounted() { gpr_ref_init(&refs_, 1); } virtual ~InternallyRefCounted() {} - void Ref() { gpr_ref(&refs_); } + RefCountedPtr Ref() GRPC_MUST_USE_RESULT { + IncrementRefCount(); + return RefCountedPtr(reinterpret_cast(this)); + } void Unref() { if (gpr_unref(&refs_)) { @@ -89,11 +101,9 @@ class InternallyRefCounted : public Orphanable { } } - // Allow Delete() to access destructor. - template - friend void Delete(T*); - private: + void IncrementRefCount() { gpr_ref(&refs_); } + gpr_refcount refs_; }; @@ -103,6 +113,7 @@ class InternallyRefCounted : public Orphanable { // pointers and legacy code that is manually calling Ref() and Unref(). // Once all of our code is converted to idiomatic C++, we may be able to // eliminate this class. +template class InternallyRefCountedWithTracing : public Orphanable { public: // Not copyable nor movable. @@ -118,6 +129,9 @@ class InternallyRefCountedWithTracing : public Orphanable { template friend void Delete(T*); + // Allow RefCountedPtr<> to access Unref() and IncrementRefCount(). + friend class RefCountedPtr; + InternallyRefCountedWithTracing() : InternallyRefCountedWithTracing(static_cast(nullptr)) {} @@ -133,18 +147,27 @@ class InternallyRefCountedWithTracing : public Orphanable { virtual ~InternallyRefCountedWithTracing() {} - void Ref() { gpr_ref(&refs_); } + RefCountedPtr Ref() GRPC_MUST_USE_RESULT { + IncrementRefCount(); + return RefCountedPtr(reinterpret_cast(this)); + } - void Ref(const DebugLocation& location, const char* reason) { + RefCountedPtr Ref(const DebugLocation& location, + const char* reason) GRPC_MUST_USE_RESULT { if (location.Log() && trace_flag_ != nullptr && trace_flag_->enabled()) { gpr_atm old_refs = gpr_atm_no_barrier_load(&refs_.count); gpr_log(GPR_DEBUG, "%s:%p %s:%d ref %" PRIdPTR " -> %" PRIdPTR " %s", trace_flag_->name(), this, location.file(), location.line(), old_refs, old_refs + 1, reason); } - Ref(); + return Ref(); } + // TODO(roth): Once all of our code is converted to C++ and can use + // RefCountedPtr<> instead of manual ref-counting, make the Unref() methods + // private, since they will only be used by RefCountedPtr<>, which is a + // friend of this class. + void Unref() { if (gpr_unref(&refs_)) { Delete(this); @@ -162,6 +185,8 @@ class InternallyRefCountedWithTracing : public Orphanable { } private: + void IncrementRefCount() { gpr_ref(&refs_); } + TraceFlag* trace_flag_ = nullptr; gpr_refcount refs_; }; diff --git a/src/core/lib/gprpp/ref_counted.h b/src/core/lib/gprpp/ref_counted.h index c68118a71a..16c7912fc6 100644 --- a/src/core/lib/gprpp/ref_counted.h +++ b/src/core/lib/gprpp/ref_counted.h @@ -26,16 +26,28 @@ #include "src/core/lib/gprpp/abstract.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/memory.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" namespace grpc_core { // A base class for reference-counted objects. // New objects should be created via New() and start with a refcount of 1. // When the refcount reaches 0, the object will be deleted via Delete(). +// +// This will commonly be used by CRTP (curiously-recurring template pattern) +// e.g., class MyClass : public RefCounted +template class RefCounted { public: - void Ref() { gpr_ref(&refs_); } + RefCountedPtr Ref() GRPC_MUST_USE_RESULT { + IncrementRefCount(); + return RefCountedPtr(reinterpret_cast(this)); + } + // TODO(roth): Once all of our code is converted to C++ and can use + // RefCountedPtr<> instead of manual ref-counting, make this method + // private, since it will only be used by RefCountedPtr<>, which is a + // friend of this class. void Unref() { if (gpr_unref(&refs_)) { Delete(this); @@ -58,6 +70,11 @@ class RefCounted { virtual ~RefCounted() {} private: + // Allow RefCountedPtr<> to access IncrementRefCount(). + friend class RefCountedPtr; + + void IncrementRefCount() { gpr_ref(&refs_); } + gpr_refcount refs_; }; @@ -67,20 +84,30 @@ class RefCounted { // pointers and legacy code that is manually calling Ref() and Unref(). // Once all of our code is converted to idiomatic C++, we may be able to // eliminate this class. +template class RefCountedWithTracing { public: - void Ref() { gpr_ref(&refs_); } + RefCountedPtr Ref() GRPC_MUST_USE_RESULT { + IncrementRefCount(); + return RefCountedPtr(reinterpret_cast(this)); + } - void Ref(const DebugLocation& location, const char* reason) { + RefCountedPtr Ref(const DebugLocation& location, + const char* reason) GRPC_MUST_USE_RESULT { if (location.Log() && trace_flag_ != nullptr && trace_flag_->enabled()) { gpr_atm old_refs = gpr_atm_no_barrier_load(&refs_.count); gpr_log(GPR_DEBUG, "%s:%p %s:%d ref %" PRIdPTR " -> %" PRIdPTR " %s", trace_flag_->name(), this, location.file(), location.line(), old_refs, old_refs + 1, reason); } - Ref(); + return Ref(); } + // TODO(roth): Once all of our code is converted to C++ and can use + // RefCountedPtr<> instead of manual ref-counting, make the Unref() methods + // private, since they will only be used by RefCountedPtr<>, which is a + // friend of this class. + void Unref() { if (gpr_unref(&refs_)) { Delete(this); @@ -124,6 +151,11 @@ class RefCountedWithTracing { virtual ~RefCountedWithTracing() {} private: + // Allow RefCountedPtr<> to access IncrementRefCount(). + friend class RefCountedPtr; + + void IncrementRefCount() { gpr_ref(&refs_); } + TraceFlag* trace_flag_ = nullptr; gpr_refcount refs_; }; diff --git a/src/core/lib/gprpp/ref_counted_ptr.h b/src/core/lib/gprpp/ref_counted_ptr.h index dda0f00d79..f82ba50da3 100644 --- a/src/core/lib/gprpp/ref_counted_ptr.h +++ b/src/core/lib/gprpp/ref_counted_ptr.h @@ -25,8 +25,8 @@ namespace grpc_core { -// A smart pointer class for objects that provide Ref() and Unref() methods, -// such as those provided by the RefCounted base class. +// A smart pointer class for objects that provide IncrementRefCount() and +// Unref() methods, such as those provided by the RefCounted base class. template class RefCountedPtr { public: @@ -49,13 +49,13 @@ class RefCountedPtr { // Copy support. RefCountedPtr(const RefCountedPtr& other) { - if (other.value_ != nullptr) other.value_->Ref(); + if (other.value_ != nullptr) other.value_->IncrementRefCount(); value_ = other.value_; } RefCountedPtr& operator=(const RefCountedPtr& other) { // Note: Order of reffing and unreffing is important here in case value_ // and other.value_ are the same object. - if (other.value_ != nullptr) other.value_->Ref(); + if (other.value_ != nullptr) other.value_->IncrementRefCount(); if (value_ != nullptr) value_->Unref(); value_ = other.value_; return *this; @@ -71,6 +71,16 @@ class RefCountedPtr { value_ = value; } + // TODO(roth): This method exists solely as a transition mechanism to allow + // us to pass a ref to idiomatic C code that does not use RefCountedPtr<>. + // Once all of our code has been converted to idiomatic C++, this + // method should go away. + T* release() { + T* value = value_; + value_ = nullptr; + return value; + } + T* get() const { return value_; } T& operator*() const { return *value_; } diff --git a/test/core/gprpp/orphanable_test.cc b/test/core/gprpp/orphanable_test.cc index ff2f6d8bc2..ad6b9ac867 100644 --- a/test/core/gprpp/orphanable_test.cc +++ b/test/core/gprpp/orphanable_test.cc @@ -58,18 +58,19 @@ TEST(MakeOrphanable, WithParameters) { EXPECT_EQ(5, foo->value()); } -class Bar : public InternallyRefCounted { +class Bar : public InternallyRefCounted { public: Bar() : Bar(0) {} explicit Bar(int value) : value_(value) {} void Orphan() override { Unref(); } int value() const { return value_; } - void StartWork() { Ref(); } - void FinishWork() { Unref(); } + void StartWork() { self_ref_ = Ref(); } + void FinishWork() { self_ref_.reset(); } private: int value_; + RefCountedPtr self_ref_; }; TEST(OrphanablePtr, InternallyRefCounted) { @@ -82,19 +83,24 @@ TEST(OrphanablePtr, InternallyRefCounted) { // things build properly in both debug and non-debug cases. DebugOnlyTraceFlag baz_tracer(true, "baz"); -class Baz : public InternallyRefCountedWithTracing { +class Baz : public InternallyRefCountedWithTracing { public: Baz() : Baz(0) {} explicit Baz(int value) - : InternallyRefCountedWithTracing(&baz_tracer), value_(value) {} + : InternallyRefCountedWithTracing(&baz_tracer), value_(value) {} void Orphan() override { Unref(); } int value() const { return value_; } - void StartWork() { Ref(DEBUG_LOCATION, "work"); } - void FinishWork() { Unref(DEBUG_LOCATION, "work"); } + void StartWork() { self_ref_ = Ref(DEBUG_LOCATION, "work"); } + void FinishWork() { + // This is a little ugly, but it makes the logged ref and unref match up. + self_ref_.release(); + Unref(DEBUG_LOCATION, "work"); + } private: int value_; + RefCountedPtr self_ref_; }; TEST(OrphanablePtr, InternallyRefCountedWithTracing) { diff --git a/test/core/gprpp/ref_counted_ptr_test.cc b/test/core/gprpp/ref_counted_ptr_test.cc index f1f13f3183..2e398a7722 100644 --- a/test/core/gprpp/ref_counted_ptr_test.cc +++ b/test/core/gprpp/ref_counted_ptr_test.cc @@ -30,7 +30,7 @@ namespace grpc_core { namespace testing { namespace { -class Foo : public RefCounted { +class Foo : public RefCounted { public: Foo() : value_(0) {} @@ -163,14 +163,15 @@ TEST(MakeRefCounted, Args) { TraceFlag foo_tracer(true, "foo"); -class FooWithTracing : public RefCountedWithTracing { +class FooWithTracing : public RefCountedWithTracing { public: FooWithTracing() : RefCountedWithTracing(&foo_tracer) {} }; TEST(RefCountedPtr, RefCountedWithTracing) { RefCountedPtr foo(New()); - foo->Ref(DEBUG_LOCATION, "foo"); + RefCountedPtr foo2 = foo->Ref(DEBUG_LOCATION, "foo"); + foo2.release(); foo->Unref(DEBUG_LOCATION, "foo"); } diff --git a/test/core/gprpp/ref_counted_test.cc b/test/core/gprpp/ref_counted_test.cc index b1b0fee5c0..f85a2e4675 100644 --- a/test/core/gprpp/ref_counted_test.cc +++ b/test/core/gprpp/ref_counted_test.cc @@ -27,7 +27,7 @@ namespace grpc_core { namespace testing { namespace { -class Foo : public RefCounted { +class Foo : public RefCounted { public: Foo() {} }; @@ -39,7 +39,8 @@ TEST(RefCounted, Basic) { TEST(RefCounted, ExtraRef) { Foo* foo = New(); - foo->Ref(); + RefCountedPtr foop = foo->Ref(); + foop.release(); foo->Unref(); foo->Unref(); } @@ -48,17 +49,19 @@ TEST(RefCounted, ExtraRef) { // things build properly in both debug and non-debug cases. DebugOnlyTraceFlag foo_tracer(true, "foo"); -class FooWithTracing : public RefCountedWithTracing { +class FooWithTracing : public RefCountedWithTracing { public: FooWithTracing() : RefCountedWithTracing(&foo_tracer) {} }; TEST(RefCountedWithTracing, Basic) { FooWithTracing* foo = New(); - foo->Ref(DEBUG_LOCATION, "extra_ref"); + RefCountedPtr foop = foo->Ref(DEBUG_LOCATION, "extra_ref"); + foop.release(); foo->Unref(DEBUG_LOCATION, "extra_ref"); // Can use the no-argument methods, too. - foo->Ref(); + foop = foo->Ref(); + foop.release(); foo->Unref(); foo->Unref(DEBUG_LOCATION, "original_ref"); } -- cgit v1.2.3 From 18a356c9fa49f32627481f312b03aa34ff711456 Mon Sep 17 00:00:00 2001 From: adelez Date: Tue, 6 Feb 2018 14:34:35 -0800 Subject: Revert "Define the tests as grpc_cc_test to automatically test against all po…" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/core/bad_client/generate_tests.bzl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/core') diff --git a/test/core/bad_client/generate_tests.bzl b/test/core/bad_client/generate_tests.bzl index ba91e2c213..b595defb8c 100755 --- a/test/core/bad_client/generate_tests.bzl +++ b/test/core/bad_client/generate_tests.bzl @@ -16,7 +16,6 @@ """Generates the appropriate build.json data for all the bad_client tests.""" -load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library") def test_options(): return struct() @@ -37,14 +36,14 @@ BAD_CLIENT_TESTS = { } def grpc_bad_client_tests(): - grpc_cc_library( + native.cc_library( name = 'bad_client_test', srcs = ['bad_client.cc'], hdrs = ['bad_client.h'], deps = ['//test/core/util:grpc_test_util', '//:grpc', '//:gpr', '//test/core/end2end:cq_verifier'] ) for t, topt in BAD_CLIENT_TESTS.items(): - grpc_cc_test( + native.cc_test( name = '%s_bad_client_test' % t, srcs = ['tests/%s.cc' % t], deps = [':bad_client_test'], -- cgit v1.2.3 From 6f0b195d2003dbf8daf0dc31916aecac738ad45c Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 6 Feb 2018 17:40:34 -0800 Subject: Replace GRPC_COMPRESS_MESSAGE_* with GRPC_COMPRESS_* --- include/grpc/impl/codegen/compression_types.h | 4 +- src/core/lib/compression/compression.cc | 23 ++++++----- src/core/lib/compression/compression_internal.cc | 8 ++-- src/core/lib/compression/compression_ruby.cc | 8 ++-- src/objective-c/GRPCClient/GRPCCall+ChannelArg.m | 4 +- src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi | 4 +- .../grpcio/grpc/_cython/_cygrpc/records.pyx.pxi | 4 +- test/core/channel/channel_args_test.cc | 14 +++---- test/core/compression/compression_test.cc | 44 +++++++++++----------- test/core/end2end/fixtures/h2_compress.cc | 4 +- test/core/end2end/tests/compressed_payload.cc | 34 ++++++++--------- .../tests/stream_compression_compressed_payload.cc | 4 +- .../end2end/tests/workaround_cronet_compression.cc | 13 +++---- test/core/surface/byte_buffer_reader_test.cc | 6 +-- test/cpp/end2end/end2end_test.cc | 2 +- test/cpp/end2end/filter_end2end_test.cc | 2 +- test/cpp/end2end/generic_end2end_test.cc | 2 +- test/cpp/end2end/server_builder_plugin_test.cc | 2 +- test/cpp/interop/interop_client.cc | 4 +- 19 files changed, 91 insertions(+), 95 deletions(-) (limited to 'test/core') diff --git a/include/grpc/impl/codegen/compression_types.h b/include/grpc/impl/codegen/compression_types.h index ddc667fcdb..be9dd2d8e7 100644 --- a/include/grpc/impl/codegen/compression_types.h +++ b/include/grpc/impl/codegen/compression_types.h @@ -55,8 +55,8 @@ extern "C" { /** The various compression algorithms supported by gRPC */ typedef enum { GRPC_COMPRESS_NONE = 0, - GRPC_COMPRESS_MESSAGE_DEFLATE, - GRPC_COMPRESS_MESSAGE_GZIP, + GRPC_COMPRESS_DEFLATE, + GRPC_COMPRESS_GZIP, GRPC_COMPRESS_STREAM_GZIP, /* TODO(ctiller): snappy */ GRPC_COMPRESS_ALGORITHMS_COUNT diff --git a/src/core/lib/compression/compression.cc b/src/core/lib/compression/compression.cc index 99e6014b23..4db7d0f47b 100644 --- a/src/core/lib/compression/compression.cc +++ b/src/core/lib/compression/compression.cc @@ -29,8 +29,7 @@ int grpc_compression_algorithm_is_message( grpc_compression_algorithm algorithm) { - return (algorithm >= GRPC_COMPRESS_MESSAGE_DEFLATE && - algorithm <= GRPC_COMPRESS_MESSAGE_GZIP) + return (algorithm >= GRPC_COMPRESS_DEFLATE && algorithm <= GRPC_COMPRESS_GZIP) ? 1 : 0; } @@ -45,10 +44,10 @@ int grpc_compression_algorithm_parse(grpc_slice name, *algorithm = GRPC_COMPRESS_NONE; return 1; } else if (grpc_slice_eq(name, GRPC_MDSTR_MESSAGE_SLASH_DEFLATE)) { - *algorithm = GRPC_COMPRESS_MESSAGE_DEFLATE; + *algorithm = GRPC_COMPRESS_DEFLATE; return 1; } else if (grpc_slice_eq(name, GRPC_MDSTR_MESSAGE_SLASH_GZIP)) { - *algorithm = GRPC_COMPRESS_MESSAGE_GZIP; + *algorithm = GRPC_COMPRESS_GZIP; return 1; } else if (grpc_slice_eq(name, GRPC_MDSTR_STREAM_SLASH_GZIP)) { *algorithm = GRPC_COMPRESS_STREAM_GZIP; @@ -67,10 +66,10 @@ int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm, case GRPC_COMPRESS_NONE: *name = "identity"; return 1; - case GRPC_COMPRESS_MESSAGE_DEFLATE: + case GRPC_COMPRESS_DEFLATE: *name = "message/deflate"; return 1; - case GRPC_COMPRESS_MESSAGE_GZIP: + case GRPC_COMPRESS_GZIP: *name = "message/gzip"; return 1; case GRPC_COMPRESS_STREAM_GZIP: @@ -133,9 +132,9 @@ grpc_slice grpc_compression_algorithm_slice( switch (algorithm) { case GRPC_COMPRESS_NONE: return GRPC_MDSTR_IDENTITY; - case GRPC_COMPRESS_MESSAGE_DEFLATE: + case GRPC_COMPRESS_DEFLATE: return GRPC_MDSTR_MESSAGE_SLASH_DEFLATE; - case GRPC_COMPRESS_MESSAGE_GZIP: + case GRPC_COMPRESS_GZIP: return GRPC_MDSTR_MESSAGE_SLASH_GZIP; case GRPC_COMPRESS_STREAM_GZIP: return GRPC_MDSTR_STREAM_SLASH_GZIP; @@ -149,9 +148,9 @@ grpc_compression_algorithm grpc_compression_algorithm_from_slice( grpc_slice str) { if (grpc_slice_eq(str, GRPC_MDSTR_IDENTITY)) return GRPC_COMPRESS_NONE; if (grpc_slice_eq(str, GRPC_MDSTR_MESSAGE_SLASH_DEFLATE)) - return GRPC_COMPRESS_MESSAGE_DEFLATE; + return GRPC_COMPRESS_DEFLATE; if (grpc_slice_eq(str, GRPC_MDSTR_MESSAGE_SLASH_GZIP)) - return GRPC_COMPRESS_MESSAGE_GZIP; + return GRPC_COMPRESS_GZIP; if (grpc_slice_eq(str, GRPC_MDSTR_STREAM_SLASH_GZIP)) return GRPC_COMPRESS_STREAM_GZIP; return GRPC_COMPRESS_ALGORITHMS_COUNT; @@ -162,9 +161,9 @@ grpc_mdelem grpc_compression_encoding_mdelem( switch (algorithm) { case GRPC_COMPRESS_NONE: return GRPC_MDELEM_GRPC_ENCODING_IDENTITY; - case GRPC_COMPRESS_MESSAGE_DEFLATE: + case GRPC_COMPRESS_DEFLATE: return GRPC_MDELEM_GRPC_ENCODING_DEFLATE; - case GRPC_COMPRESS_MESSAGE_GZIP: + case GRPC_COMPRESS_GZIP: return GRPC_MDELEM_GRPC_ENCODING_GZIP; case GRPC_COMPRESS_STREAM_GZIP: return GRPC_MDELEM_GRPC_ENCODING_GZIP; diff --git a/src/core/lib/compression/compression_internal.cc b/src/core/lib/compression/compression_internal.cc index 263cdf06eb..1b7ead3301 100644 --- a/src/core/lib/compression/compression_internal.cc +++ b/src/core/lib/compression/compression_internal.cc @@ -80,9 +80,9 @@ grpc_message_compression_algorithm grpc_compression_algorithm_to_message_compression_algorithm( grpc_compression_algorithm algo) { switch (algo) { - case GRPC_COMPRESS_MESSAGE_DEFLATE: + case GRPC_COMPRESS_DEFLATE: return GRPC_MESSAGE_COMPRESS_DEFLATE; - case GRPC_COMPRESS_MESSAGE_GZIP: + case GRPC_COMPRESS_GZIP: return GRPC_MESSAGE_COMPRESS_GZIP; default: return GRPC_MESSAGE_COMPRESS_NONE; @@ -147,10 +147,10 @@ int grpc_compression_algorithm_from_message_stream_compression_algorithm( *algorithm = GRPC_COMPRESS_NONE; return 1; case GRPC_MESSAGE_COMPRESS_DEFLATE: - *algorithm = GRPC_COMPRESS_MESSAGE_DEFLATE; + *algorithm = GRPC_COMPRESS_DEFLATE; return 1; case GRPC_MESSAGE_COMPRESS_GZIP: - *algorithm = GRPC_COMPRESS_MESSAGE_GZIP; + *algorithm = GRPC_COMPRESS_GZIP; return 1; default: *algorithm = GRPC_COMPRESS_NONE; diff --git a/src/core/lib/compression/compression_ruby.cc b/src/core/lib/compression/compression_ruby.cc index 293062f5ed..7082d6bd19 100644 --- a/src/core/lib/compression/compression_ruby.cc +++ b/src/core/lib/compression/compression_ruby.cc @@ -28,10 +28,10 @@ int grpc_compression_algorithm_parse_ruby( *algorithm = GRPC_COMPRESS_NONE; return 1; } else if (grpc_slice_eq(name, GRPC_MDSTR_DEFLATE)) { - *algorithm = GRPC_COMPRESS_MESSAGE_DEFLATE; + *algorithm = GRPC_COMPRESS_DEFLATE; return 1; } else if (grpc_slice_eq(name, GRPC_MDSTR_GZIP)) { - *algorithm = GRPC_COMPRESS_MESSAGE_GZIP; + *algorithm = GRPC_COMPRESS_GZIP; return 1; } else if (grpc_slice_eq(name, GRPC_MDSTR_STREAM_SLASH_GZIP)) { *algorithm = GRPC_COMPRESS_STREAM_GZIP; @@ -50,10 +50,10 @@ int grpc_compression_algorithm_name_ruby(grpc_compression_algorithm algorithm, case GRPC_COMPRESS_NONE: *name = "identity"; return 1; - case GRPC_COMPRESS_MESSAGE_DEFLATE: + case GRPC_COMPRESS_DEFLATE: *name = "deflate"; return 1; - case GRPC_COMPRESS_MESSAGE_GZIP: + case GRPC_COMPRESS_GZIP: *name = "gzip"; return 1; case GRPC_COMPRESS_STREAM_GZIP: diff --git a/src/objective-c/GRPCClient/GRPCCall+ChannelArg.m b/src/objective-c/GRPCClient/GRPCCall+ChannelArg.m index d44e39f551..805e54b890 100644 --- a/src/objective-c/GRPCClient/GRPCCall+ChannelArg.m +++ b/src/objective-c/GRPCClient/GRPCCall+ChannelArg.m @@ -46,10 +46,10 @@ hostConfig.compressAlgorithm = GRPC_COMPRESS_NONE; break; case GRPCCompressDeflate: - hostConfig.compressAlgorithm = GRPC_COMPRESS_MESSAGE_DEFLATE; + hostConfig.compressAlgorithm = GRPC_COMPRESS_DEFLATE; break; case GRPCCompressGzip: - hostConfig.compressAlgorithm = GRPC_COMPRESS_MESSAGE_GZIP; + hostConfig.compressAlgorithm = GRPC_COMPRESS_GZIP; break; default: NSLog(@"Invalid compression algorithm"); diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi index 30253fc20c..a4c0319553 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi @@ -557,8 +557,8 @@ cdef extern from "grpc/compression.h": ctypedef enum grpc_compression_algorithm: GRPC_COMPRESS_NONE - GRPC_COMPRESS_MESSAGE_DEFLATE - GRPC_COMPRESS_MESSAGE_GZIP + GRPC_COMPRESS_DEFLATE + GRPC_COMPRESS_GZIP GRPC_COMPRESS_STREAM_GZIP GRPC_COMPRESS_ALGORITHMS_COUNT diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi index 1bcea8d347..ecd991685f 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi @@ -112,8 +112,8 @@ class OperationType: class CompressionAlgorithm: none = GRPC_COMPRESS_NONE - deflate = GRPC_COMPRESS_MESSAGE_DEFLATE - gzip = GRPC_COMPRESS_MESSAGE_GZIP + deflate = GRPC_COMPRESS_DEFLATE + gzip = GRPC_COMPRESS_GZIP class CompressionLevel: diff --git a/test/core/channel/channel_args_test.cc b/test/core/channel/channel_args_test.cc index 5b0a770c84..dda04f4c5e 100644 --- a/test/core/channel/channel_args_test.cc +++ b/test/core/channel/channel_args_test.cc @@ -62,8 +62,8 @@ static void test_set_compression_algorithm(void) { grpc_core::ExecCtx exec_ctx; grpc_channel_args* ch_args; - ch_args = grpc_channel_args_set_compression_algorithm( - nullptr, GRPC_COMPRESS_MESSAGE_GZIP); + ch_args = + grpc_channel_args_set_compression_algorithm(nullptr, GRPC_COMPRESS_GZIP); GPR_ASSERT(ch_args->num_args == 1); GPR_ASSERT(strcmp(ch_args->args[0].key, GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM) == 0); @@ -90,10 +90,10 @@ static void test_compression_algorithm_states(void) { /* disable message/gzip and message/deflate and stream/gzip */ ch_args_wo_gzip = grpc_channel_args_compression_algorithm_set_state( - &ch_args, GRPC_COMPRESS_MESSAGE_GZIP, 0); + &ch_args, GRPC_COMPRESS_GZIP, 0); GPR_ASSERT(ch_args == ch_args_wo_gzip); ch_args_wo_gzip_deflate = grpc_channel_args_compression_algorithm_set_state( - &ch_args_wo_gzip, GRPC_COMPRESS_MESSAGE_DEFLATE, 0); + &ch_args_wo_gzip, GRPC_COMPRESS_DEFLATE, 0); GPR_ASSERT(ch_args_wo_gzip == ch_args_wo_gzip_deflate); ch_args_wo_gzip_deflate_gzip = grpc_channel_args_compression_algorithm_set_state( @@ -103,7 +103,7 @@ static void test_compression_algorithm_states(void) { states_bitset = (unsigned)grpc_channel_args_compression_algorithm_get_states( ch_args_wo_gzip_deflate); for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) { - if (i == GRPC_COMPRESS_MESSAGE_GZIP || i == GRPC_COMPRESS_MESSAGE_DEFLATE || + if (i == GRPC_COMPRESS_GZIP || i == GRPC_COMPRESS_DEFLATE || i == GRPC_COMPRESS_STREAM_GZIP) { GPR_ASSERT(GPR_BITGET(states_bitset, i) == 0); } else { @@ -113,7 +113,7 @@ static void test_compression_algorithm_states(void) { /* re-enabled message/gzip and stream/gzip only */ ch_args_wo_gzip = grpc_channel_args_compression_algorithm_set_state( - &ch_args_wo_gzip_deflate_gzip, GRPC_COMPRESS_MESSAGE_GZIP, 1); + &ch_args_wo_gzip_deflate_gzip, GRPC_COMPRESS_GZIP, 1); ch_args_wo_gzip = grpc_channel_args_compression_algorithm_set_state( &ch_args_wo_gzip, GRPC_COMPRESS_STREAM_GZIP, 1); GPR_ASSERT(ch_args_wo_gzip == ch_args_wo_gzip_deflate_gzip); @@ -121,7 +121,7 @@ static void test_compression_algorithm_states(void) { states_bitset = (unsigned)grpc_channel_args_compression_algorithm_get_states( ch_args_wo_gzip); for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) { - if (i == GRPC_COMPRESS_MESSAGE_DEFLATE) { + if (i == GRPC_COMPRESS_DEFLATE) { GPR_ASSERT(GPR_BITGET(states_bitset, i) == 0); } else { GPR_ASSERT(GPR_BITGET(states_bitset, i) != 0); diff --git a/test/core/compression/compression_test.cc b/test/core/compression/compression_test.cc index e49a93a4b6..001591d6be 100644 --- a/test/core/compression/compression_test.cc +++ b/test/core/compression/compression_test.cc @@ -31,8 +31,8 @@ static void test_compression_algorithm_parse(void) { const char* valid_names[] = {"identity", "message/gzip", "message/deflate", "stream/gzip"}; const grpc_compression_algorithm valid_algorithms[] = { - GRPC_COMPRESS_NONE, GRPC_COMPRESS_MESSAGE_GZIP, - GRPC_COMPRESS_MESSAGE_DEFLATE, GRPC_COMPRESS_STREAM_GZIP}; + GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE, + GRPC_COMPRESS_STREAM_GZIP}; const char* invalid_names[] = {"gzip2", "foo", "", "2gzip"}; gpr_log(GPR_DEBUG, "test_compression_algorithm_parse"); @@ -64,8 +64,8 @@ static void test_compression_algorithm_name(void) { const char* valid_names[] = {"identity", "message/gzip", "message/deflate", "stream/gzip"}; const grpc_compression_algorithm valid_algorithms[] = { - GRPC_COMPRESS_NONE, GRPC_COMPRESS_MESSAGE_GZIP, - GRPC_COMPRESS_MESSAGE_DEFLATE, GRPC_COMPRESS_STREAM_GZIP}; + GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE, + GRPC_COMPRESS_STREAM_GZIP}; gpr_log(GPR_DEBUG, "test_compression_algorithm_name"); @@ -110,21 +110,21 @@ static void test_compression_algorithm_for_level(void) { /* accept only gzip */ uint32_t accepted_encodings = 0; GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ - GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_GZIP); + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_GZIP); GPR_ASSERT(GRPC_COMPRESS_NONE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == + GPR_ASSERT(GRPC_COMPRESS_GZIP == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == + GPR_ASSERT(GRPC_COMPRESS_GZIP == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == + GPR_ASSERT(GRPC_COMPRESS_GZIP == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH, accepted_encodings)); } @@ -133,21 +133,21 @@ static void test_compression_algorithm_for_level(void) { /* accept only deflate */ uint32_t accepted_encodings = 0; GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ - GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_DEFLATE); + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_DEFLATE); GPR_ASSERT(GRPC_COMPRESS_NONE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == + GPR_ASSERT(GRPC_COMPRESS_DEFLATE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == + GPR_ASSERT(GRPC_COMPRESS_DEFLATE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == + GPR_ASSERT(GRPC_COMPRESS_DEFLATE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH, accepted_encodings)); } @@ -156,22 +156,22 @@ static void test_compression_algorithm_for_level(void) { /* accept gzip and deflate */ uint32_t accepted_encodings = 0; GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ - GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_GZIP); - GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_DEFLATE); + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_GZIP); + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_DEFLATE); GPR_ASSERT(GRPC_COMPRESS_NONE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == + GPR_ASSERT(GRPC_COMPRESS_GZIP == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == + GPR_ASSERT(GRPC_COMPRESS_DEFLATE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == + GPR_ASSERT(GRPC_COMPRESS_DEFLATE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH, accepted_encodings)); } @@ -203,23 +203,23 @@ static void test_compression_algorithm_for_level(void) { /* accept all algorithms */ uint32_t accepted_encodings = 0; GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ - GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_GZIP); - GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_DEFLATE); + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_GZIP); + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_DEFLATE); GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_STREAM_GZIP); GPR_ASSERT(GRPC_COMPRESS_NONE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == + GPR_ASSERT(GRPC_COMPRESS_GZIP == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == + GPR_ASSERT(GRPC_COMPRESS_DEFLATE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == + GPR_ASSERT(GRPC_COMPRESS_DEFLATE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH, accepted_encodings)); } diff --git a/test/core/end2end/fixtures/h2_compress.cc b/test/core/end2end/fixtures/h2_compress.cc index 3625afefcd..5b9181586c 100644 --- a/test/core/end2end/fixtures/h2_compress.cc +++ b/test/core/end2end/fixtures/h2_compress.cc @@ -70,7 +70,7 @@ void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture* f, grpc_channel_args_destroy(ffd->client_args_compression); } ffd->client_args_compression = grpc_channel_args_set_compression_algorithm( - client_args, GRPC_COMPRESS_MESSAGE_GZIP); + client_args, GRPC_COMPRESS_GZIP); f->client = grpc_insecure_channel_create( ffd->localaddr, ffd->client_args_compression, nullptr); } @@ -84,7 +84,7 @@ void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture* f, grpc_channel_args_destroy(ffd->server_args_compression); } ffd->server_args_compression = grpc_channel_args_set_compression_algorithm( - server_args, GRPC_COMPRESS_MESSAGE_GZIP); + server_args, GRPC_COMPRESS_GZIP); if (f->server) { grpc_server_destroy(f->server); } diff --git a/test/core/end2end/tests/compressed_payload.cc b/test/core/end2end/tests/compressed_payload.cc index c08653b1c8..dff7cc152a 100644 --- a/test/core/end2end/tests/compressed_payload.cc +++ b/test/core/end2end/tests/compressed_payload.cc @@ -383,9 +383,9 @@ static void request_with_payload_template( GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), GRPC_COMPRESS_NONE) != 0); GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), - GRPC_COMPRESS_MESSAGE_DEFLATE) != 0); + GRPC_COMPRESS_DEFLATE) != 0); GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), - GRPC_COMPRESS_MESSAGE_GZIP) != 0); + GRPC_COMPRESS_GZIP) != 0); memset(ops, 0, sizeof(ops)); op = ops; @@ -550,9 +550,8 @@ static void test_invoke_request_with_exceptionally_uncompressed_payload( grpc_end2end_test_config config) { request_with_payload_template( config, "test_invoke_request_with_exceptionally_uncompressed_payload", - GRPC_WRITE_NO_COMPRESS, GRPC_COMPRESS_MESSAGE_GZIP, - GRPC_COMPRESS_MESSAGE_GZIP, GRPC_COMPRESS_NONE, - GRPC_COMPRESS_MESSAGE_GZIP, nullptr, false, + GRPC_WRITE_NO_COMPRESS, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, + GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, nullptr, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE, false); } @@ -569,8 +568,8 @@ static void test_invoke_request_with_compressed_payload( grpc_end2end_test_config config) { request_with_payload_template( config, "test_invoke_request_with_compressed_payload", 0, - GRPC_COMPRESS_MESSAGE_GZIP, GRPC_COMPRESS_MESSAGE_GZIP, - GRPC_COMPRESS_MESSAGE_GZIP, GRPC_COMPRESS_MESSAGE_GZIP, nullptr, false, + GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, + GRPC_COMPRESS_GZIP, nullptr, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE, false); } @@ -578,8 +577,8 @@ static void test_invoke_request_with_send_message_before_initial_metadata( grpc_end2end_test_config config) { request_with_payload_template( config, "test_invoke_request_with_compressed_payload", 0, - GRPC_COMPRESS_MESSAGE_GZIP, GRPC_COMPRESS_MESSAGE_GZIP, - GRPC_COMPRESS_MESSAGE_GZIP, GRPC_COMPRESS_MESSAGE_GZIP, nullptr, false, + GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, + GRPC_COMPRESS_GZIP, nullptr, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE, true); } @@ -611,32 +610,31 @@ static void test_invoke_request_with_compressed_payload_md_override( /* Channel default NONE (aka IDENTITY), call override to GZIP */ request_with_payload_template( config, "test_invoke_request_with_compressed_payload_md_override_1", 0, - GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_MESSAGE_GZIP, + GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_NONE, &gzip_compression_override, false, /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false); /* Channel default DEFLATE, call override to GZIP */ request_with_payload_template( config, "test_invoke_request_with_compressed_payload_md_override_2", 0, - GRPC_COMPRESS_MESSAGE_DEFLATE, GRPC_COMPRESS_NONE, - GRPC_COMPRESS_MESSAGE_GZIP, GRPC_COMPRESS_NONE, - &gzip_compression_override, false, + GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, + GRPC_COMPRESS_NONE, &gzip_compression_override, false, /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false); /* Channel default DEFLATE, call override to NONE (aka IDENTITY) */ request_with_payload_template( config, "test_invoke_request_with_compressed_payload_md_override_3", 0, - GRPC_COMPRESS_MESSAGE_DEFLATE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, + GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, &identity_compression_override, false, /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false); } static void test_invoke_request_with_disabled_algorithm( grpc_end2end_test_config config) { - request_for_disabled_algorithm( - config, "test_invoke_request_with_disabled_algorithm", 0, - GRPC_COMPRESS_MESSAGE_GZIP, GRPC_COMPRESS_MESSAGE_GZIP, - GRPC_STATUS_UNIMPLEMENTED, nullptr); + request_for_disabled_algorithm(config, + "test_invoke_request_with_disabled_algorithm", + 0, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, + GRPC_STATUS_UNIMPLEMENTED, nullptr); } void compressed_payload(grpc_end2end_test_config config) { diff --git a/test/core/end2end/tests/stream_compression_compressed_payload.cc b/test/core/end2end/tests/stream_compression_compressed_payload.cc index 9a384441f0..7fdea529f2 100644 --- a/test/core/end2end/tests/stream_compression_compressed_payload.cc +++ b/test/core/end2end/tests/stream_compression_compressed_payload.cc @@ -390,9 +390,9 @@ static void request_with_payload_template( GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), GRPC_COMPRESS_NONE) != 0); GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), - GRPC_COMPRESS_MESSAGE_DEFLATE) != 0); + GRPC_COMPRESS_DEFLATE) != 0); GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), - GRPC_COMPRESS_MESSAGE_GZIP) != 0); + GRPC_COMPRESS_GZIP) != 0); GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), GRPC_COMPRESS_STREAM_GZIP) != 0); GPR_ASSERT(GPR_BITCOUNT(grpc_call_test_only_get_encodings_accepted_by_peer( diff --git a/test/core/end2end/tests/workaround_cronet_compression.cc b/test/core/end2end/tests/workaround_cronet_compression.cc index 97ab814d27..d4decce0aa 100644 --- a/test/core/end2end/tests/workaround_cronet_compression.cc +++ b/test/core/end2end/tests/workaround_cronet_compression.cc @@ -207,9 +207,9 @@ static void request_with_payload_template( GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), GRPC_COMPRESS_NONE) != 0); GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), - GRPC_COMPRESS_MESSAGE_DEFLATE) != 0); + GRPC_COMPRESS_DEFLATE) != 0); GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), - GRPC_COMPRESS_MESSAGE_GZIP) != 0); + GRPC_COMPRESS_GZIP) != 0); memset(ops, 0, sizeof(ops)); op = ops; @@ -365,16 +365,16 @@ typedef struct workaround_cronet_compression_config { } workaround_cronet_compression_config; static workaround_cronet_compression_config workaround_configs[] = { - {nullptr, GRPC_COMPRESS_MESSAGE_GZIP}, + {nullptr, GRPC_COMPRESS_GZIP}, {const_cast( "grpc-objc/1.3.0-dev grpc-c/3.0.0-dev (ios; cronet_http; gentle)"), GRPC_COMPRESS_NONE}, {const_cast( "grpc-objc/1.3.0-dev grpc-c/3.0.0-dev (ios; chttp2; gentle)"), - GRPC_COMPRESS_MESSAGE_GZIP}, + GRPC_COMPRESS_GZIP}, {const_cast( "grpc-objc/1.4.0 grpc-c/3.0.0-dev (ios; cronet_http; gentle)"), - GRPC_COMPRESS_MESSAGE_GZIP}}; + GRPC_COMPRESS_GZIP}}; static const size_t workaround_configs_num = sizeof(workaround_configs) / sizeof(*workaround_configs); @@ -383,8 +383,7 @@ static void test_workaround_cronet_compression( for (uint32_t i = 0; i < workaround_configs_num; i++) { request_with_payload_template( config, "test_invoke_request_with_compressed_payload", 0, - GRPC_COMPRESS_MESSAGE_GZIP, GRPC_COMPRESS_MESSAGE_GZIP, - GRPC_COMPRESS_MESSAGE_GZIP, + GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, workaround_configs[i].expected_algorithm_from_server, nullptr, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE, workaround_configs[i].user_agent_override); diff --git a/test/core/surface/byte_buffer_reader_test.cc b/test/core/surface/byte_buffer_reader_test.cc index 91662b027a..648a9d6986 100644 --- a/test/core/surface/byte_buffer_reader_test.cc +++ b/test/core/surface/byte_buffer_reader_test.cc @@ -109,7 +109,7 @@ static void test_read_corrupted_slice(void) { LOG_TEST("test_read_corrupted_slice"); slice = grpc_slice_from_copied_string("test"); buffer = grpc_raw_byte_buffer_create(&slice, 1); - buffer->data.raw.compression = GRPC_COMPRESS_MESSAGE_GZIP; /* lies! */ + buffer->data.raw.compression = GRPC_COMPRESS_GZIP; /* lies! */ grpc_slice_unref(slice); GPR_ASSERT(!grpc_byte_buffer_reader_init(&reader, buffer)); grpc_byte_buffer_destroy(buffer); @@ -161,13 +161,13 @@ static void read_compressed_slice(grpc_compression_algorithm algorithm, static void test_read_gzip_compressed_slice(void) { const size_t INPUT_SIZE = 2048; LOG_TEST("test_read_gzip_compressed_slice"); - read_compressed_slice(GRPC_COMPRESS_MESSAGE_GZIP, INPUT_SIZE); + read_compressed_slice(GRPC_COMPRESS_GZIP, INPUT_SIZE); } static void test_read_deflate_compressed_slice(void) { const size_t INPUT_SIZE = 2048; LOG_TEST("test_read_deflate_compressed_slice"); - read_compressed_slice(GRPC_COMPRESS_MESSAGE_DEFLATE, INPUT_SIZE); + read_compressed_slice(GRPC_COMPRESS_DEFLATE, INPUT_SIZE); } static void test_byte_buffer_from_reader(void) { diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 578f26e9c2..967db4c57c 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -350,7 +350,7 @@ static void SendRpc(grpc::testing::EchoTestService::Stub* stub, int num_rpcs, char bytes[8] = {'\0', '\1', '\2', '\3', '\4', '\5', '\6', (char)i}; context.AddMetadata("custom-bin", grpc::string(bytes, 8)); } - context.set_compression_algorithm(GRPC_COMPRESS_MESSAGE_GZIP); + context.set_compression_algorithm(GRPC_COMPRESS_GZIP); Status s = stub->Echo(&context, request, &response); EXPECT_EQ(response.message(), request.message()); EXPECT_TRUE(s.ok()); diff --git a/test/cpp/end2end/filter_end2end_test.cc b/test/cpp/end2end/filter_end2end_test.cc index b843a5b4e8..53e86addef 100644 --- a/test/cpp/end2end/filter_end2end_test.cc +++ b/test/cpp/end2end/filter_end2end_test.cc @@ -266,7 +266,7 @@ TEST_F(FilterEnd2endTest, SimpleBidiStreaming) { GenericServerContext srv_ctx; GenericServerAsyncReaderWriter srv_stream(&srv_ctx); - cli_ctx.set_compression_algorithm(GRPC_COMPRESS_MESSAGE_GZIP); + cli_ctx.set_compression_algorithm(GRPC_COMPRESS_GZIP); send_request.set_message("Hello"); std::unique_ptr cli_stream = generic_stub_->PrepareCall(&cli_ctx, kMethodName, &cli_cq_); diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc index ba2608982a..dac5faed8f 100644 --- a/test/cpp/end2end/generic_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -269,7 +269,7 @@ TEST_F(GenericEnd2endTest, SimpleBidiStreaming) { GenericServerContext srv_ctx; GenericServerAsyncReaderWriter srv_stream(&srv_ctx); - cli_ctx.set_compression_algorithm(GRPC_COMPRESS_MESSAGE_GZIP); + cli_ctx.set_compression_algorithm(GRPC_COMPRESS_GZIP); send_request.set_message("Hello"); std::unique_ptr cli_stream = generic_stub_->PrepareCall(&cli_ctx, kMethodName, &cli_cq_); diff --git a/test/cpp/end2end/server_builder_plugin_test.cc b/test/cpp/end2end/server_builder_plugin_test.cc index a1ce4ebc81..2951a2ebcf 100644 --- a/test/cpp/end2end/server_builder_plugin_test.cc +++ b/test/cpp/end2end/server_builder_plugin_test.cc @@ -251,7 +251,7 @@ TEST_P(ServerBuilderPluginTest, PluginWithServiceTest) { EchoResponse response; request.set_message("Hello hello hello hello"); ClientContext context; - context.set_compression_algorithm(GRPC_COMPRESS_MESSAGE_GZIP); + context.set_compression_algorithm(GRPC_COMPRESS_GZIP); Status s = stub_->Echo(&context, request, &response); EXPECT_EQ(response.message(), request.message()); EXPECT_TRUE(s.ok()); diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 6b59584353..d2192f5e70 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -189,7 +189,7 @@ bool InteropClient::PerformLargeUnary(SimpleRequest* request, request->mutable_payload()->set_body(payload.c_str(), kLargeRequestSize); if (request->has_expect_compressed()) { if (request->expect_compressed().value()) { - context.set_compression_algorithm(GRPC_COMPRESS_MESSAGE_GZIP); + context.set_compression_algorithm(GRPC_COMPRESS_GZIP); } else { context.set_compression_algorithm(GRPC_COMPRESS_NONE); } @@ -497,7 +497,7 @@ bool InteropClient::DoClientCompressedStreaming() { StreamingInputCallRequest request; StreamingInputCallResponse response; - context.set_compression_algorithm(GRPC_COMPRESS_MESSAGE_GZIP); + context.set_compression_algorithm(GRPC_COMPRESS_GZIP); std::unique_ptr> stream( serviceStub_.Get()->StreamingInputCall(&context, &response)); -- cgit v1.2.3 From 3db2caaf2e5e18d8cc5690986350edcba0906ed4 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 6 Feb 2018 18:04:00 -0800 Subject: Replace message/deflate,gzip with deflate,gzip --- src/core/lib/compression/compression.cc | 4 ++-- src/core/lib/transport/static_metadata.h | 4 ++-- src/csharp/Grpc.IntegrationTesting/InteropClient.cs | 2 +- test/core/channel/channel_args_test.cc | 4 ++-- test/core/compression/compression_test.cc | 4 ++-- test/core/end2end/fuzzers/hpack.dictionary | 4 ++-- test/core/end2end/tests/compressed_payload.cc | 2 +- tools/codegen/core/gen_static_metadata.py | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) (limited to 'test/core') diff --git a/src/core/lib/compression/compression.cc b/src/core/lib/compression/compression.cc index 4db7d0f47b..aae9bcaafb 100644 --- a/src/core/lib/compression/compression.cc +++ b/src/core/lib/compression/compression.cc @@ -67,10 +67,10 @@ int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm, *name = "identity"; return 1; case GRPC_COMPRESS_DEFLATE: - *name = "message/deflate"; + *name = "deflate"; return 1; case GRPC_COMPRESS_GZIP: - *name = "message/gzip"; + *name = "gzip"; return 1; case GRPC_COMPRESS_STREAM_GZIP: *name = "stream/gzip"; diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h index 21dc7a3d3f..2413eb38db 100644 --- a/src/core/lib/transport/static_metadata.h +++ b/src/core/lib/transport/static_metadata.h @@ -93,9 +93,9 @@ extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]; /* "/grpc.lb.v1.LoadBalancer/BalanceLoad" */ #define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \ (grpc_static_slice_table[28]) -/* "message/deflate" */ +/* "deflate" */ #define GRPC_MDSTR_MESSAGE_SLASH_DEFLATE (grpc_static_slice_table[29]) -/* "message/gzip" */ +/* "gzip" */ #define GRPC_MDSTR_MESSAGE_SLASH_GZIP (grpc_static_slice_table[30]) /* "stream/gzip" */ #define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table[31]) diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs index 10c31c455e..e83a8a7274 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs @@ -685,7 +685,7 @@ namespace Grpc.IntegrationTesting private static Metadata CreateClientCompressionMetadata(bool compressed) { - var algorithmName = compressed ? "message/gzip" : "identity"; + var algorithmName = compressed ? "gzip" : "identity"; return new Metadata { { new Metadata.Entry(Metadata.CompressionRequestAlgorithmMetadataKey, algorithmName) } diff --git a/test/core/channel/channel_args_test.cc b/test/core/channel/channel_args_test.cc index dda04f4c5e..24319baae6 100644 --- a/test/core/channel/channel_args_test.cc +++ b/test/core/channel/channel_args_test.cc @@ -88,7 +88,7 @@ static void test_compression_algorithm_states(void) { GPR_ASSERT(GPR_BITGET(states_bitset, i)); } - /* disable message/gzip and message/deflate and stream/gzip */ + /* disable gzip and deflate and stream/gzip */ ch_args_wo_gzip = grpc_channel_args_compression_algorithm_set_state( &ch_args, GRPC_COMPRESS_GZIP, 0); GPR_ASSERT(ch_args == ch_args_wo_gzip); @@ -111,7 +111,7 @@ static void test_compression_algorithm_states(void) { } } - /* re-enabled message/gzip and stream/gzip only */ + /* re-enabled gzip and stream/gzip only */ ch_args_wo_gzip = grpc_channel_args_compression_algorithm_set_state( &ch_args_wo_gzip_deflate_gzip, GRPC_COMPRESS_GZIP, 1); ch_args_wo_gzip = grpc_channel_args_compression_algorithm_set_state( diff --git a/test/core/compression/compression_test.cc b/test/core/compression/compression_test.cc index 001591d6be..3ec238dc31 100644 --- a/test/core/compression/compression_test.cc +++ b/test/core/compression/compression_test.cc @@ -28,7 +28,7 @@ static void test_compression_algorithm_parse(void) { size_t i; - const char* valid_names[] = {"identity", "message/gzip", "message/deflate", + const char* valid_names[] = {"identity", "gzip", "deflate", "stream/gzip"}; const grpc_compression_algorithm valid_algorithms[] = { GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE, @@ -61,7 +61,7 @@ static void test_compression_algorithm_name(void) { int success; const char* name; size_t i; - const char* valid_names[] = {"identity", "message/gzip", "message/deflate", + const char* valid_names[] = {"identity", "gzip", "deflate", "stream/gzip"}; const grpc_compression_algorithm valid_algorithms[] = { GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE, diff --git a/test/core/end2end/fuzzers/hpack.dictionary b/test/core/end2end/fuzzers/hpack.dictionary index a87e49ee52..6021c3a7ae 100644 --- a/test/core/end2end/fuzzers/hpack.dictionary +++ b/test/core/end2end/fuzzers/hpack.dictionary @@ -28,8 +28,8 @@ "\x1Egrpc.max_request_message_bytes" "\x1Fgrpc.max_response_message_bytes" "$/grpc.lb.v1.LoadBalancer/BalanceLoad" -"\x0Fmessage/deflate" -"\x0Cmessage/gzip" +"\x0Fdeflate" +"\x0Cgzip" "\x0Bstream/gzip" "\x010" "\x011" diff --git a/test/core/end2end/tests/compressed_payload.cc b/test/core/end2end/tests/compressed_payload.cc index dff7cc152a..a0d3ec48a5 100644 --- a/test/core/end2end/tests/compressed_payload.cc +++ b/test/core/end2end/tests/compressed_payload.cc @@ -597,7 +597,7 @@ static void test_invoke_request_with_compressed_payload_md_override( gzip_compression_override.key = GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST; gzip_compression_override.value = - grpc_slice_from_static_string("message/gzip"); + grpc_slice_from_static_string("gzip"); memset(&gzip_compression_override.internal_data, 0, sizeof(gzip_compression_override.internal_data)); diff --git a/tools/codegen/core/gen_static_metadata.py b/tools/codegen/core/gen_static_metadata.py index d4c0052b28..066f28416d 100755 --- a/tools/codegen/core/gen_static_metadata.py +++ b/tools/codegen/core/gen_static_metadata.py @@ -54,8 +54,8 @@ CONFIG = [ # well known method names '/grpc.lb.v1.LoadBalancer/BalanceLoad', # compression algorithm names - 'message/deflate', - 'message/gzip', + 'deflate', + 'gzip', 'stream/gzip', # metadata elements ('grpc-status', '0'), -- cgit v1.2.3 From 931f68ec56fe0511ecd9480a217d6025edd34f9f Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 6 Feb 2018 18:05:49 -0800 Subject: regenerate metadata --- src/core/lib/compression/compression.cc | 14 +- src/core/lib/transport/static_metadata.cc | 461 +++++++++++++------------- src/core/lib/transport/static_metadata.h | 143 ++++---- test/core/compression/compression_test.cc | 6 +- test/core/end2end/fuzzers/hpack.dictionary | 6 +- test/core/end2end/tests/compressed_payload.cc | 3 +- 6 files changed, 308 insertions(+), 325 deletions(-) (limited to 'test/core') diff --git a/src/core/lib/compression/compression.cc b/src/core/lib/compression/compression.cc index aae9bcaafb..167e90fd26 100644 --- a/src/core/lib/compression/compression.cc +++ b/src/core/lib/compression/compression.cc @@ -43,10 +43,10 @@ int grpc_compression_algorithm_parse(grpc_slice name, if (grpc_slice_eq(name, GRPC_MDSTR_IDENTITY)) { *algorithm = GRPC_COMPRESS_NONE; return 1; - } else if (grpc_slice_eq(name, GRPC_MDSTR_MESSAGE_SLASH_DEFLATE)) { + } else if (grpc_slice_eq(name, GRPC_MDSTR_DEFLATE)) { *algorithm = GRPC_COMPRESS_DEFLATE; return 1; - } else if (grpc_slice_eq(name, GRPC_MDSTR_MESSAGE_SLASH_GZIP)) { + } else if (grpc_slice_eq(name, GRPC_MDSTR_GZIP)) { *algorithm = GRPC_COMPRESS_GZIP; return 1; } else if (grpc_slice_eq(name, GRPC_MDSTR_STREAM_SLASH_GZIP)) { @@ -133,9 +133,9 @@ grpc_slice grpc_compression_algorithm_slice( case GRPC_COMPRESS_NONE: return GRPC_MDSTR_IDENTITY; case GRPC_COMPRESS_DEFLATE: - return GRPC_MDSTR_MESSAGE_SLASH_DEFLATE; + return GRPC_MDSTR_DEFLATE; case GRPC_COMPRESS_GZIP: - return GRPC_MDSTR_MESSAGE_SLASH_GZIP; + return GRPC_MDSTR_GZIP; case GRPC_COMPRESS_STREAM_GZIP: return GRPC_MDSTR_STREAM_SLASH_GZIP; case GRPC_COMPRESS_ALGORITHMS_COUNT: @@ -147,10 +147,8 @@ grpc_slice grpc_compression_algorithm_slice( grpc_compression_algorithm grpc_compression_algorithm_from_slice( grpc_slice str) { if (grpc_slice_eq(str, GRPC_MDSTR_IDENTITY)) return GRPC_COMPRESS_NONE; - if (grpc_slice_eq(str, GRPC_MDSTR_MESSAGE_SLASH_DEFLATE)) - return GRPC_COMPRESS_DEFLATE; - if (grpc_slice_eq(str, GRPC_MDSTR_MESSAGE_SLASH_GZIP)) - return GRPC_COMPRESS_GZIP; + if (grpc_slice_eq(str, GRPC_MDSTR_DEFLATE)) return GRPC_COMPRESS_DEFLATE; + if (grpc_slice_eq(str, GRPC_MDSTR_GZIP)) return GRPC_COMPRESS_GZIP; if (grpc_slice_eq(str, GRPC_MDSTR_STREAM_SLASH_GZIP)) return GRPC_COMPRESS_STREAM_GZIP; return GRPC_COMPRESS_ALGORITHMS_COUNT; diff --git a/src/core/lib/transport/static_metadata.cc b/src/core/lib/transport/static_metadata.cc index 82ba7ac51a..ebc75724cf 100644 --- a/src/core/lib/transport/static_metadata.cc +++ b/src/core/lib/transport/static_metadata.cc @@ -20,7 +20,7 @@ * To make changes to this file, change * tools/codegen/core/gen_static_metadata.py, and then re-run it. * - * See metadata.h for an explanation of the interface here, and metadata.c for + * See metadata.h for an explanation of the interface here, and metadata.cc for * an explanation of what's going on. */ @@ -57,53 +57,52 @@ static uint8_t g_bytes[] = { 112, 111, 110, 115, 101, 95, 109, 101, 115, 115, 97, 103, 101, 95, 98, 121, 116, 101, 115, 47, 103, 114, 112, 99, 46, 108, 98, 46, 118, 49, 46, 76, 111, 97, 100, 66, 97, 108, 97, 110, 99, 101, 114, 47, 66, - 97, 108, 97, 110, 99, 101, 76, 111, 97, 100, 109, 101, 115, 115, 97, - 103, 101, 47, 100, 101, 102, 108, 97, 116, 101, 109, 101, 115, 115, 97, - 103, 101, 47, 103, 122, 105, 112, 115, 116, 114, 101, 97, 109, 47, 103, - 122, 105, 112, 48, 49, 50, 105, 100, 101, 110, 116, 105, 116, 121, 103, - 122, 105, 112, 100, 101, 102, 108, 97, 116, 101, 116, 114, 97, 105, 108, - 101, 114, 115, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, - 103, 114, 112, 99, 80, 79, 83, 84, 50, 48, 48, 52, 48, 52, 104, - 116, 116, 112, 104, 116, 116, 112, 115, 103, 114, 112, 99, 71, 69, 84, - 80, 85, 84, 47, 47, 105, 110, 100, 101, 120, 46, 104, 116, 109, 108, - 50, 48, 52, 50, 48, 54, 51, 48, 52, 52, 48, 48, 53, 48, 48, - 97, 99, 99, 101, 112, 116, 45, 99, 104, 97, 114, 115, 101, 116, 103, - 122, 105, 112, 44, 32, 100, 101, 102, 108, 97, 116, 101, 97, 99, 99, - 101, 112, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 97, 99, 99, - 101, 112, 116, 45, 114, 97, 110, 103, 101, 115, 97, 99, 99, 101, 112, - 116, 97, 99, 99, 101, 115, 115, 45, 99, 111, 110, 116, 114, 111, 108, - 45, 97, 108, 108, 111, 119, 45, 111, 114, 105, 103, 105, 110, 97, 103, - 101, 97, 108, 108, 111, 119, 97, 117, 116, 104, 111, 114, 105, 122, 97, - 116, 105, 111, 110, 99, 97, 99, 104, 101, 45, 99, 111, 110, 116, 114, - 111, 108, 99, 111, 110, 116, 101, 110, 116, 45, 100, 105, 115, 112, 111, - 115, 105, 116, 105, 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, 108, - 97, 110, 103, 117, 97, 103, 101, 99, 111, 110, 116, 101, 110, 116, 45, - 108, 101, 110, 103, 116, 104, 99, 111, 110, 116, 101, 110, 116, 45, 108, - 111, 99, 97, 116, 105, 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, - 114, 97, 110, 103, 101, 99, 111, 111, 107, 105, 101, 100, 97, 116, 101, - 101, 116, 97, 103, 101, 120, 112, 101, 99, 116, 101, 120, 112, 105, 114, - 101, 115, 102, 114, 111, 109, 105, 102, 45, 109, 97, 116, 99, 104, 105, - 102, 45, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, - 101, 105, 102, 45, 110, 111, 110, 101, 45, 109, 97, 116, 99, 104, 105, - 102, 45, 114, 97, 110, 103, 101, 105, 102, 45, 117, 110, 109, 111, 100, - 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, 101, 108, 97, 115, 116, - 45, 109, 111, 100, 105, 102, 105, 101, 100, 108, 98, 45, 99, 111, 115, - 116, 45, 98, 105, 110, 108, 105, 110, 107, 108, 111, 99, 97, 116, 105, - 111, 110, 109, 97, 120, 45, 102, 111, 114, 119, 97, 114, 100, 115, 112, - 114, 111, 120, 121, 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, - 116, 101, 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 111, 114, 105, - 122, 97, 116, 105, 111, 110, 114, 97, 110, 103, 101, 114, 101, 102, 101, - 114, 101, 114, 114, 101, 102, 114, 101, 115, 104, 114, 101, 116, 114, 121, - 45, 97, 102, 116, 101, 114, 115, 101, 114, 118, 101, 114, 115, 101, 116, - 45, 99, 111, 111, 107, 105, 101, 115, 116, 114, 105, 99, 116, 45, 116, - 114, 97, 110, 115, 112, 111, 114, 116, 45, 115, 101, 99, 117, 114, 105, - 116, 121, 116, 114, 97, 110, 115, 102, 101, 114, 45, 101, 110, 99, 111, - 100, 105, 110, 103, 118, 97, 114, 121, 118, 105, 97, 119, 119, 119, 45, - 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 105, 100, 101, - 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 105, 100, - 101, 110, 116, 105, 116, 121, 44, 103, 122, 105, 112, 100, 101, 102, 108, - 97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, 116, 105, 116, - 121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112}; + 97, 108, 97, 110, 99, 101, 76, 111, 97, 100, 100, 101, 102, 108, 97, + 116, 101, 103, 122, 105, 112, 115, 116, 114, 101, 97, 109, 47, 103, 122, + 105, 112, 48, 49, 50, 105, 100, 101, 110, 116, 105, 116, 121, 116, 114, + 97, 105, 108, 101, 114, 115, 97, 112, 112, 108, 105, 99, 97, 116, 105, + 111, 110, 47, 103, 114, 112, 99, 80, 79, 83, 84, 50, 48, 48, 52, + 48, 52, 104, 116, 116, 112, 104, 116, 116, 112, 115, 103, 114, 112, 99, + 71, 69, 84, 80, 85, 84, 47, 47, 105, 110, 100, 101, 120, 46, 104, + 116, 109, 108, 50, 48, 52, 50, 48, 54, 51, 48, 52, 52, 48, 48, + 53, 48, 48, 97, 99, 99, 101, 112, 116, 45, 99, 104, 97, 114, 115, + 101, 116, 103, 122, 105, 112, 44, 32, 100, 101, 102, 108, 97, 116, 101, + 97, 99, 99, 101, 112, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, + 97, 99, 99, 101, 112, 116, 45, 114, 97, 110, 103, 101, 115, 97, 99, + 99, 101, 112, 116, 97, 99, 99, 101, 115, 115, 45, 99, 111, 110, 116, + 114, 111, 108, 45, 97, 108, 108, 111, 119, 45, 111, 114, 105, 103, 105, + 110, 97, 103, 101, 97, 108, 108, 111, 119, 97, 117, 116, 104, 111, 114, + 105, 122, 97, 116, 105, 111, 110, 99, 97, 99, 104, 101, 45, 99, 111, + 110, 116, 114, 111, 108, 99, 111, 110, 116, 101, 110, 116, 45, 100, 105, + 115, 112, 111, 115, 105, 116, 105, 111, 110, 99, 111, 110, 116, 101, 110, + 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 99, 111, 110, 116, 101, + 110, 116, 45, 108, 101, 110, 103, 116, 104, 99, 111, 110, 116, 101, 110, + 116, 45, 108, 111, 99, 97, 116, 105, 111, 110, 99, 111, 110, 116, 101, + 110, 116, 45, 114, 97, 110, 103, 101, 99, 111, 111, 107, 105, 101, 100, + 97, 116, 101, 101, 116, 97, 103, 101, 120, 112, 101, 99, 116, 101, 120, + 112, 105, 114, 101, 115, 102, 114, 111, 109, 105, 102, 45, 109, 97, 116, + 99, 104, 105, 102, 45, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, + 105, 110, 99, 101, 105, 102, 45, 110, 111, 110, 101, 45, 109, 97, 116, + 99, 104, 105, 102, 45, 114, 97, 110, 103, 101, 105, 102, 45, 117, 110, + 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, 101, 108, + 97, 115, 116, 45, 109, 111, 100, 105, 102, 105, 101, 100, 108, 98, 45, + 99, 111, 115, 116, 45, 98, 105, 110, 108, 105, 110, 107, 108, 111, 99, + 97, 116, 105, 111, 110, 109, 97, 120, 45, 102, 111, 114, 119, 97, 114, + 100, 115, 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 101, 110, 116, + 105, 99, 97, 116, 101, 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, + 111, 114, 105, 122, 97, 116, 105, 111, 110, 114, 97, 110, 103, 101, 114, + 101, 102, 101, 114, 101, 114, 114, 101, 102, 114, 101, 115, 104, 114, 101, + 116, 114, 121, 45, 97, 102, 116, 101, 114, 115, 101, 114, 118, 101, 114, + 115, 101, 116, 45, 99, 111, 111, 107, 105, 101, 115, 116, 114, 105, 99, + 116, 45, 116, 114, 97, 110, 115, 112, 111, 114, 116, 45, 115, 101, 99, + 117, 114, 105, 116, 121, 116, 114, 97, 110, 115, 102, 101, 114, 45, 101, + 110, 99, 111, 100, 105, 110, 103, 118, 97, 114, 121, 118, 105, 97, 119, + 119, 119, 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, + 105, 100, 101, 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, + 101, 105, 100, 101, 110, 116, 105, 116, 121, 44, 103, 122, 105, 112, 100, + 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, + 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, + 105, 112}; static void static_ref(void* unused) {} static void static_unref(void* unused) {} @@ -216,8 +215,6 @@ grpc_slice_refcount grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT] = { {&grpc_static_metadata_vtable, &static_sub_refcnt}, {&grpc_static_metadata_vtable, &static_sub_refcnt}, {&grpc_static_metadata_vtable, &static_sub_refcnt}, - {&grpc_static_metadata_vtable, &static_sub_refcnt}, - {&grpc_static_metadata_vtable, &static_sub_refcnt}, }; const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT] = { @@ -250,80 +247,78 @@ const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT] = { {&grpc_static_metadata_refcounts[26], {{g_bytes + 333, 30}}}, {&grpc_static_metadata_refcounts[27], {{g_bytes + 363, 31}}}, {&grpc_static_metadata_refcounts[28], {{g_bytes + 394, 36}}}, - {&grpc_static_metadata_refcounts[29], {{g_bytes + 430, 15}}}, - {&grpc_static_metadata_refcounts[30], {{g_bytes + 445, 12}}}, - {&grpc_static_metadata_refcounts[31], {{g_bytes + 457, 11}}}, - {&grpc_static_metadata_refcounts[32], {{g_bytes + 468, 1}}}, - {&grpc_static_metadata_refcounts[33], {{g_bytes + 469, 1}}}, - {&grpc_static_metadata_refcounts[34], {{g_bytes + 470, 1}}}, - {&grpc_static_metadata_refcounts[35], {{g_bytes + 471, 8}}}, - {&grpc_static_metadata_refcounts[36], {{g_bytes + 479, 4}}}, - {&grpc_static_metadata_refcounts[37], {{g_bytes + 483, 7}}}, - {&grpc_static_metadata_refcounts[38], {{g_bytes + 490, 8}}}, - {&grpc_static_metadata_refcounts[39], {{g_bytes + 498, 16}}}, - {&grpc_static_metadata_refcounts[40], {{g_bytes + 514, 4}}}, - {&grpc_static_metadata_refcounts[41], {{g_bytes + 518, 3}}}, - {&grpc_static_metadata_refcounts[42], {{g_bytes + 521, 3}}}, - {&grpc_static_metadata_refcounts[43], {{g_bytes + 524, 4}}}, - {&grpc_static_metadata_refcounts[44], {{g_bytes + 528, 5}}}, - {&grpc_static_metadata_refcounts[45], {{g_bytes + 533, 4}}}, - {&grpc_static_metadata_refcounts[46], {{g_bytes + 537, 3}}}, - {&grpc_static_metadata_refcounts[47], {{g_bytes + 540, 3}}}, - {&grpc_static_metadata_refcounts[48], {{g_bytes + 543, 1}}}, - {&grpc_static_metadata_refcounts[49], {{g_bytes + 544, 11}}}, - {&grpc_static_metadata_refcounts[50], {{g_bytes + 555, 3}}}, - {&grpc_static_metadata_refcounts[51], {{g_bytes + 558, 3}}}, - {&grpc_static_metadata_refcounts[52], {{g_bytes + 561, 3}}}, - {&grpc_static_metadata_refcounts[53], {{g_bytes + 564, 3}}}, - {&grpc_static_metadata_refcounts[54], {{g_bytes + 567, 3}}}, - {&grpc_static_metadata_refcounts[55], {{g_bytes + 570, 14}}}, - {&grpc_static_metadata_refcounts[56], {{g_bytes + 584, 13}}}, - {&grpc_static_metadata_refcounts[57], {{g_bytes + 597, 15}}}, - {&grpc_static_metadata_refcounts[58], {{g_bytes + 612, 13}}}, - {&grpc_static_metadata_refcounts[59], {{g_bytes + 625, 6}}}, - {&grpc_static_metadata_refcounts[60], {{g_bytes + 631, 27}}}, - {&grpc_static_metadata_refcounts[61], {{g_bytes + 658, 3}}}, - {&grpc_static_metadata_refcounts[62], {{g_bytes + 661, 5}}}, - {&grpc_static_metadata_refcounts[63], {{g_bytes + 666, 13}}}, - {&grpc_static_metadata_refcounts[64], {{g_bytes + 679, 13}}}, - {&grpc_static_metadata_refcounts[65], {{g_bytes + 692, 19}}}, - {&grpc_static_metadata_refcounts[66], {{g_bytes + 711, 16}}}, - {&grpc_static_metadata_refcounts[67], {{g_bytes + 727, 14}}}, - {&grpc_static_metadata_refcounts[68], {{g_bytes + 741, 16}}}, - {&grpc_static_metadata_refcounts[69], {{g_bytes + 757, 13}}}, - {&grpc_static_metadata_refcounts[70], {{g_bytes + 770, 6}}}, - {&grpc_static_metadata_refcounts[71], {{g_bytes + 776, 4}}}, - {&grpc_static_metadata_refcounts[72], {{g_bytes + 780, 4}}}, - {&grpc_static_metadata_refcounts[73], {{g_bytes + 784, 6}}}, - {&grpc_static_metadata_refcounts[74], {{g_bytes + 790, 7}}}, - {&grpc_static_metadata_refcounts[75], {{g_bytes + 797, 4}}}, - {&grpc_static_metadata_refcounts[76], {{g_bytes + 801, 8}}}, - {&grpc_static_metadata_refcounts[77], {{g_bytes + 809, 17}}}, - {&grpc_static_metadata_refcounts[78], {{g_bytes + 826, 13}}}, - {&grpc_static_metadata_refcounts[79], {{g_bytes + 839, 8}}}, - {&grpc_static_metadata_refcounts[80], {{g_bytes + 847, 19}}}, - {&grpc_static_metadata_refcounts[81], {{g_bytes + 866, 13}}}, - {&grpc_static_metadata_refcounts[82], {{g_bytes + 879, 11}}}, - {&grpc_static_metadata_refcounts[83], {{g_bytes + 890, 4}}}, - {&grpc_static_metadata_refcounts[84], {{g_bytes + 894, 8}}}, - {&grpc_static_metadata_refcounts[85], {{g_bytes + 902, 12}}}, - {&grpc_static_metadata_refcounts[86], {{g_bytes + 914, 18}}}, - {&grpc_static_metadata_refcounts[87], {{g_bytes + 932, 19}}}, - {&grpc_static_metadata_refcounts[88], {{g_bytes + 951, 5}}}, - {&grpc_static_metadata_refcounts[89], {{g_bytes + 956, 7}}}, - {&grpc_static_metadata_refcounts[90], {{g_bytes + 963, 7}}}, - {&grpc_static_metadata_refcounts[91], {{g_bytes + 970, 11}}}, - {&grpc_static_metadata_refcounts[92], {{g_bytes + 981, 6}}}, - {&grpc_static_metadata_refcounts[93], {{g_bytes + 987, 10}}}, - {&grpc_static_metadata_refcounts[94], {{g_bytes + 997, 25}}}, - {&grpc_static_metadata_refcounts[95], {{g_bytes + 1022, 17}}}, - {&grpc_static_metadata_refcounts[96], {{g_bytes + 1039, 4}}}, - {&grpc_static_metadata_refcounts[97], {{g_bytes + 1043, 3}}}, - {&grpc_static_metadata_refcounts[98], {{g_bytes + 1046, 16}}}, - {&grpc_static_metadata_refcounts[99], {{g_bytes + 1062, 16}}}, - {&grpc_static_metadata_refcounts[100], {{g_bytes + 1078, 13}}}, - {&grpc_static_metadata_refcounts[101], {{g_bytes + 1091, 12}}}, - {&grpc_static_metadata_refcounts[102], {{g_bytes + 1103, 21}}}, + {&grpc_static_metadata_refcounts[29], {{g_bytes + 430, 7}}}, + {&grpc_static_metadata_refcounts[30], {{g_bytes + 437, 4}}}, + {&grpc_static_metadata_refcounts[31], {{g_bytes + 441, 11}}}, + {&grpc_static_metadata_refcounts[32], {{g_bytes + 452, 1}}}, + {&grpc_static_metadata_refcounts[33], {{g_bytes + 453, 1}}}, + {&grpc_static_metadata_refcounts[34], {{g_bytes + 454, 1}}}, + {&grpc_static_metadata_refcounts[35], {{g_bytes + 455, 8}}}, + {&grpc_static_metadata_refcounts[36], {{g_bytes + 463, 8}}}, + {&grpc_static_metadata_refcounts[37], {{g_bytes + 471, 16}}}, + {&grpc_static_metadata_refcounts[38], {{g_bytes + 487, 4}}}, + {&grpc_static_metadata_refcounts[39], {{g_bytes + 491, 3}}}, + {&grpc_static_metadata_refcounts[40], {{g_bytes + 494, 3}}}, + {&grpc_static_metadata_refcounts[41], {{g_bytes + 497, 4}}}, + {&grpc_static_metadata_refcounts[42], {{g_bytes + 501, 5}}}, + {&grpc_static_metadata_refcounts[43], {{g_bytes + 506, 4}}}, + {&grpc_static_metadata_refcounts[44], {{g_bytes + 510, 3}}}, + {&grpc_static_metadata_refcounts[45], {{g_bytes + 513, 3}}}, + {&grpc_static_metadata_refcounts[46], {{g_bytes + 516, 1}}}, + {&grpc_static_metadata_refcounts[47], {{g_bytes + 517, 11}}}, + {&grpc_static_metadata_refcounts[48], {{g_bytes + 528, 3}}}, + {&grpc_static_metadata_refcounts[49], {{g_bytes + 531, 3}}}, + {&grpc_static_metadata_refcounts[50], {{g_bytes + 534, 3}}}, + {&grpc_static_metadata_refcounts[51], {{g_bytes + 537, 3}}}, + {&grpc_static_metadata_refcounts[52], {{g_bytes + 540, 3}}}, + {&grpc_static_metadata_refcounts[53], {{g_bytes + 543, 14}}}, + {&grpc_static_metadata_refcounts[54], {{g_bytes + 557, 13}}}, + {&grpc_static_metadata_refcounts[55], {{g_bytes + 570, 15}}}, + {&grpc_static_metadata_refcounts[56], {{g_bytes + 585, 13}}}, + {&grpc_static_metadata_refcounts[57], {{g_bytes + 598, 6}}}, + {&grpc_static_metadata_refcounts[58], {{g_bytes + 604, 27}}}, + {&grpc_static_metadata_refcounts[59], {{g_bytes + 631, 3}}}, + {&grpc_static_metadata_refcounts[60], {{g_bytes + 634, 5}}}, + {&grpc_static_metadata_refcounts[61], {{g_bytes + 639, 13}}}, + {&grpc_static_metadata_refcounts[62], {{g_bytes + 652, 13}}}, + {&grpc_static_metadata_refcounts[63], {{g_bytes + 665, 19}}}, + {&grpc_static_metadata_refcounts[64], {{g_bytes + 684, 16}}}, + {&grpc_static_metadata_refcounts[65], {{g_bytes + 700, 14}}}, + {&grpc_static_metadata_refcounts[66], {{g_bytes + 714, 16}}}, + {&grpc_static_metadata_refcounts[67], {{g_bytes + 730, 13}}}, + {&grpc_static_metadata_refcounts[68], {{g_bytes + 743, 6}}}, + {&grpc_static_metadata_refcounts[69], {{g_bytes + 749, 4}}}, + {&grpc_static_metadata_refcounts[70], {{g_bytes + 753, 4}}}, + {&grpc_static_metadata_refcounts[71], {{g_bytes + 757, 6}}}, + {&grpc_static_metadata_refcounts[72], {{g_bytes + 763, 7}}}, + {&grpc_static_metadata_refcounts[73], {{g_bytes + 770, 4}}}, + {&grpc_static_metadata_refcounts[74], {{g_bytes + 774, 8}}}, + {&grpc_static_metadata_refcounts[75], {{g_bytes + 782, 17}}}, + {&grpc_static_metadata_refcounts[76], {{g_bytes + 799, 13}}}, + {&grpc_static_metadata_refcounts[77], {{g_bytes + 812, 8}}}, + {&grpc_static_metadata_refcounts[78], {{g_bytes + 820, 19}}}, + {&grpc_static_metadata_refcounts[79], {{g_bytes + 839, 13}}}, + {&grpc_static_metadata_refcounts[80], {{g_bytes + 852, 11}}}, + {&grpc_static_metadata_refcounts[81], {{g_bytes + 863, 4}}}, + {&grpc_static_metadata_refcounts[82], {{g_bytes + 867, 8}}}, + {&grpc_static_metadata_refcounts[83], {{g_bytes + 875, 12}}}, + {&grpc_static_metadata_refcounts[84], {{g_bytes + 887, 18}}}, + {&grpc_static_metadata_refcounts[85], {{g_bytes + 905, 19}}}, + {&grpc_static_metadata_refcounts[86], {{g_bytes + 924, 5}}}, + {&grpc_static_metadata_refcounts[87], {{g_bytes + 929, 7}}}, + {&grpc_static_metadata_refcounts[88], {{g_bytes + 936, 7}}}, + {&grpc_static_metadata_refcounts[89], {{g_bytes + 943, 11}}}, + {&grpc_static_metadata_refcounts[90], {{g_bytes + 954, 6}}}, + {&grpc_static_metadata_refcounts[91], {{g_bytes + 960, 10}}}, + {&grpc_static_metadata_refcounts[92], {{g_bytes + 970, 25}}}, + {&grpc_static_metadata_refcounts[93], {{g_bytes + 995, 17}}}, + {&grpc_static_metadata_refcounts[94], {{g_bytes + 1012, 4}}}, + {&grpc_static_metadata_refcounts[95], {{g_bytes + 1016, 3}}}, + {&grpc_static_metadata_refcounts[96], {{g_bytes + 1019, 16}}}, + {&grpc_static_metadata_refcounts[97], {{g_bytes + 1035, 16}}}, + {&grpc_static_metadata_refcounts[98], {{g_bytes + 1051, 13}}}, + {&grpc_static_metadata_refcounts[99], {{g_bytes + 1064, 12}}}, + {&grpc_static_metadata_refcounts[100], {{g_bytes + 1076, 21}}}, }; uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = { @@ -333,16 +328,16 @@ uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8, 2, 4, 4}; static const int8_t elems_r[] = { - 11, 9, -3, 0, 10, 25, -77, 26, 0, 11, -7, 0, 0, 0, 21, 14, 1, - 0, 0, 33, 12, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -56, 0, -36, -61, -60, -39, -63, -64, 0, 36, 35, 34, 33, - 34, 33, 32, 31, 31, 30, 29, 28, 27, 26, 26, 25, 25, 24, 23, 22, 21, - 20, 19, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 12, 11, 0}; + 13, 2, 1, 0, 15, 4, 0, 21, 0, 23, -3, 0, 0, 0, 10, 19, -4, + 0, 0, 1, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -52, 0, -55, -36, -57, -58, -58, -58, 0, 40, 39, 38, 37, 36, 35, + 34, 33, 32, 31, 30, 29, 28, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, + 18, 17, 16, 15, 18, 17, 16, 15, 14, 13, 12, 11, 11, 0}; static uint32_t elems_phash(uint32_t i) { - i -= 48; - uint32_t x = i % 101; - uint32_t y = i / 101; + i -= 46; + uint32_t x = i % 99; + uint32_t y = i / 99; uint32_t h = x; if (y < GPR_ARRAY_SIZE(elems_r)) { uint32_t delta = (uint32_t)elems_r[y]; @@ -352,31 +347,31 @@ static uint32_t elems_phash(uint32_t i) { } static const uint16_t elem_keys[] = { - 1065, 1066, 1067, 256, 257, 258, 259, 260, 1671, 149, 150, 48, - 49, 455, 456, 457, 962, 963, 964, 1568, 1683, 1684, 753, 754, - 1465, 553, 755, 2083, 2186, 5688, 5997, 1580, 1581, 6100, 6306, 6409, - 6512, 6615, 6718, 6821, 1481, 1704, 6924, 7027, 7130, 7233, 1980, 7336, - 7439, 7542, 7645, 7748, 7851, 5894, 7954, 8057, 6203, 8160, 8263, 8366, - 8469, 8572, 8675, 8778, 1129, 1130, 1131, 1132, 8881, 8984, 9087, 9190, - 9293, 9396, 9499, 9602, 9705, 9808, 9911, 332, 10014, 10117, 0, 0, - 0, 1748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 247, - 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0}; + 1039, 1040, 145, 146, 541, 1639, 1045, 250, 251, 252, 253, 254, + 1646, 46, 47, 1437, 1942, 1651, 445, 446, 447, 739, 740, 741, + 938, 939, 1538, 2043, 2144, 1451, 944, 5376, 5578, 1545, 5780, 5881, + 1670, 5982, 1550, 6083, 6184, 6285, 6386, 6487, 6588, 6689, 6790, 6891, + 6992, 7093, 7194, 7295, 7396, 5679, 7497, 7598, 7699, 7800, 7901, 8002, + 8103, 8204, 8305, 8406, 8507, 8608, 8709, 8810, 1107, 1108, 1109, 1110, + 8911, 9012, 9113, 9214, 9315, 9416, 9517, 9618, 1714, 9719, 0, 326, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 241, 242, 0, 0, 0, 0, 0, 0, 139, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0}; static const uint8_t elem_idxs[] = { - 76, 79, 77, 19, 20, 21, 22, 23, 25, 15, 16, 17, 18, 11, - 12, 13, 3, 4, 5, 38, 83, 84, 0, 1, 43, 6, 2, 50, - 57, 24, 28, 36, 37, 29, 31, 32, 33, 34, 35, 39, 7, 26, - 40, 41, 42, 44, 72, 45, 46, 47, 48, 49, 51, 27, 52, 53, - 30, 54, 55, 56, 58, 59, 60, 61, 78, 80, 81, 82, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 73, 14, 74, 75, 255, 255, - 255, 85, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 8, 9, 10}; + 77, 79, 15, 16, 6, 25, 76, 19, 20, 21, 22, 23, 84, 17, + 18, 43, 72, 83, 11, 12, 13, 0, 1, 2, 5, 4, 38, 50, + 57, 7, 3, 24, 27, 37, 29, 30, 26, 31, 36, 32, 33, 34, + 35, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 28, 51, 52, + 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 78, 80, + 81, 82, 66, 67, 68, 69, 70, 71, 73, 74, 85, 75, 255, 14, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 9, 10, 255, 255, 255, 255, 255, 255, 8}; grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) { if (a == -1 || b == -1) return GRPC_MDNULL; - uint32_t k = (uint32_t)(a * 103 + b); + uint32_t k = (uint32_t)(a * 101 + b); uint32_t h = elems_phash(k); return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k && elem_idxs[h] != 255 @@ -387,177 +382,177 @@ grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) { grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = { {{&grpc_static_metadata_refcounts[7], {{g_bytes + 50, 11}}}, - {&grpc_static_metadata_refcounts[32], {{g_bytes + 468, 1}}}}, + {&grpc_static_metadata_refcounts[32], {{g_bytes + 452, 1}}}}, {{&grpc_static_metadata_refcounts[7], {{g_bytes + 50, 11}}}, - {&grpc_static_metadata_refcounts[33], {{g_bytes + 469, 1}}}}, + {&grpc_static_metadata_refcounts[33], {{g_bytes + 453, 1}}}}, {{&grpc_static_metadata_refcounts[7], {{g_bytes + 50, 11}}}, - {&grpc_static_metadata_refcounts[34], {{g_bytes + 470, 1}}}}, + {&grpc_static_metadata_refcounts[34], {{g_bytes + 454, 1}}}}, {{&grpc_static_metadata_refcounts[9], {{g_bytes + 77, 13}}}, - {&grpc_static_metadata_refcounts[35], {{g_bytes + 471, 8}}}}, + {&grpc_static_metadata_refcounts[35], {{g_bytes + 455, 8}}}}, {{&grpc_static_metadata_refcounts[9], {{g_bytes + 77, 13}}}, - {&grpc_static_metadata_refcounts[36], {{g_bytes + 479, 4}}}}, + {&grpc_static_metadata_refcounts[30], {{g_bytes + 437, 4}}}}, {{&grpc_static_metadata_refcounts[9], {{g_bytes + 77, 13}}}, - {&grpc_static_metadata_refcounts[37], {{g_bytes + 483, 7}}}}, + {&grpc_static_metadata_refcounts[29], {{g_bytes + 430, 7}}}}, {{&grpc_static_metadata_refcounts[5], {{g_bytes + 36, 2}}}, - {&grpc_static_metadata_refcounts[38], {{g_bytes + 490, 8}}}}, + {&grpc_static_metadata_refcounts[36], {{g_bytes + 463, 8}}}}, {{&grpc_static_metadata_refcounts[14], {{g_bytes + 158, 12}}}, - {&grpc_static_metadata_refcounts[39], {{g_bytes + 498, 16}}}}, + {&grpc_static_metadata_refcounts[37], {{g_bytes + 471, 16}}}}, {{&grpc_static_metadata_refcounts[1], {{g_bytes + 5, 7}}}, - {&grpc_static_metadata_refcounts[40], {{g_bytes + 514, 4}}}}, + {&grpc_static_metadata_refcounts[38], {{g_bytes + 487, 4}}}}, {{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}}, - {&grpc_static_metadata_refcounts[41], {{g_bytes + 518, 3}}}}, + {&grpc_static_metadata_refcounts[39], {{g_bytes + 491, 3}}}}, {{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}}, - {&grpc_static_metadata_refcounts[42], {{g_bytes + 521, 3}}}}, + {&grpc_static_metadata_refcounts[40], {{g_bytes + 494, 3}}}}, {{&grpc_static_metadata_refcounts[4], {{g_bytes + 29, 7}}}, - {&grpc_static_metadata_refcounts[43], {{g_bytes + 524, 4}}}}, + {&grpc_static_metadata_refcounts[41], {{g_bytes + 497, 4}}}}, {{&grpc_static_metadata_refcounts[4], {{g_bytes + 29, 7}}}, - {&grpc_static_metadata_refcounts[44], {{g_bytes + 528, 5}}}}, + {&grpc_static_metadata_refcounts[42], {{g_bytes + 501, 5}}}}, {{&grpc_static_metadata_refcounts[4], {{g_bytes + 29, 7}}}, - {&grpc_static_metadata_refcounts[45], {{g_bytes + 533, 4}}}}, + {&grpc_static_metadata_refcounts[43], {{g_bytes + 506, 4}}}}, {{&grpc_static_metadata_refcounts[3], {{g_bytes + 19, 10}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, {{&grpc_static_metadata_refcounts[1], {{g_bytes + 5, 7}}}, - {&grpc_static_metadata_refcounts[46], {{g_bytes + 537, 3}}}}, + {&grpc_static_metadata_refcounts[44], {{g_bytes + 510, 3}}}}, {{&grpc_static_metadata_refcounts[1], {{g_bytes + 5, 7}}}, - {&grpc_static_metadata_refcounts[47], {{g_bytes + 540, 3}}}}, + {&grpc_static_metadata_refcounts[45], {{g_bytes + 513, 3}}}}, {{&grpc_static_metadata_refcounts[0], {{g_bytes + 0, 5}}}, - {&grpc_static_metadata_refcounts[48], {{g_bytes + 543, 1}}}}, + {&grpc_static_metadata_refcounts[46], {{g_bytes + 516, 1}}}}, {{&grpc_static_metadata_refcounts[0], {{g_bytes + 0, 5}}}, - {&grpc_static_metadata_refcounts[49], {{g_bytes + 544, 11}}}}, + {&grpc_static_metadata_refcounts[47], {{g_bytes + 517, 11}}}}, {{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}}, - {&grpc_static_metadata_refcounts[50], {{g_bytes + 555, 3}}}}, + {&grpc_static_metadata_refcounts[48], {{g_bytes + 528, 3}}}}, {{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}}, - {&grpc_static_metadata_refcounts[51], {{g_bytes + 558, 3}}}}, + {&grpc_static_metadata_refcounts[49], {{g_bytes + 531, 3}}}}, {{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}}, - {&grpc_static_metadata_refcounts[52], {{g_bytes + 561, 3}}}}, + {&grpc_static_metadata_refcounts[50], {{g_bytes + 534, 3}}}}, {{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}}, - {&grpc_static_metadata_refcounts[53], {{g_bytes + 564, 3}}}}, + {&grpc_static_metadata_refcounts[51], {{g_bytes + 537, 3}}}}, {{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}}, - {&grpc_static_metadata_refcounts[54], {{g_bytes + 567, 3}}}}, - {{&grpc_static_metadata_refcounts[55], {{g_bytes + 570, 14}}}, + {&grpc_static_metadata_refcounts[52], {{g_bytes + 540, 3}}}}, + {{&grpc_static_metadata_refcounts[53], {{g_bytes + 543, 14}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, {{&grpc_static_metadata_refcounts[16], {{g_bytes + 186, 15}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, {{&grpc_static_metadata_refcounts[16], {{g_bytes + 186, 15}}}, - {&grpc_static_metadata_refcounts[56], {{g_bytes + 584, 13}}}}, - {{&grpc_static_metadata_refcounts[57], {{g_bytes + 597, 15}}}, + {&grpc_static_metadata_refcounts[54], {{g_bytes + 557, 13}}}}, + {{&grpc_static_metadata_refcounts[55], {{g_bytes + 570, 15}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[58], {{g_bytes + 612, 13}}}, + {{&grpc_static_metadata_refcounts[56], {{g_bytes + 585, 13}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[59], {{g_bytes + 625, 6}}}, + {{&grpc_static_metadata_refcounts[57], {{g_bytes + 598, 6}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[60], {{g_bytes + 631, 27}}}, + {{&grpc_static_metadata_refcounts[58], {{g_bytes + 604, 27}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[61], {{g_bytes + 658, 3}}}, + {{&grpc_static_metadata_refcounts[59], {{g_bytes + 631, 3}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[62], {{g_bytes + 661, 5}}}, + {{&grpc_static_metadata_refcounts[60], {{g_bytes + 634, 5}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[63], {{g_bytes + 666, 13}}}, + {{&grpc_static_metadata_refcounts[61], {{g_bytes + 639, 13}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[64], {{g_bytes + 679, 13}}}, + {{&grpc_static_metadata_refcounts[62], {{g_bytes + 652, 13}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[65], {{g_bytes + 692, 19}}}, + {{&grpc_static_metadata_refcounts[63], {{g_bytes + 665, 19}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, {{&grpc_static_metadata_refcounts[15], {{g_bytes + 170, 16}}}, - {&grpc_static_metadata_refcounts[35], {{g_bytes + 471, 8}}}}, + {&grpc_static_metadata_refcounts[35], {{g_bytes + 455, 8}}}}, {{&grpc_static_metadata_refcounts[15], {{g_bytes + 170, 16}}}, - {&grpc_static_metadata_refcounts[36], {{g_bytes + 479, 4}}}}, + {&grpc_static_metadata_refcounts[30], {{g_bytes + 437, 4}}}}, {{&grpc_static_metadata_refcounts[15], {{g_bytes + 170, 16}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[66], {{g_bytes + 711, 16}}}, + {{&grpc_static_metadata_refcounts[64], {{g_bytes + 684, 16}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[67], {{g_bytes + 727, 14}}}, + {{&grpc_static_metadata_refcounts[65], {{g_bytes + 700, 14}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[68], {{g_bytes + 741, 16}}}, + {{&grpc_static_metadata_refcounts[66], {{g_bytes + 714, 16}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[69], {{g_bytes + 757, 13}}}, + {{&grpc_static_metadata_refcounts[67], {{g_bytes + 730, 13}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, {{&grpc_static_metadata_refcounts[14], {{g_bytes + 158, 12}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[70], {{g_bytes + 770, 6}}}, + {{&grpc_static_metadata_refcounts[68], {{g_bytes + 743, 6}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[71], {{g_bytes + 776, 4}}}, + {{&grpc_static_metadata_refcounts[69], {{g_bytes + 749, 4}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[72], {{g_bytes + 780, 4}}}, + {{&grpc_static_metadata_refcounts[70], {{g_bytes + 753, 4}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[73], {{g_bytes + 784, 6}}}, + {{&grpc_static_metadata_refcounts[71], {{g_bytes + 757, 6}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[74], {{g_bytes + 790, 7}}}, + {{&grpc_static_metadata_refcounts[72], {{g_bytes + 763, 7}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[75], {{g_bytes + 797, 4}}}, + {{&grpc_static_metadata_refcounts[73], {{g_bytes + 770, 4}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, {{&grpc_static_metadata_refcounts[20], {{g_bytes + 278, 4}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[76], {{g_bytes + 801, 8}}}, + {{&grpc_static_metadata_refcounts[74], {{g_bytes + 774, 8}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[77], {{g_bytes + 809, 17}}}, + {{&grpc_static_metadata_refcounts[75], {{g_bytes + 782, 17}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[78], {{g_bytes + 826, 13}}}, + {{&grpc_static_metadata_refcounts[76], {{g_bytes + 799, 13}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[79], {{g_bytes + 839, 8}}}, + {{&grpc_static_metadata_refcounts[77], {{g_bytes + 812, 8}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[80], {{g_bytes + 847, 19}}}, + {{&grpc_static_metadata_refcounts[78], {{g_bytes + 820, 19}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[81], {{g_bytes + 866, 13}}}, + {{&grpc_static_metadata_refcounts[79], {{g_bytes + 839, 13}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, {{&grpc_static_metadata_refcounts[21], {{g_bytes + 282, 8}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[82], {{g_bytes + 879, 11}}}, + {{&grpc_static_metadata_refcounts[80], {{g_bytes + 852, 11}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[83], {{g_bytes + 890, 4}}}, + {{&grpc_static_metadata_refcounts[81], {{g_bytes + 863, 4}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[84], {{g_bytes + 894, 8}}}, + {{&grpc_static_metadata_refcounts[82], {{g_bytes + 867, 8}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[85], {{g_bytes + 902, 12}}}, + {{&grpc_static_metadata_refcounts[83], {{g_bytes + 875, 12}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[86], {{g_bytes + 914, 18}}}, + {{&grpc_static_metadata_refcounts[84], {{g_bytes + 887, 18}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[87], {{g_bytes + 932, 19}}}, + {{&grpc_static_metadata_refcounts[85], {{g_bytes + 905, 19}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[88], {{g_bytes + 951, 5}}}, + {{&grpc_static_metadata_refcounts[86], {{g_bytes + 924, 5}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[89], {{g_bytes + 956, 7}}}, + {{&grpc_static_metadata_refcounts[87], {{g_bytes + 929, 7}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[90], {{g_bytes + 963, 7}}}, + {{&grpc_static_metadata_refcounts[88], {{g_bytes + 936, 7}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[91], {{g_bytes + 970, 11}}}, + {{&grpc_static_metadata_refcounts[89], {{g_bytes + 943, 11}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[92], {{g_bytes + 981, 6}}}, + {{&grpc_static_metadata_refcounts[90], {{g_bytes + 954, 6}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[93], {{g_bytes + 987, 10}}}, + {{&grpc_static_metadata_refcounts[91], {{g_bytes + 960, 10}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[94], {{g_bytes + 997, 25}}}, + {{&grpc_static_metadata_refcounts[92], {{g_bytes + 970, 25}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[95], {{g_bytes + 1022, 17}}}, + {{&grpc_static_metadata_refcounts[93], {{g_bytes + 995, 17}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, {{&grpc_static_metadata_refcounts[19], {{g_bytes + 268, 10}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[96], {{g_bytes + 1039, 4}}}, + {{&grpc_static_metadata_refcounts[94], {{g_bytes + 1012, 4}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[97], {{g_bytes + 1043, 3}}}, + {{&grpc_static_metadata_refcounts[95], {{g_bytes + 1016, 3}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, - {{&grpc_static_metadata_refcounts[98], {{g_bytes + 1046, 16}}}, + {{&grpc_static_metadata_refcounts[96], {{g_bytes + 1019, 16}}}, {&grpc_static_metadata_refcounts[23], {{g_bytes + 302, 0}}}}, {{&grpc_static_metadata_refcounts[10], {{g_bytes + 90, 20}}}, - {&grpc_static_metadata_refcounts[35], {{g_bytes + 471, 8}}}}, + {&grpc_static_metadata_refcounts[35], {{g_bytes + 455, 8}}}}, {{&grpc_static_metadata_refcounts[10], {{g_bytes + 90, 20}}}, - {&grpc_static_metadata_refcounts[37], {{g_bytes + 483, 7}}}}, + {&grpc_static_metadata_refcounts[29], {{g_bytes + 430, 7}}}}, {{&grpc_static_metadata_refcounts[10], {{g_bytes + 90, 20}}}, - {&grpc_static_metadata_refcounts[99], {{g_bytes + 1062, 16}}}}, + {&grpc_static_metadata_refcounts[97], {{g_bytes + 1035, 16}}}}, {{&grpc_static_metadata_refcounts[10], {{g_bytes + 90, 20}}}, - {&grpc_static_metadata_refcounts[36], {{g_bytes + 479, 4}}}}, + {&grpc_static_metadata_refcounts[30], {{g_bytes + 437, 4}}}}, {{&grpc_static_metadata_refcounts[10], {{g_bytes + 90, 20}}}, - {&grpc_static_metadata_refcounts[100], {{g_bytes + 1078, 13}}}}, + {&grpc_static_metadata_refcounts[98], {{g_bytes + 1051, 13}}}}, {{&grpc_static_metadata_refcounts[10], {{g_bytes + 90, 20}}}, - {&grpc_static_metadata_refcounts[101], {{g_bytes + 1091, 12}}}}, + {&grpc_static_metadata_refcounts[99], {{g_bytes + 1064, 12}}}}, {{&grpc_static_metadata_refcounts[10], {{g_bytes + 90, 20}}}, - {&grpc_static_metadata_refcounts[102], {{g_bytes + 1103, 21}}}}, + {&grpc_static_metadata_refcounts[100], {{g_bytes + 1076, 21}}}}, {{&grpc_static_metadata_refcounts[16], {{g_bytes + 186, 15}}}, - {&grpc_static_metadata_refcounts[35], {{g_bytes + 471, 8}}}}, + {&grpc_static_metadata_refcounts[35], {{g_bytes + 455, 8}}}}, {{&grpc_static_metadata_refcounts[16], {{g_bytes + 186, 15}}}, - {&grpc_static_metadata_refcounts[36], {{g_bytes + 479, 4}}}}, + {&grpc_static_metadata_refcounts[30], {{g_bytes + 437, 4}}}}, {{&grpc_static_metadata_refcounts[16], {{g_bytes + 186, 15}}}, - {&grpc_static_metadata_refcounts[100], {{g_bytes + 1078, 13}}}}, + {&grpc_static_metadata_refcounts[98], {{g_bytes + 1051, 13}}}}, }; bool grpc_static_callout_is_default[GRPC_BATCH_CALLOUTS_COUNT] = { true, // :path diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h index 2413eb38db..8ce9b21bc1 100644 --- a/src/core/lib/transport/static_metadata.h +++ b/src/core/lib/transport/static_metadata.h @@ -20,7 +20,7 @@ * To make changes to this file, change * tools/codegen/core/gen_static_metadata.py, and then re-run it. * - * See metadata.h for an explanation of the interface here, and metadata.c for + * See metadata.h for an explanation of the interface here, and metadata.cc for * an explanation of what's going on. */ @@ -29,7 +29,7 @@ #include "src/core/lib/transport/metadata.h" -#define GRPC_STATIC_MDSTR_COUNT 103 +#define GRPC_STATIC_MDSTR_COUNT 101 extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]; /* ":path" */ #define GRPC_MDSTR_PATH (grpc_static_slice_table[0]) @@ -94,9 +94,9 @@ extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]; #define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \ (grpc_static_slice_table[28]) /* "deflate" */ -#define GRPC_MDSTR_MESSAGE_SLASH_DEFLATE (grpc_static_slice_table[29]) +#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table[29]) /* "gzip" */ -#define GRPC_MDSTR_MESSAGE_SLASH_GZIP (grpc_static_slice_table[30]) +#define GRPC_MDSTR_GZIP (grpc_static_slice_table[30]) /* "stream/gzip" */ #define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table[31]) /* "0" */ @@ -107,141 +107,137 @@ extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]; #define GRPC_MDSTR_2 (grpc_static_slice_table[34]) /* "identity" */ #define GRPC_MDSTR_IDENTITY (grpc_static_slice_table[35]) -/* "gzip" */ -#define GRPC_MDSTR_GZIP (grpc_static_slice_table[36]) -/* "deflate" */ -#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table[37]) /* "trailers" */ -#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[38]) +#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[36]) /* "application/grpc" */ -#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table[39]) +#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table[37]) /* "POST" */ -#define GRPC_MDSTR_POST (grpc_static_slice_table[40]) +#define GRPC_MDSTR_POST (grpc_static_slice_table[38]) /* "200" */ -#define GRPC_MDSTR_200 (grpc_static_slice_table[41]) +#define GRPC_MDSTR_200 (grpc_static_slice_table[39]) /* "404" */ -#define GRPC_MDSTR_404 (grpc_static_slice_table[42]) +#define GRPC_MDSTR_404 (grpc_static_slice_table[40]) /* "http" */ -#define GRPC_MDSTR_HTTP (grpc_static_slice_table[43]) +#define GRPC_MDSTR_HTTP (grpc_static_slice_table[41]) /* "https" */ -#define GRPC_MDSTR_HTTPS (grpc_static_slice_table[44]) +#define GRPC_MDSTR_HTTPS (grpc_static_slice_table[42]) /* "grpc" */ -#define GRPC_MDSTR_GRPC (grpc_static_slice_table[45]) +#define GRPC_MDSTR_GRPC (grpc_static_slice_table[43]) /* "GET" */ -#define GRPC_MDSTR_GET (grpc_static_slice_table[46]) +#define GRPC_MDSTR_GET (grpc_static_slice_table[44]) /* "PUT" */ -#define GRPC_MDSTR_PUT (grpc_static_slice_table[47]) +#define GRPC_MDSTR_PUT (grpc_static_slice_table[45]) /* "/" */ -#define GRPC_MDSTR_SLASH (grpc_static_slice_table[48]) +#define GRPC_MDSTR_SLASH (grpc_static_slice_table[46]) /* "/index.html" */ -#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table[49]) +#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table[47]) /* "204" */ -#define GRPC_MDSTR_204 (grpc_static_slice_table[50]) +#define GRPC_MDSTR_204 (grpc_static_slice_table[48]) /* "206" */ -#define GRPC_MDSTR_206 (grpc_static_slice_table[51]) +#define GRPC_MDSTR_206 (grpc_static_slice_table[49]) /* "304" */ -#define GRPC_MDSTR_304 (grpc_static_slice_table[52]) +#define GRPC_MDSTR_304 (grpc_static_slice_table[50]) /* "400" */ -#define GRPC_MDSTR_400 (grpc_static_slice_table[53]) +#define GRPC_MDSTR_400 (grpc_static_slice_table[51]) /* "500" */ -#define GRPC_MDSTR_500 (grpc_static_slice_table[54]) +#define GRPC_MDSTR_500 (grpc_static_slice_table[52]) /* "accept-charset" */ -#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[55]) +#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[53]) /* "gzip, deflate" */ -#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table[56]) +#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table[54]) /* "accept-language" */ -#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[57]) +#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[55]) /* "accept-ranges" */ -#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[58]) +#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[56]) /* "accept" */ -#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[59]) +#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[57]) /* "access-control-allow-origin" */ -#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table[60]) +#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table[58]) /* "age" */ -#define GRPC_MDSTR_AGE (grpc_static_slice_table[61]) +#define GRPC_MDSTR_AGE (grpc_static_slice_table[59]) /* "allow" */ -#define GRPC_MDSTR_ALLOW (grpc_static_slice_table[62]) +#define GRPC_MDSTR_ALLOW (grpc_static_slice_table[60]) /* "authorization" */ -#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[63]) +#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[61]) /* "cache-control" */ -#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[64]) +#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[62]) /* "content-disposition" */ -#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[65]) +#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[63]) /* "content-language" */ -#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[66]) +#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[64]) /* "content-length" */ -#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[67]) +#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[65]) /* "content-location" */ -#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[68]) +#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[66]) /* "content-range" */ -#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[69]) +#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[67]) /* "cookie" */ -#define GRPC_MDSTR_COOKIE (grpc_static_slice_table[70]) +#define GRPC_MDSTR_COOKIE (grpc_static_slice_table[68]) /* "date" */ -#define GRPC_MDSTR_DATE (grpc_static_slice_table[71]) +#define GRPC_MDSTR_DATE (grpc_static_slice_table[69]) /* "etag" */ -#define GRPC_MDSTR_ETAG (grpc_static_slice_table[72]) +#define GRPC_MDSTR_ETAG (grpc_static_slice_table[70]) /* "expect" */ -#define GRPC_MDSTR_EXPECT (grpc_static_slice_table[73]) +#define GRPC_MDSTR_EXPECT (grpc_static_slice_table[71]) /* "expires" */ -#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[74]) +#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[72]) /* "from" */ -#define GRPC_MDSTR_FROM (grpc_static_slice_table[75]) +#define GRPC_MDSTR_FROM (grpc_static_slice_table[73]) /* "if-match" */ -#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table[76]) +#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table[74]) /* "if-modified-since" */ -#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table[77]) +#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table[75]) /* "if-none-match" */ -#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[78]) +#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[76]) /* "if-range" */ -#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table[79]) +#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table[77]) /* "if-unmodified-since" */ -#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[80]) +#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[78]) /* "last-modified" */ -#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[81]) +#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[79]) /* "lb-cost-bin" */ -#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table[82]) +#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table[80]) /* "link" */ -#define GRPC_MDSTR_LINK (grpc_static_slice_table[83]) +#define GRPC_MDSTR_LINK (grpc_static_slice_table[81]) /* "location" */ -#define GRPC_MDSTR_LOCATION (grpc_static_slice_table[84]) +#define GRPC_MDSTR_LOCATION (grpc_static_slice_table[82]) /* "max-forwards" */ -#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[85]) +#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[83]) /* "proxy-authenticate" */ -#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[86]) +#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[84]) /* "proxy-authorization" */ -#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[87]) +#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[85]) /* "range" */ -#define GRPC_MDSTR_RANGE (grpc_static_slice_table[88]) +#define GRPC_MDSTR_RANGE (grpc_static_slice_table[86]) /* "referer" */ -#define GRPC_MDSTR_REFERER (grpc_static_slice_table[89]) +#define GRPC_MDSTR_REFERER (grpc_static_slice_table[87]) /* "refresh" */ -#define GRPC_MDSTR_REFRESH (grpc_static_slice_table[90]) +#define GRPC_MDSTR_REFRESH (grpc_static_slice_table[88]) /* "retry-after" */ -#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[91]) +#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[89]) /* "server" */ -#define GRPC_MDSTR_SERVER (grpc_static_slice_table[92]) +#define GRPC_MDSTR_SERVER (grpc_static_slice_table[90]) /* "set-cookie" */ -#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table[93]) +#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table[91]) /* "strict-transport-security" */ -#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[94]) +#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[92]) /* "transfer-encoding" */ -#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[95]) +#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[93]) /* "vary" */ -#define GRPC_MDSTR_VARY (grpc_static_slice_table[96]) +#define GRPC_MDSTR_VARY (grpc_static_slice_table[94]) /* "via" */ -#define GRPC_MDSTR_VIA (grpc_static_slice_table[97]) +#define GRPC_MDSTR_VIA (grpc_static_slice_table[95]) /* "www-authenticate" */ -#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[98]) +#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[96]) /* "identity,deflate" */ -#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table[99]) +#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table[97]) /* "identity,gzip" */ -#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table[100]) +#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table[98]) /* "deflate,gzip" */ -#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table[101]) +#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table[99]) /* "identity,deflate,gzip" */ #define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ - (grpc_static_slice_table[102]) + (grpc_static_slice_table[100]) extern const grpc_slice_refcount_vtable grpc_static_metadata_vtable; extern grpc_slice_refcount @@ -590,5 +586,4 @@ extern const uint8_t grpc_static_accept_stream_encoding_metadata[4]; (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table \ [grpc_static_accept_stream_encoding_metadata[(algs)]], \ GRPC_MDELEM_STORAGE_STATIC)) - #endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */ diff --git a/test/core/compression/compression_test.cc b/test/core/compression/compression_test.cc index 3ec238dc31..589d91bbba 100644 --- a/test/core/compression/compression_test.cc +++ b/test/core/compression/compression_test.cc @@ -28,8 +28,7 @@ static void test_compression_algorithm_parse(void) { size_t i; - const char* valid_names[] = {"identity", "gzip", "deflate", - "stream/gzip"}; + const char* valid_names[] = {"identity", "gzip", "deflate", "stream/gzip"}; const grpc_compression_algorithm valid_algorithms[] = { GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_STREAM_GZIP}; @@ -61,8 +60,7 @@ static void test_compression_algorithm_name(void) { int success; const char* name; size_t i; - const char* valid_names[] = {"identity", "gzip", "deflate", - "stream/gzip"}; + const char* valid_names[] = {"identity", "gzip", "deflate", "stream/gzip"}; const grpc_compression_algorithm valid_algorithms[] = { GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_STREAM_GZIP}; diff --git a/test/core/end2end/fuzzers/hpack.dictionary b/test/core/end2end/fuzzers/hpack.dictionary index 6021c3a7ae..3ed82e19bd 100644 --- a/test/core/end2end/fuzzers/hpack.dictionary +++ b/test/core/end2end/fuzzers/hpack.dictionary @@ -28,15 +28,13 @@ "\x1Egrpc.max_request_message_bytes" "\x1Fgrpc.max_response_message_bytes" "$/grpc.lb.v1.LoadBalancer/BalanceLoad" -"\x0Fdeflate" -"\x0Cgzip" +"\x07deflate" +"\x04gzip" "\x0Bstream/gzip" "\x010" "\x011" "\x012" "\x08identity" -"\x04gzip" -"\x07deflate" "\x08trailers" "\x10application/grpc" "\x04POST" diff --git a/test/core/end2end/tests/compressed_payload.cc b/test/core/end2end/tests/compressed_payload.cc index a0d3ec48a5..944edc7a70 100644 --- a/test/core/end2end/tests/compressed_payload.cc +++ b/test/core/end2end/tests/compressed_payload.cc @@ -596,8 +596,7 @@ static void test_invoke_request_with_compressed_payload_md_override( grpc_metadata identity_compression_override; gzip_compression_override.key = GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST; - gzip_compression_override.value = - grpc_slice_from_static_string("gzip"); + gzip_compression_override.value = grpc_slice_from_static_string("gzip"); memset(&gzip_compression_override.internal_data, 0, sizeof(gzip_compression_override.internal_data)); -- cgit v1.2.3 From cda058de8eca762b4aa38eac3ecb7465f7b118f5 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 6 Feb 2018 18:15:32 -0800 Subject: build projects --- CMakeLists.txt | 11 ----------- Makefile | 11 ----------- config.m4 | 1 - config.w32 | 1 - gRPC-Core.podspec | 2 -- grpc.def | 2 -- grpc.gemspec | 2 -- grpc.gyp | 4 ---- include/grpc/module.modulemap | 1 - package.xml | 2 -- src/python/grpcio/grpc_core_dependencies.py | 1 - src/ruby/ext/grpc/rb_grpc_imports.generated.c | 4 ---- src/ruby/ext/grpc/rb_grpc_imports.generated.h | 7 ------- test/core/surface/public_headers_must_be_c89.c | 3 --- tools/doxygen/Doxyfile.c++ | 1 - tools/doxygen/Doxyfile.c++.internal | 1 - tools/doxygen/Doxyfile.core | 1 - tools/doxygen/Doxyfile.core.internal | 2 -- tools/run_tests/generated/sources_and_headers.json | 3 --- 19 files changed, 60 deletions(-) (limited to 'test/core') diff --git a/CMakeLists.txt b/CMakeLists.txt index e870c1b8af..e78164e228 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -803,7 +803,6 @@ add_library(grpc src/core/lib/channel/handshaker_registry.cc src/core/lib/compression/compression.cc src/core/lib/compression/compression_internal.cc - src/core/lib/compression/compression_ruby.cc src/core/lib/compression/message_compress.cc src/core/lib/compression/stream_compression.cc src/core/lib/compression/stream_compression_gzip.cc @@ -1104,7 +1103,6 @@ foreach(_hdr include/grpc/byte_buffer.h include/grpc/byte_buffer_reader.h include/grpc/compression.h - include/grpc/compression_ruby.h include/grpc/fork.h include/grpc/grpc.h include/grpc/grpc_posix.h @@ -1145,7 +1143,6 @@ add_library(grpc_cronet src/core/lib/channel/handshaker_registry.cc src/core/lib/compression/compression.cc src/core/lib/compression/compression_internal.cc - src/core/lib/compression/compression_ruby.cc src/core/lib/compression/message_compress.cc src/core/lib/compression/stream_compression.cc src/core/lib/compression/stream_compression_gzip.cc @@ -1469,7 +1466,6 @@ add_library(grpc_test_util src/core/lib/channel/handshaker_registry.cc src/core/lib/compression/compression.cc src/core/lib/compression/compression_internal.cc - src/core/lib/compression/compression_ruby.cc src/core/lib/compression/message_compress.cc src/core/lib/compression/stream_compression.cc src/core/lib/compression/stream_compression_gzip.cc @@ -1737,7 +1733,6 @@ add_library(grpc_test_util_unsecure src/core/lib/channel/handshaker_registry.cc src/core/lib/compression/compression.cc src/core/lib/compression/compression_internal.cc - src/core/lib/compression/compression_ruby.cc src/core/lib/compression/message_compress.cc src/core/lib/compression/stream_compression.cc src/core/lib/compression/stream_compression_gzip.cc @@ -1988,7 +1983,6 @@ add_library(grpc_unsecure src/core/lib/channel/handshaker_registry.cc src/core/lib/compression/compression.cc src/core/lib/compression/compression_internal.cc - src/core/lib/compression/compression_ruby.cc src/core/lib/compression/message_compress.cc src/core/lib/compression/stream_compression.cc src/core/lib/compression/stream_compression_gzip.cc @@ -2255,7 +2249,6 @@ foreach(_hdr include/grpc/byte_buffer.h include/grpc/byte_buffer_reader.h include/grpc/compression.h - include/grpc/compression_ruby.h include/grpc/fork.h include/grpc/grpc.h include/grpc/grpc_posix.h @@ -2530,7 +2523,6 @@ foreach(_hdr include/grpc/byte_buffer.h include/grpc/byte_buffer_reader.h include/grpc/compression.h - include/grpc/compression_ruby.h include/grpc/fork.h include/grpc/grpc.h include/grpc/grpc_posix.h @@ -2722,7 +2714,6 @@ add_library(grpc++_cronet src/core/lib/channel/handshaker_registry.cc src/core/lib/compression/compression.cc src/core/lib/compression/compression_internal.cc - src/core/lib/compression/compression_ruby.cc src/core/lib/compression/message_compress.cc src/core/lib/compression/stream_compression.cc src/core/lib/compression/stream_compression_gzip.cc @@ -3005,7 +2996,6 @@ foreach(_hdr include/grpc/byte_buffer.h include/grpc/byte_buffer_reader.h include/grpc/compression.h - include/grpc/compression_ruby.h include/grpc/fork.h include/grpc/grpc.h include/grpc/grpc_posix.h @@ -3736,7 +3726,6 @@ foreach(_hdr include/grpc/byte_buffer.h include/grpc/byte_buffer_reader.h include/grpc/compression.h - include/grpc/compression_ruby.h include/grpc/fork.h include/grpc/grpc.h include/grpc/grpc_posix.h diff --git a/Makefile b/Makefile index fa13b0d127..ec9f60b8f4 100644 --- a/Makefile +++ b/Makefile @@ -3029,7 +3029,6 @@ LIBGRPC_SRC = \ src/core/lib/channel/handshaker_registry.cc \ src/core/lib/compression/compression.cc \ src/core/lib/compression/compression_internal.cc \ - src/core/lib/compression/compression_ruby.cc \ src/core/lib/compression/message_compress.cc \ src/core/lib/compression/stream_compression.cc \ src/core/lib/compression/stream_compression_gzip.cc \ @@ -3297,7 +3296,6 @@ PUBLIC_HEADERS_C += \ include/grpc/byte_buffer.h \ include/grpc/byte_buffer_reader.h \ include/grpc/compression.h \ - include/grpc/compression_ruby.h \ include/grpc/fork.h \ include/grpc/grpc.h \ include/grpc/grpc_posix.h \ @@ -3373,7 +3371,6 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/channel/handshaker_registry.cc \ src/core/lib/compression/compression.cc \ src/core/lib/compression/compression_internal.cc \ - src/core/lib/compression/compression_ruby.cc \ src/core/lib/compression/message_compress.cc \ src/core/lib/compression/stream_compression.cc \ src/core/lib/compression/stream_compression_gzip.cc \ @@ -3698,7 +3695,6 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/lib/channel/handshaker_registry.cc \ src/core/lib/compression/compression.cc \ src/core/lib/compression/compression_internal.cc \ - src/core/lib/compression/compression_ruby.cc \ src/core/lib/compression/message_compress.cc \ src/core/lib/compression/stream_compression.cc \ src/core/lib/compression/stream_compression_gzip.cc \ @@ -3959,7 +3955,6 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ src/core/lib/channel/handshaker_registry.cc \ src/core/lib/compression/compression.cc \ src/core/lib/compression/compression_internal.cc \ - src/core/lib/compression/compression_ruby.cc \ src/core/lib/compression/message_compress.cc \ src/core/lib/compression/stream_compression.cc \ src/core/lib/compression/stream_compression_gzip.cc \ @@ -4190,7 +4185,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/channel/handshaker_registry.cc \ src/core/lib/compression/compression.cc \ src/core/lib/compression/compression_internal.cc \ - src/core/lib/compression/compression_ruby.cc \ src/core/lib/compression/message_compress.cc \ src/core/lib/compression/stream_compression.cc \ src/core/lib/compression/stream_compression_gzip.cc \ @@ -4425,7 +4419,6 @@ PUBLIC_HEADERS_C += \ include/grpc/byte_buffer.h \ include/grpc/byte_buffer_reader.h \ include/grpc/compression.h \ - include/grpc/compression_ruby.h \ include/grpc/fork.h \ include/grpc/grpc.h \ include/grpc/grpc_posix.h \ @@ -4685,7 +4678,6 @@ PUBLIC_HEADERS_CXX += \ include/grpc/byte_buffer.h \ include/grpc/byte_buffer_reader.h \ include/grpc/compression.h \ - include/grpc/compression_ruby.h \ include/grpc/fork.h \ include/grpc/grpc.h \ include/grpc/grpc_posix.h \ @@ -4925,7 +4917,6 @@ LIBGRPC++_CRONET_SRC = \ src/core/lib/channel/handshaker_registry.cc \ src/core/lib/compression/compression.cc \ src/core/lib/compression/compression_internal.cc \ - src/core/lib/compression/compression_ruby.cc \ src/core/lib/compression/message_compress.cc \ src/core/lib/compression/stream_compression.cc \ src/core/lib/compression/stream_compression_gzip.cc \ @@ -5173,7 +5164,6 @@ PUBLIC_HEADERS_CXX += \ include/grpc/byte_buffer.h \ include/grpc/byte_buffer_reader.h \ include/grpc/compression.h \ - include/grpc/compression_ruby.h \ include/grpc/fork.h \ include/grpc/grpc.h \ include/grpc/grpc_posix.h \ @@ -5893,7 +5883,6 @@ PUBLIC_HEADERS_CXX += \ include/grpc/byte_buffer.h \ include/grpc/byte_buffer_reader.h \ include/grpc/compression.h \ - include/grpc/compression_ruby.h \ include/grpc/fork.h \ include/grpc/grpc.h \ include/grpc/grpc_posix.h \ diff --git a/config.m4 b/config.m4 index c60c252b5c..54340ba795 100644 --- a/config.m4 +++ b/config.m4 @@ -94,7 +94,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/channel/handshaker_registry.cc \ src/core/lib/compression/compression.cc \ src/core/lib/compression/compression_internal.cc \ - src/core/lib/compression/compression_ruby.cc \ src/core/lib/compression/message_compress.cc \ src/core/lib/compression/stream_compression.cc \ src/core/lib/compression/stream_compression_gzip.cc \ diff --git a/config.w32 b/config.w32 index 888596bdab..e50e7f3c66 100644 --- a/config.w32 +++ b/config.w32 @@ -71,7 +71,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\channel\\handshaker_registry.cc " + "src\\core\\lib\\compression\\compression.cc " + "src\\core\\lib\\compression\\compression_internal.cc " + - "src\\core\\lib\\compression\\compression_ruby.cc " + "src\\core\\lib\\compression\\message_compress.cc " + "src\\core\\lib\\compression\\stream_compression.cc " + "src\\core\\lib\\compression\\stream_compression_gzip.cc " + diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index b28459eb59..c767b595b3 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -173,7 +173,6 @@ Pod::Spec.new do |s| 'include/grpc/byte_buffer.h', 'include/grpc/byte_buffer_reader.h', 'include/grpc/compression.h', - 'include/grpc/compression_ruby.h', 'include/grpc/fork.h', 'include/grpc/grpc.h', 'include/grpc/grpc_posix.h', @@ -481,7 +480,6 @@ Pod::Spec.new do |s| 'src/core/lib/channel/handshaker_registry.cc', 'src/core/lib/compression/compression.cc', 'src/core/lib/compression/compression_internal.cc', - 'src/core/lib/compression/compression_ruby.cc', 'src/core/lib/compression/message_compress.cc', 'src/core/lib/compression/stream_compression.cc', 'src/core/lib/compression/stream_compression_gzip.cc', diff --git a/grpc.def b/grpc.def index be59ef0092..102e551e3c 100644 --- a/grpc.def +++ b/grpc.def @@ -8,8 +8,6 @@ EXPORTS grpc_compression_options_enable_algorithm grpc_compression_options_disable_algorithm grpc_compression_options_is_algorithm_enabled - grpc_compression_algorithm_parse_ruby - grpc_compression_algorithm_name_ruby grpc_metadata_array_init grpc_metadata_array_destroy grpc_call_details_init diff --git a/grpc.gemspec b/grpc.gemspec index 39174cc97d..f8135962d1 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -170,7 +170,6 @@ Gem::Specification.new do |s| s.files += %w( include/grpc/byte_buffer.h ) s.files += %w( include/grpc/byte_buffer_reader.h ) s.files += %w( include/grpc/compression.h ) - s.files += %w( include/grpc/compression_ruby.h ) s.files += %w( include/grpc/fork.h ) s.files += %w( include/grpc/grpc.h ) s.files += %w( include/grpc/grpc_posix.h ) @@ -411,7 +410,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/channel/handshaker_registry.cc ) s.files += %w( src/core/lib/compression/compression.cc ) s.files += %w( src/core/lib/compression/compression_internal.cc ) - s.files += %w( src/core/lib/compression/compression_ruby.cc ) s.files += %w( src/core/lib/compression/message_compress.cc ) s.files += %w( src/core/lib/compression/stream_compression.cc ) s.files += %w( src/core/lib/compression/stream_compression_gzip.cc ) diff --git a/grpc.gyp b/grpc.gyp index 63f2eae80f..728f27b125 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -235,7 +235,6 @@ 'src/core/lib/channel/handshaker_registry.cc', 'src/core/lib/compression/compression.cc', 'src/core/lib/compression/compression_internal.cc', - 'src/core/lib/compression/compression_ruby.cc', 'src/core/lib/compression/message_compress.cc', 'src/core/lib/compression/stream_compression.cc', 'src/core/lib/compression/stream_compression_gzip.cc', @@ -530,7 +529,6 @@ 'src/core/lib/channel/handshaker_registry.cc', 'src/core/lib/compression/compression.cc', 'src/core/lib/compression/compression_internal.cc', - 'src/core/lib/compression/compression_ruby.cc', 'src/core/lib/compression/message_compress.cc', 'src/core/lib/compression/stream_compression.cc', 'src/core/lib/compression/stream_compression_gzip.cc', @@ -743,7 +741,6 @@ 'src/core/lib/channel/handshaker_registry.cc', 'src/core/lib/compression/compression.cc', 'src/core/lib/compression/compression_internal.cc', - 'src/core/lib/compression/compression_ruby.cc', 'src/core/lib/compression/message_compress.cc', 'src/core/lib/compression/stream_compression.cc', 'src/core/lib/compression/stream_compression_gzip.cc', @@ -938,7 +935,6 @@ 'src/core/lib/channel/handshaker_registry.cc', 'src/core/lib/compression/compression.cc', 'src/core/lib/compression/compression_internal.cc', - 'src/core/lib/compression/compression_ruby.cc', 'src/core/lib/compression/message_compress.cc', 'src/core/lib/compression/stream_compression.cc', 'src/core/lib/compression/stream_compression_gzip.cc', diff --git a/include/grpc/module.modulemap b/include/grpc/module.modulemap index d23072f556..da95515d8e 100644 --- a/include/grpc/module.modulemap +++ b/include/grpc/module.modulemap @@ -45,7 +45,6 @@ framework module grpc { header "byte_buffer.h" header "byte_buffer_reader.h" header "compression.h" - header "compression_ruby.h" header "fork.h" header "grpc.h" header "grpc_posix.h" diff --git a/package.xml b/package.xml index 7c32a73b4f..d8277fd68b 100644 --- a/package.xml +++ b/package.xml @@ -177,7 +177,6 @@ - @@ -418,7 +417,6 @@ - diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 83dd5df54b..3d8ee10443 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -70,7 +70,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/channel/handshaker_registry.cc', 'src/core/lib/compression/compression.cc', 'src/core/lib/compression/compression_internal.cc', - 'src/core/lib/compression/compression_ruby.cc', 'src/core/lib/compression/message_compress.cc', 'src/core/lib/compression/stream_compression.cc', 'src/core/lib/compression/stream_compression_gzip.cc', diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c index 0734fb31d5..576084b3c2 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c @@ -31,8 +31,6 @@ grpc_compression_options_init_type grpc_compression_options_init_import; grpc_compression_options_enable_algorithm_type grpc_compression_options_enable_algorithm_import; grpc_compression_options_disable_algorithm_type grpc_compression_options_disable_algorithm_import; grpc_compression_options_is_algorithm_enabled_type grpc_compression_options_is_algorithm_enabled_import; -grpc_compression_algorithm_parse_ruby_type grpc_compression_algorithm_parse_ruby_import; -grpc_compression_algorithm_name_ruby_type grpc_compression_algorithm_name_ruby_import; grpc_metadata_array_init_type grpc_metadata_array_init_import; grpc_metadata_array_destroy_type grpc_metadata_array_destroy_import; grpc_call_details_init_type grpc_call_details_init_import; @@ -300,8 +298,6 @@ void grpc_rb_load_imports(HMODULE library) { grpc_compression_options_enable_algorithm_import = (grpc_compression_options_enable_algorithm_type) GetProcAddress(library, "grpc_compression_options_enable_algorithm"); grpc_compression_options_disable_algorithm_import = (grpc_compression_options_disable_algorithm_type) GetProcAddress(library, "grpc_compression_options_disable_algorithm"); grpc_compression_options_is_algorithm_enabled_import = (grpc_compression_options_is_algorithm_enabled_type) GetProcAddress(library, "grpc_compression_options_is_algorithm_enabled"); - grpc_compression_algorithm_parse_ruby_import = (grpc_compression_algorithm_parse_ruby_type) GetProcAddress(library, "grpc_compression_algorithm_parse_ruby"); - grpc_compression_algorithm_name_ruby_import = (grpc_compression_algorithm_name_ruby_type) GetProcAddress(library, "grpc_compression_algorithm_name_ruby"); grpc_metadata_array_init_import = (grpc_metadata_array_init_type) GetProcAddress(library, "grpc_metadata_array_init"); grpc_metadata_array_destroy_import = (grpc_metadata_array_destroy_type) GetProcAddress(library, "grpc_metadata_array_destroy"); grpc_call_details_init_import = (grpc_call_details_init_type) GetProcAddress(library, "grpc_call_details_init"); diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h index 9e5dd2d699..60f2409578 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -73,12 +72,6 @@ extern grpc_compression_options_disable_algorithm_type grpc_compression_options_ typedef int(*grpc_compression_options_is_algorithm_enabled_type)(const grpc_compression_options* opts, grpc_compression_algorithm algorithm); extern grpc_compression_options_is_algorithm_enabled_type grpc_compression_options_is_algorithm_enabled_import; #define grpc_compression_options_is_algorithm_enabled grpc_compression_options_is_algorithm_enabled_import -typedef int(*grpc_compression_algorithm_parse_ruby_type)(grpc_slice value, grpc_compression_algorithm* algorithm); -extern grpc_compression_algorithm_parse_ruby_type grpc_compression_algorithm_parse_ruby_import; -#define grpc_compression_algorithm_parse_ruby grpc_compression_algorithm_parse_ruby_import -typedef int(*grpc_compression_algorithm_name_ruby_type)(grpc_compression_algorithm algorithm, const char** name); -extern grpc_compression_algorithm_name_ruby_type grpc_compression_algorithm_name_ruby_import; -#define grpc_compression_algorithm_name_ruby grpc_compression_algorithm_name_ruby_import typedef void(*grpc_metadata_array_init_type)(grpc_metadata_array* array); extern grpc_metadata_array_init_type grpc_metadata_array_init_import; #define grpc_metadata_array_init grpc_metadata_array_init_import diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c index 36d5ad66a5..a1d736f81c 100644 --- a/test/core/surface/public_headers_must_be_c89.c +++ b/test/core/surface/public_headers_must_be_c89.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -76,8 +75,6 @@ int main(int argc, char **argv) { printf("%lx", (unsigned long) grpc_compression_options_enable_algorithm); printf("%lx", (unsigned long) grpc_compression_options_disable_algorithm); printf("%lx", (unsigned long) grpc_compression_options_is_algorithm_enabled); - printf("%lx", (unsigned long) grpc_compression_algorithm_parse_ruby); - printf("%lx", (unsigned long) grpc_compression_algorithm_name_ruby); printf("%lx", (unsigned long) grpc_metadata_array_init); printf("%lx", (unsigned long) grpc_metadata_array_destroy); printf("%lx", (unsigned long) grpc_call_details_init); diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 6873256dcd..f84b4fe2d3 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -875,7 +875,6 @@ include/grpc++/support/time.h \ include/grpc/byte_buffer.h \ include/grpc/byte_buffer_reader.h \ include/grpc/compression.h \ -include/grpc/compression_ruby.h \ include/grpc/fork.h \ include/grpc/grpc.h \ include/grpc/grpc_posix.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 0ffbe9f73b..d4ed461d25 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -876,7 +876,6 @@ include/grpc++/support/time.h \ include/grpc/byte_buffer.h \ include/grpc/byte_buffer_reader.h \ include/grpc/compression.h \ -include/grpc/compression_ruby.h \ include/grpc/fork.h \ include/grpc/grpc.h \ include/grpc/grpc_posix.h \ diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index b28966088c..3d42772e84 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -801,7 +801,6 @@ include/grpc/byte_buffer.h \ include/grpc/byte_buffer_reader.h \ include/grpc/census.h \ include/grpc/compression.h \ -include/grpc/compression_ruby.h \ include/grpc/fork.h \ include/grpc/grpc.h \ include/grpc/grpc_posix.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 90ba2a76af..47f430110d 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -801,7 +801,6 @@ include/grpc/byte_buffer.h \ include/grpc/byte_buffer_reader.h \ include/grpc/census.h \ include/grpc/compression.h \ -include/grpc/compression_ruby.h \ include/grpc/fork.h \ include/grpc/grpc.h \ include/grpc/grpc_posix.h \ @@ -1053,7 +1052,6 @@ src/core/lib/compression/algorithm_metadata.h \ src/core/lib/compression/compression.cc \ src/core/lib/compression/compression_internal.cc \ src/core/lib/compression/compression_internal.h \ -src/core/lib/compression/compression_ruby.cc \ src/core/lib/compression/message_compress.cc \ src/core/lib/compression/message_compress.h \ src/core/lib/compression/stream_compression.cc \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 69c178c723..e65ce0c13e 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -8391,7 +8391,6 @@ "src/core/lib/channel/handshaker_registry.cc", "src/core/lib/compression/compression.cc", "src/core/lib/compression/compression_internal.cc", - "src/core/lib/compression/compression_ruby.cc", "src/core/lib/compression/message_compress.cc", "src/core/lib/compression/stream_compression.cc", "src/core/lib/compression/stream_compression_gzip.cc", @@ -8529,7 +8528,6 @@ "include/grpc/byte_buffer.h", "include/grpc/byte_buffer_reader.h", "include/grpc/compression.h", - "include/grpc/compression_ruby.h", "include/grpc/fork.h", "include/grpc/grpc.h", "include/grpc/grpc_posix.h", @@ -8671,7 +8669,6 @@ "include/grpc/byte_buffer.h", "include/grpc/byte_buffer_reader.h", "include/grpc/compression.h", - "include/grpc/compression_ruby.h", "include/grpc/fork.h", "include/grpc/grpc.h", "include/grpc/grpc_posix.h", -- cgit v1.2.3 From 2711e386ece721653180a2853b9803a942e3226d Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 6 Feb 2018 18:41:01 -0800 Subject: Update prefix length in algorithm_test --- test/core/compression/algorithm_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/core') diff --git a/test/core/compression/algorithm_test.cc b/test/core/compression/algorithm_test.cc index 1699d27142..b053c399a1 100644 --- a/test/core/compression/algorithm_test.cc +++ b/test/core/compression/algorithm_test.cc @@ -29,7 +29,7 @@ #include "src/core/lib/transport/static_metadata.h" #include "test/core/util/test_config.h" -const uint32_t message_prefix_length = 8; +const uint32_t message_prefix_length = 0; const uint32_t stream_prefix_length = 7; static void test_algorithm_mesh(void) { int i; -- cgit v1.2.3