From ac2e88f9567c7e90f615738fb759537385dcc858 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 27 Apr 2016 14:13:27 -0700 Subject: Initial attempt at adding support for max metadata size. Currently, the code does not seem to be properly causing the RPC to fail when the max size is exceeded. --- src/core/lib/transport/metadata.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core/lib/transport') diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h index 713d9e6782..277c257933 100644 --- a/src/core/lib/transport/metadata.h +++ b/src/core/lib/transport/metadata.h @@ -146,6 +146,8 @@ void grpc_mdelem_unref(grpc_mdelem *md); const char *grpc_mdstr_as_c_string(grpc_mdstr *s); #define GRPC_MDSTR_LENGTH(s) (GPR_SLICE_LENGTH(s->slice)) +#define GRPC_MDELEM_LENGTH(e) (GRPC_MDSTR_LENGTH(e->key) + \ + GRPC_MDSTR_LENGTH(e->value)) int grpc_mdstr_is_legal_header(grpc_mdstr *s); int grpc_mdstr_is_legal_nonbin_header(grpc_mdstr *s); -- cgit v1.2.3 From c2de452309c91b934382c2ea77eff5d9e53caad1 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 29 Apr 2016 10:25:27 -0700 Subject: Fix header-size computation to comply with the HTTP/2 RFC. --- src/core/lib/transport/metadata.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/core/lib/transport') diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h index 277c257933..77c32c72de 100644 --- a/src/core/lib/transport/metadata.h +++ b/src/core/lib/transport/metadata.h @@ -146,8 +146,10 @@ void grpc_mdelem_unref(grpc_mdelem *md); const char *grpc_mdstr_as_c_string(grpc_mdstr *s); #define GRPC_MDSTR_LENGTH(s) (GPR_SLICE_LENGTH(s->slice)) + +/* We add 32 bytes of padding as per RFC-7540 section 6.5.2. */ #define GRPC_MDELEM_LENGTH(e) (GRPC_MDSTR_LENGTH(e->key) + \ - GRPC_MDSTR_LENGTH(e->value)) + GRPC_MDSTR_LENGTH(e->value) + 32) int grpc_mdstr_is_legal_header(grpc_mdstr *s); int grpc_mdstr_is_legal_nonbin_header(grpc_mdstr *s); -- cgit v1.2.3 From 125590f9d5ebc53271846401d6087e47eced9897 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Mon, 2 May 2016 07:37:16 -0700 Subject: Add grpc_metadata_batch_size() function. --- src/core/lib/transport/metadata.h | 4 ++-- src/core/lib/transport/metadata_batch.c | 9 +++++++++ src/core/lib/transport/metadata_batch.h | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/core/lib/transport') diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h index 77c32c72de..4ecbbd1b1b 100644 --- a/src/core/lib/transport/metadata.h +++ b/src/core/lib/transport/metadata.h @@ -148,8 +148,8 @@ const char *grpc_mdstr_as_c_string(grpc_mdstr *s); #define GRPC_MDSTR_LENGTH(s) (GPR_SLICE_LENGTH(s->slice)) /* We add 32 bytes of padding as per RFC-7540 section 6.5.2. */ -#define GRPC_MDELEM_LENGTH(e) (GRPC_MDSTR_LENGTH(e->key) + \ - GRPC_MDSTR_LENGTH(e->value) + 32) +#define GRPC_MDELEM_LENGTH(e) (GRPC_MDSTR_LENGTH((e)->key) + \ + GRPC_MDSTR_LENGTH((e)->value) + 32) int grpc_mdstr_is_legal_header(grpc_mdstr *s); int grpc_mdstr_is_legal_nonbin_header(grpc_mdstr *s); diff --git a/src/core/lib/transport/metadata_batch.c b/src/core/lib/transport/metadata_batch.c index 4567221a48..4e1cd8e2c1 100644 --- a/src/core/lib/transport/metadata_batch.c +++ b/src/core/lib/transport/metadata_batch.c @@ -192,3 +192,12 @@ int grpc_metadata_batch_is_empty(grpc_metadata_batch *batch) { gpr_time_cmp(gpr_inf_future(batch->deadline.clock_type), batch->deadline) == 0; } + +size_t grpc_metadata_batch_size(grpc_metadata_batch *batch) { + size_t size = 0; + for (grpc_linked_mdelem* elem = batch->list.head; + elem != NULL; elem = elem->next) { + size += GRPC_MDELEM_LENGTH(elem->md); + } + return size; +} diff --git a/src/core/lib/transport/metadata_batch.h b/src/core/lib/transport/metadata_batch.h index b62668876e..7af823f7ca 100644 --- a/src/core/lib/transport/metadata_batch.h +++ b/src/core/lib/transport/metadata_batch.h @@ -66,6 +66,9 @@ void grpc_metadata_batch_destroy(grpc_metadata_batch *batch); void grpc_metadata_batch_clear(grpc_metadata_batch *batch); int grpc_metadata_batch_is_empty(grpc_metadata_batch *batch); +/* Returns the transport size of the batch. */ +size_t grpc_metadata_batch_size(grpc_metadata_batch *batch); + /** Moves the metadata information from \a src to \a dst. Upon return, \a src is * zeroed. */ void grpc_metadata_batch_move(grpc_metadata_batch *dst, -- cgit v1.2.3 From 22b338e2109745a27f1f84de8490bc8148df1a79 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 4 May 2016 13:27:56 -0700 Subject: Apply clang-format diffs. --- .../transport/chttp2/transport/chttp2_transport.c | 14 +++--- .../transport/chttp2/transport/incoming_metadata.h | 2 +- src/core/ext/transport/chttp2/transport/parsing.c | 8 +-- src/core/lib/transport/metadata.h | 4 +- src/core/lib/transport/metadata_batch.c | 4 +- test/core/bad_client/bad_client.c | 7 ++- test/core/bad_client/bad_client.h | 8 +-- test/core/bad_client/tests/large_metadata.c | 57 +++++++++++++--------- test/core/end2end/fixtures/h2_ssl_proxy.c | 4 +- test/core/end2end/fixtures/proxy.c | 6 +-- test/core/end2end/fixtures/proxy.h | 6 +-- test/core/end2end/tests/large_metadata.c | 11 +++-- 12 files changed, 71 insertions(+), 60 deletions(-) (limited to 'src/core/lib/transport') diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 44b2a7a59f..737a6ccbf1 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -948,15 +948,16 @@ static void perform_stream_op_locked(grpc_exec_ctx *exec_ctx, stream_global->send_initial_metadata_finished = add_closure_barrier(on_complete); stream_global->send_initial_metadata = op->send_initial_metadata; - const size_t metadata_size = grpc_metadata_batch_size( - op->send_initial_metadata); + const size_t metadata_size = + grpc_metadata_batch_size(op->send_initial_metadata); const size_t metadata_peer_limit = transport_global->settings[GRPC_PEER_SETTINGS] [GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE]; if (metadata_size > metadata_peer_limit) { gpr_log(GPR_DEBUG, "to-be-sent initial metadata size exceeds peer limit " - "(%lu vs. %lu)", metadata_size, metadata_peer_limit); + "(%lu vs. %lu)", + metadata_size, metadata_peer_limit); cancel_from_api(exec_ctx, transport_global, stream_global, GRPC_STATUS_RESOURCE_EXHAUSTED); } else { @@ -1002,15 +1003,16 @@ static void perform_stream_op_locked(grpc_exec_ctx *exec_ctx, stream_global->send_trailing_metadata_finished = add_closure_barrier(on_complete); stream_global->send_trailing_metadata = op->send_trailing_metadata; - const size_t metadata_size = grpc_metadata_batch_size( - op->send_trailing_metadata); + const size_t metadata_size = + grpc_metadata_batch_size(op->send_trailing_metadata); const size_t metadata_peer_limit = transport_global->settings[GRPC_PEER_SETTINGS] [GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE]; if (metadata_size > metadata_peer_limit) { gpr_log(GPR_DEBUG, "to-be-sent trailing metadata size exceeds peer limit " - "(%lu vs. %lu)", metadata_size, metadata_peer_limit); + "(%lu vs. %lu)", + metadata_size, metadata_peer_limit); cancel_from_api(exec_ctx, transport_global, stream_global, GRPC_STATUS_RESOURCE_EXHAUSTED); } else { diff --git a/src/core/ext/transport/chttp2/transport/incoming_metadata.h b/src/core/ext/transport/chttp2/transport/incoming_metadata.h index 7db5db8de0..df4343b93e 100644 --- a/src/core/ext/transport/chttp2/transport/incoming_metadata.h +++ b/src/core/ext/transport/chttp2/transport/incoming_metadata.h @@ -42,7 +42,7 @@ typedef struct { size_t capacity; gpr_timespec deadline; int published; - size_t size; /* total size of metadata */ + size_t size; // total size of metadata } grpc_chttp2_incoming_metadata_buffer; /** assumes everything initially zeroed */ diff --git a/src/core/ext/transport/chttp2/transport/parsing.c b/src/core/ext/transport/chttp2/transport/parsing.c index 9516956724..4bd374b7fa 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.c +++ b/src/core/ext/transport/chttp2/transport/parsing.c @@ -639,8 +639,8 @@ static void on_initial_header(void *tp, grpc_mdelem *md) { gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), *cached_timeout)); GRPC_MDELEM_UNREF(md); } else { - const size_t new_size = stream_parsing->metadata_buffer[0].size + - GRPC_MDELEM_LENGTH(md); + const size_t new_size = + stream_parsing->metadata_buffer[0].size + GRPC_MDELEM_LENGTH(md); grpc_chttp2_transport_global *transport_global = &TRANSPORT_FROM_PARSING(transport_parsing)->global; const size_t metadata_size_limit = @@ -685,8 +685,8 @@ static void on_trailing_header(void *tp, grpc_mdelem *md) { stream_parsing->seen_error = true; } - const size_t new_size = stream_parsing->metadata_buffer[1].size + - GRPC_MDELEM_LENGTH(md); + const size_t new_size = + stream_parsing->metadata_buffer[1].size + GRPC_MDELEM_LENGTH(md); grpc_chttp2_transport_global *transport_global = &TRANSPORT_FROM_PARSING(transport_parsing)->global; const size_t metadata_size_limit = diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h index 4ecbbd1b1b..6d82f4d681 100644 --- a/src/core/lib/transport/metadata.h +++ b/src/core/lib/transport/metadata.h @@ -148,8 +148,8 @@ const char *grpc_mdstr_as_c_string(grpc_mdstr *s); #define GRPC_MDSTR_LENGTH(s) (GPR_SLICE_LENGTH(s->slice)) /* We add 32 bytes of padding as per RFC-7540 section 6.5.2. */ -#define GRPC_MDELEM_LENGTH(e) (GRPC_MDSTR_LENGTH((e)->key) + \ - GRPC_MDSTR_LENGTH((e)->value) + 32) +#define GRPC_MDELEM_LENGTH(e) \ + (GRPC_MDSTR_LENGTH((e)->key) + GRPC_MDSTR_LENGTH((e)->value) + 32) int grpc_mdstr_is_legal_header(grpc_mdstr *s); int grpc_mdstr_is_legal_nonbin_header(grpc_mdstr *s); diff --git a/src/core/lib/transport/metadata_batch.c b/src/core/lib/transport/metadata_batch.c index 4e1cd8e2c1..c0afc715bc 100644 --- a/src/core/lib/transport/metadata_batch.c +++ b/src/core/lib/transport/metadata_batch.c @@ -195,8 +195,8 @@ int grpc_metadata_batch_is_empty(grpc_metadata_batch *batch) { size_t grpc_metadata_batch_size(grpc_metadata_batch *batch) { size_t size = 0; - for (grpc_linked_mdelem* elem = batch->list.head; - elem != NULL; elem = elem->next) { + for (grpc_linked_mdelem* elem = batch->list.head; elem != NULL; + elem = elem->next) { size += GRPC_MDELEM_LENGTH(elem->md); } return size; diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c index aa9125dc7a..e5820688ef 100644 --- a/test/core/bad_client/bad_client.c +++ b/test/core/bad_client/bad_client.c @@ -90,8 +90,7 @@ static void read_done(grpc_exec_ctx *exec_ctx, void *arg, bool success) { void grpc_run_bad_client_test( grpc_bad_client_server_side_validator server_validator, grpc_bad_client_client_stream_validator client_validator, - const char *client_payload, - size_t client_payload_length, uint32_t flags) { + const char *client_payload, size_t client_payload_length, uint32_t flags) { grpc_endpoint_pair sfd; thd_args a; gpr_thd_id id; @@ -177,8 +176,8 @@ void grpc_run_bad_client_test( grpc_endpoint_read(&exec_ctx, sfd.client, &args.incoming, &read_done_closure); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&args.read_done, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))); + GPR_ASSERT( + gpr_event_wait(&args.read_done, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))); gpr_slice_buffer_destroy(&args.incoming); } // Shutdown. diff --git a/test/core/bad_client/bad_client.h b/test/core/bad_client/bad_client.h index b6e8a6dd5b..ecd6721a78 100644 --- a/test/core/bad_client/bad_client.h +++ b/test/core/bad_client/bad_client.h @@ -59,9 +59,9 @@ void grpc_run_bad_client_test( grpc_bad_client_client_stream_validator client_validator, const char *client_payload, size_t client_payload_length, uint32_t flags); -#define GRPC_RUN_BAD_CLIENT_TEST(server_validator, client_validator, \ - payload, flags) \ - grpc_run_bad_client_test(server_validator, client_validator, \ - payload, sizeof(payload) - 1, flags) +#define GRPC_RUN_BAD_CLIENT_TEST(server_validator, client_validator, payload, \ + flags) \ + grpc_run_bad_client_test(server_validator, client_validator, payload, \ + sizeof(payload) - 1, flags) #endif /* GRPC_TEST_CORE_BAD_CLIENT_BAD_CLIENT_H */ diff --git a/test/core/bad_client/tests/large_metadata.c b/test/core/bad_client/tests/large_metadata.c index 95932205cf..b3521439f5 100644 --- a/test/core/bad_client/tests/large_metadata.c +++ b/test/core/bad_client/tests/large_metadata.c @@ -40,16 +40,19 @@ #include "test/core/end2end/cq_verifier.h" #define PFX_TOO_MUCH_METADATA_FROM_CLIENT_STR \ - "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \ - /* settings frame */ \ - "\x00\x00\x00\x04\x00\x00\x00\x00\x00" \ - /* headers: generated from large_metadata.headers in this directory */ \ - "\x00""5{\x01\x05\x00\x00\x00\x01" \ + "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" /* settings frame */ \ + "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* headers: generated from \ + large_metadata.headers in this \ + directory */ \ + "\x00" \ + "5{\x01\x05\x00\x00\x00\x01" \ "\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\x0c" \ + "content-type\x10" \ + "application/grpc" \ "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip" \ "\x10\x02te\x08trailers" \ "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)" \ @@ -339,22 +342,27 @@ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \ "aaaaaaaa" -#define PFX_TOO_MUCH_METADATA_FROM_SERVER_STR \ - "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \ - /* settings frame: sets MAX_HEADER_LIST_SIZE to 16K */ \ - "\x00\x00\x06\x04\x00\x00\x00\x00\x00\x00\x06\x00\x00\x40\x00" \ - /* headers: generated from simple_request.headers in this directory */ \ - "\x00\x00\xc9\x01\x04\x00\x00\x00\x01" \ - "\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" \ +#define PFX_TOO_MUCH_METADATA_FROM_SERVER_STR \ + "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" /* settings frame: sets \ + MAX_HEADER_LIST_SIZE to 16K */ \ + "\x00\x00\x06\x04\x00\x00\x00\x00\x00\x00\x06\x00\x00\x40\x00" /* headers: \ + generated \ + from \ + simple_request.headers \ + in this \ + directory \ + */ \ + "\x00\x00\xc9\x01\x04\x00\x00\x00\x01" \ + "\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)" static void *tag(intptr_t t) { return (void *)t; } @@ -385,8 +393,9 @@ static void server_verifier(grpc_server *server, grpc_completion_queue *cq, cq_verifier_destroy(cqv); } -static void server_verifier_sends_too_much_metadata( - grpc_server *server, grpc_completion_queue *cq, void *registered_method) { +static void server_verifier_sends_too_much_metadata(grpc_server *server, + grpc_completion_queue *cq, + void *registered_method) { grpc_call_error error; grpc_call *s; grpc_call_details call_details; diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.c b/test/core/end2end/fixtures/h2_ssl_proxy.c index 0ec6ad437e..151a86cb8f 100644 --- a/test/core/end2end/fixtures/h2_ssl_proxy.c +++ b/test/core/end2end/fixtures/h2_ssl_proxy.c @@ -76,8 +76,8 @@ static grpc_channel *create_proxy_client(const char *target, {"foo.test.google.fr"}}; grpc_channel_args *new_client_args = grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1); - channel = grpc_secure_channel_create(ssl_creds, target, new_client_args, - NULL); + channel = + grpc_secure_channel_create(ssl_creds, target, new_client_args, NULL); grpc_channel_credentials_release(ssl_creds); grpc_channel_args_destroy(new_client_args); return channel; diff --git a/test/core/end2end/fixtures/proxy.c b/test/core/end2end/fixtures/proxy.c index ff413ffd65..f6e01ec41c 100644 --- a/test/core/end2end/fixtures/proxy.c +++ b/test/core/end2end/fixtures/proxy.c @@ -89,9 +89,9 @@ typedef struct { static void thread_main(void *arg); static void request_call(grpc_end2end_proxy *proxy); -grpc_end2end_proxy *grpc_end2end_proxy_create( - const grpc_end2end_proxy_def *def, - grpc_channel_args *client_args, grpc_channel_args *server_args) { +grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def, + grpc_channel_args *client_args, + grpc_channel_args *server_args) { gpr_thd_options opt = gpr_thd_options_default(); int proxy_port = grpc_pick_unused_port_or_die(); int server_port = grpc_pick_unused_port_or_die(); diff --git a/test/core/end2end/fixtures/proxy.h b/test/core/end2end/fixtures/proxy.h index 89f95f09f9..75b75d1331 100644 --- a/test/core/end2end/fixtures/proxy.h +++ b/test/core/end2end/fixtures/proxy.h @@ -47,9 +47,9 @@ typedef struct grpc_end2end_proxy_def { grpc_channel_args *client_args); } grpc_end2end_proxy_def; -grpc_end2end_proxy *grpc_end2end_proxy_create( - const grpc_end2end_proxy_def *def, - grpc_channel_args *client_args, grpc_channel_args *server_args); +grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def, + grpc_channel_args *client_args, + grpc_channel_args *server_args); void grpc_end2end_proxy_destroy(grpc_end2end_proxy *proxy); const char *grpc_end2end_proxy_get_client_target(grpc_end2end_proxy *proxy); diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.c index 6d3074a94b..dd29552b97 100644 --- a/test/core/end2end/tests/large_metadata.c +++ b/test/core/end2end/tests/large_metadata.c @@ -107,11 +107,12 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { gpr_timespec deadline = five_seconds_time(); grpc_metadata meta; const size_t large_size = 64 * 1024; - grpc_arg arg = { GRPC_ARG_INTEGER, GRPC_ARG_MAX_METADATA_SIZE, - { .integer=(int)large_size + 1024 } }; - grpc_channel_args args = { 1, &arg }; - grpc_end2end_test_fixture f = begin_test( - config, "test_request_with_large_metadata", &args, &args); + grpc_arg arg = {GRPC_ARG_INTEGER, + GRPC_ARG_MAX_METADATA_SIZE, + {.integer=(int)large_size + 1024}}; + grpc_channel_args args = {1, &arg}; + grpc_end2end_test_fixture f = + begin_test(config, "test_request_with_large_metadata", &args, &args); cq_verifier *cqv = cq_verifier_create(f.cq); grpc_op ops[6]; grpc_op *op; -- cgit v1.2.3 From f2f707ca5503249e637542d7b3015c3fef2e3023 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 5 May 2016 13:04:20 -0700 Subject: More clang-format fixes. --- src/core/lib/transport/metadata_batch.c | 2 +- test/core/bad_client/bad_client.h | 4 ++-- test/core/end2end/tests/large_metadata.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/lib/transport') diff --git a/src/core/lib/transport/metadata_batch.c b/src/core/lib/transport/metadata_batch.c index c0afc715bc..e4398abeb7 100644 --- a/src/core/lib/transport/metadata_batch.c +++ b/src/core/lib/transport/metadata_batch.c @@ -195,7 +195,7 @@ int grpc_metadata_batch_is_empty(grpc_metadata_batch *batch) { size_t grpc_metadata_batch_size(grpc_metadata_batch *batch) { size_t size = 0; - for (grpc_linked_mdelem* elem = batch->list.head; elem != NULL; + for (grpc_linked_mdelem *elem = batch->list.head; elem != NULL; elem = elem->next) { size += GRPC_MDELEM_LENGTH(elem->md); } diff --git a/test/core/bad_client/bad_client.h b/test/core/bad_client/bad_client.h index ecd6721a78..c8b2a4122f 100644 --- a/test/core/bad_client/bad_client.h +++ b/test/core/bad_client/bad_client.h @@ -60,8 +60,8 @@ void grpc_run_bad_client_test( const char *client_payload, size_t client_payload_length, uint32_t flags); #define GRPC_RUN_BAD_CLIENT_TEST(server_validator, client_validator, payload, \ - flags) \ - grpc_run_bad_client_test(server_validator, client_validator, payload, \ + flags) \ + grpc_run_bad_client_test(server_validator, client_validator, payload, \ sizeof(payload) - 1, flags) #endif /* GRPC_TEST_CORE_BAD_CLIENT_BAD_CLIENT_H */ diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.c index dd29552b97..ae1f68a2b4 100644 --- a/test/core/end2end/tests/large_metadata.c +++ b/test/core/end2end/tests/large_metadata.c @@ -109,7 +109,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { const size_t large_size = 64 * 1024; grpc_arg arg = {GRPC_ARG_INTEGER, GRPC_ARG_MAX_METADATA_SIZE, - {.integer=(int)large_size + 1024}}; + {.integer = (int)large_size + 1024}}; grpc_channel_args args = {1, &arg}; grpc_end2end_test_fixture f = begin_test(config, "test_request_with_large_metadata", &args, &args); -- cgit v1.2.3