diff options
Diffstat (limited to 'test')
173 files changed, 652 insertions, 301 deletions
diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c index cd5b541249..9f7274c9f1 100644 --- a/test/core/bad_client/bad_client.c +++ b/test/core/bad_client/bad_client.c @@ -62,7 +62,7 @@ static void thd_func(void *arg) { gpr_event_set(&a->done_thd, (void *)1); } -static void done_write(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void done_write(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { thd_args *a = arg; gpr_event_set(&a->done_write, (void *)1); } diff --git a/test/core/channel/channel_stack_test.c b/test/core/channel/channel_stack_test.c index 1a5594bde8..cba186da09 100644 --- a/test/core/channel/channel_stack_test.c +++ b/test/core/channel/channel_stack_test.c @@ -81,12 +81,13 @@ static char *get_peer(grpc_exec_ctx *exec_ctx, grpc_call_element *elem) { return gpr_strdup("peer"); } -static void free_channel(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void free_channel(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { grpc_channel_stack_destroy(exec_ctx, arg); gpr_free(arg); } -static void free_call(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void free_call(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { grpc_call_stack_destroy(exec_ctx, arg, NULL); gpr_free(arg); } diff --git a/test/core/client_config/resolvers/dns_resolver_connectivity_test.c b/test/core/client_config/resolvers/dns_resolver_connectivity_test.c index 2322aa688a..f6067463d5 100644 --- a/test/core/client_config/resolvers/dns_resolver_connectivity_test.c +++ b/test/core/client_config/resolvers/dns_resolver_connectivity_test.c @@ -67,21 +67,21 @@ static grpc_client_channel_factory cc_factory = {&sc_vtable}; static gpr_mu g_mu; static bool g_fail_resolution = true; -static grpc_resolved_addresses *my_resolve_address(const char *name, - const char *addr) { +static grpc_error *my_resolve_address(const char *name, const char *addr, + grpc_resolved_addresses **addrs) { gpr_mu_lock(&g_mu); GPR_ASSERT(0 == strcmp("test", name)); if (g_fail_resolution) { g_fail_resolution = false; gpr_mu_unlock(&g_mu); - return NULL; + return GRPC_ERROR_CREATE("Forced Failure"); } else { gpr_mu_unlock(&g_mu); - grpc_resolved_addresses *addrs = gpr_malloc(sizeof(*addrs)); - addrs->naddrs = 1; - addrs->addrs = gpr_malloc(sizeof(*addrs->addrs)); - addrs->addrs[0].len = 123; - return addrs; + *addrs = gpr_malloc(sizeof(*addrs)); + (*addrs)->naddrs = 1; + (*addrs)->addrs = gpr_malloc(sizeof(*(*addrs)->addrs)); + (*addrs)->addrs[0].len = 123; + return GRPC_ERROR_NONE; } } @@ -100,7 +100,7 @@ static grpc_resolver *create_resolver(const char *name) { return resolver; } -static void on_done(grpc_exec_ctx *exec_ctx, void *ev, bool success) { +static void on_done(grpc_exec_ctx *exec_ctx, void *ev, grpc_error *error) { gpr_event_set(ev, (void *)1); } diff --git a/test/core/client_config/set_initial_connect_string_test.c b/test/core/client_config/set_initial_connect_string_test.c index 3ad8ce964a..499074a7bf 100644 --- a/test/core/client_config/set_initial_connect_string_test.c +++ b/test/core/client_config/set_initial_connect_string_test.c @@ -64,8 +64,8 @@ static int server_port; static struct rpc_state state; static grpc_closure on_read; -static void handle_read(grpc_exec_ctx *exec_ctx, void *arg, bool success) { - GPR_ASSERT(success); +static void handle_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { + GPR_ASSERT(error == GRPC_ERROR_NONE); gpr_slice_buffer_move_into(&state.temp_incoming_buffer, &state.incoming_buffer); if (state.incoming_buffer.length > strlen(magic_connect_string)) { diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c index 81f76ea79c..9be72824fa 100644 --- a/test/core/end2end/dualstack_socket_test.c +++ b/test/core/end2end/dualstack_socket_test.c @@ -266,7 +266,9 @@ void test_connect(const char *server_host, const char *client_host, int port, } int external_dns_works(const char *host) { - grpc_resolved_addresses *res = grpc_blocking_resolve_address(host, "80"); + grpc_resolved_addresses *res; + grpc_error *error = grpc_blocking_resolve_address(host, "80", &res); + GRPC_ERROR_UNREF(error); if (res != NULL) { grpc_resolved_addresses_destroy(res); return 1; diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index 858ebd9683..3eba4a4e2e 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -50,7 +50,7 @@ //////////////////////////////////////////////////////////////////////////////// // logging -static const bool squelch = true; +static const bool squelch = !true; static void dont_log(gpr_log_func_args *args) {} @@ -202,7 +202,7 @@ static void finish_resolve(grpc_exec_ctx *exec_ctx, void *arg, *r->addrs = addrs; grpc_exec_ctx_push(exec_ctx, r->on_done, GRPC_ERROR_NONE, NULL); } else { - grpc_error_ref(error); + GRPC_ERROR_REF(error); grpc_exec_ctx_push( exec_ctx, r->on_done, GRPC_ERROR_CREATE_REFERENCING("Resolution failed", &error, 1), NULL); @@ -248,7 +248,7 @@ static void do_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { future_connect *fc = arg; if (error != GRPC_ERROR_NONE) { *fc->ep = NULL; - grpc_exec_ctx_push(exec_ctx, fc->closure, grpc_error_ref(error), NULL); + grpc_exec_ctx_push(exec_ctx, fc->closure, GRPC_ERROR_REF(error), NULL); } else if (g_server != NULL) { grpc_endpoint *client; grpc_endpoint *server; diff --git a/test/core/end2end/goaway_server_test.c b/test/core/end2end/goaway_server_test.c index 5f8c2641e7..1da120c9b4 100644 --- a/test/core/end2end/goaway_server_test.c +++ b/test/core/end2end/goaway_server_test.c @@ -46,8 +46,9 @@ static void *tag(intptr_t i) { return (void *)i; } static gpr_mu g_mu; static int g_resolve_port = -1; -static grpc_resolved_addresses *(*iomgr_resolve_address)( - const char *name, const char *default_port); +static grpc_error *(*iomgr_resolve_address)(const char *name, + const char *default_port, + grpc_resolved_addresses **addrs); static void set_resolve_port(int port) { gpr_mu_lock(&g_mu); @@ -55,28 +56,28 @@ static void set_resolve_port(int port) { gpr_mu_unlock(&g_mu); } -static grpc_resolved_addresses *my_resolve_address(const char *name, - const char *addr) { +static grpc_error *my_resolve_address(const char *name, const char *addr, + grpc_resolved_addresses **addrs) { if (0 != strcmp(name, "test")) { - return iomgr_resolve_address(name, addr); + return iomgr_resolve_address(name, addr, addrs); } gpr_mu_lock(&g_mu); if (g_resolve_port < 0) { gpr_mu_unlock(&g_mu); - return NULL; + return GRPC_ERROR_CREATE("Forced Failure"); } else { - grpc_resolved_addresses *addrs = gpr_malloc(sizeof(*addrs)); - addrs->naddrs = 1; - addrs->addrs = gpr_malloc(sizeof(*addrs->addrs)); - memset(addrs->addrs, 0, sizeof(*addrs->addrs)); - struct sockaddr_in *sa = (struct sockaddr_in *)addrs->addrs[0].addr; + *addrs = gpr_malloc(sizeof(*addrs)); + (*addrs)->naddrs = 1; + (*addrs)->addrs = gpr_malloc(sizeof(*(*addrs)->addrs)); + memset((*addrs)->addrs, 0, sizeof(*(*addrs)->addrs)); + struct sockaddr_in *sa = (struct sockaddr_in *)(*addrs)->addrs[0].addr; sa->sin_family = AF_INET; sa->sin_addr.s_addr = htonl(0x7f000001); sa->sin_port = htons((uint16_t)g_resolve_port); - addrs->addrs[0].len = sizeof(*sa); + (*addrs)->addrs[0].len = sizeof(*sa); gpr_mu_unlock(&g_mu); - return addrs; + return GRPC_ERROR_NONE; } } diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c index 99049aa6bd..405e75294d 100644 --- a/test/core/end2end/tests/filter_causes_close.c +++ b/test/core/end2end/tests/filter_causes_close.c @@ -202,10 +202,11 @@ typedef struct { grpc_closure *recv_im_ready; } call_data; typedef struct { uint8_t unused; } channel_data; -static void recv_im_ready(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void recv_im_ready(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { grpc_call_element *elem = arg; call_data *calld = elem->call_data; - if (success) { + if (error == GRPC_ERROR_NONE) { // close the stream with an error. gpr_slice message = gpr_slice_from_copied_string("Random failure that's not preventable."); diff --git a/test/core/http/httpcli_test.c b/test/core/http/httpcli_test.c index d3a68d0eb8..32bef2005a 100644 --- a/test/core/http/httpcli_test.c +++ b/test/core/http/httpcli_test.c @@ -54,12 +54,11 @@ static gpr_timespec n_seconds_time(int seconds) { return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(seconds); } -static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, - const grpc_httpcli_response *response) { +static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { const char *expect = "<html><head><title>Hello world!</title></head>" "<body><p>This is a test</p></body></html>"; - GPR_ASSERT(arg == (void *)42); + grpc_http_response *response = arg; GPR_ASSERT(response); GPR_ASSERT(response->status == 200); GPR_ASSERT(response->body_length == strlen(expect)); @@ -86,8 +85,10 @@ static void test_get(int port) { req.http.path = "/get"; req.handshaker = &grpc_httpcli_plaintext; + grpc_http_response response; + memset(&response, 0, sizeof(response)); grpc_httpcli_get(&exec_ctx, &g_context, g_pollset, &req, n_seconds_time(15), - on_finish, (void *)42); + grpc_closure_create(on_finish, &response), &response); gpr_mu_lock(g_mu); while (!g_done) { grpc_pollset_worker *worker = NULL; @@ -117,8 +118,11 @@ static void test_post(int port) { req.http.path = "/post"; req.handshaker = &grpc_httpcli_plaintext; + grpc_http_response response; + memset(&response, 0, sizeof(response)); grpc_httpcli_post(&exec_ctx, &g_context, g_pollset, &req, "hello", 5, - n_seconds_time(15), on_finish, (void *)42); + n_seconds_time(15), + grpc_closure_create(on_finish, &response), &response); gpr_mu_lock(g_mu); while (!g_done) { grpc_pollset_worker *worker = NULL; @@ -132,7 +136,8 @@ static void test_post(int port) { gpr_free(host); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/http/httpscli_test.c b/test/core/http/httpscli_test.c index d807336904..dce3eb6de0 100644 --- a/test/core/http/httpscli_test.c +++ b/test/core/http/httpscli_test.c @@ -54,12 +54,11 @@ static gpr_timespec n_seconds_time(int seconds) { return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(seconds); } -static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, - const grpc_httpcli_response *response) { +static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { const char *expect = "<html><head><title>Hello world!</title></head>" "<body><p>This is a test</p></body></html>"; - GPR_ASSERT(arg == (void *)42); + grpc_http_response *response = arg; GPR_ASSERT(response); GPR_ASSERT(response->status == 200); GPR_ASSERT(response->body_length == strlen(expect)); @@ -87,8 +86,10 @@ static void test_get(int port) { req.http.path = "/get"; req.handshaker = &grpc_httpcli_ssl; + grpc_http_response response; + memset(&response, 0, sizeof(response)); grpc_httpcli_get(&exec_ctx, &g_context, g_pollset, &req, n_seconds_time(15), - on_finish, (void *)42); + grpc_closure_create(on_finish, &response), &response); gpr_mu_lock(g_mu); while (!g_done) { grpc_pollset_worker *worker = NULL; @@ -119,8 +120,11 @@ static void test_post(int port) { req.http.path = "/post"; req.handshaker = &grpc_httpcli_ssl; + grpc_http_response response; + memset(&response, 0, sizeof(response)); grpc_httpcli_post(&exec_ctx, &g_context, g_pollset, &req, "hello", 5, - n_seconds_time(15), on_finish, (void *)42); + n_seconds_time(15), + grpc_closure_create(on_finish, &response), &response); gpr_mu_lock(g_mu); while (!g_done) { grpc_pollset_worker *worker = NULL; @@ -134,7 +138,8 @@ static void test_post(int port) { gpr_free(host); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/http/parser_test.c b/test/core/http/parser_test.c index 7fdf60cc2b..96313bfa22 100644 --- a/test/core/http/parser_test.c +++ b/test/core/http/parser_test.c @@ -44,38 +44,39 @@ #include "test/core/util/test_config.h" static void test_request_succeeds(grpc_slice_split_mode split_mode, - char *request, char *expect_method, + char *request_text, char *expect_method, grpc_http_version expect_version, char *expect_path, char *expect_body, ...) { grpc_http_parser parser; - gpr_slice input_slice = gpr_slice_from_copied_string(request); + gpr_slice input_slice = gpr_slice_from_copied_string(request_text); size_t num_slices; size_t i; gpr_slice *slices; va_list args; + grpc_http_request request; + memset(&request, 0, sizeof(request)); grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); gpr_slice_unref(input_slice); - grpc_http_parser_init(&parser); + grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request); for (i = 0; i < num_slices; i++) { - GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i])); + GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i]) == GRPC_ERROR_NONE); gpr_slice_unref(slices[i]); } GPR_ASSERT(grpc_http_parser_eof(&parser)); GPR_ASSERT(GRPC_HTTP_REQUEST == parser.type); - GPR_ASSERT(0 == strcmp(expect_method, parser.http.request.method)); - GPR_ASSERT(0 == strcmp(expect_path, parser.http.request.path)); - GPR_ASSERT(expect_version == parser.http.request.version); + GPR_ASSERT(0 == strcmp(expect_method, request.method)); + GPR_ASSERT(0 == strcmp(expect_path, request.path)); + GPR_ASSERT(expect_version == request.version); if (expect_body != NULL) { - GPR_ASSERT(strlen(expect_body) == parser.http.request.body_length); - GPR_ASSERT(0 == memcmp(expect_body, parser.http.request.body, - parser.http.request.body_length)); + GPR_ASSERT(strlen(expect_body) == request.body_length); + GPR_ASSERT(0 == memcmp(expect_body, request.body, request.body_length)); } else { - GPR_ASSERT(parser.http.request.body_length == 0); + GPR_ASSERT(request.body_length == 0); } va_start(args, expect_body); @@ -85,48 +86,48 @@ static void test_request_succeeds(grpc_slice_split_mode split_mode, char *expect_value; expect_key = va_arg(args, char *); if (!expect_key) break; - GPR_ASSERT(i < parser.http.request.hdr_count); + GPR_ASSERT(i < request.hdr_count); expect_value = va_arg(args, char *); GPR_ASSERT(expect_value); - GPR_ASSERT(0 == strcmp(expect_key, parser.http.request.hdrs[i].key)); - GPR_ASSERT(0 == strcmp(expect_value, parser.http.request.hdrs[i].value)); + GPR_ASSERT(0 == strcmp(expect_key, request.hdrs[i].key)); + GPR_ASSERT(0 == strcmp(expect_value, request.hdrs[i].value)); i++; } va_end(args); - GPR_ASSERT(i == parser.http.request.hdr_count); + GPR_ASSERT(i == request.hdr_count); grpc_http_parser_destroy(&parser); gpr_free(slices); } -static void test_succeeds(grpc_slice_split_mode split_mode, char *response, +static void test_succeeds(grpc_slice_split_mode split_mode, char *response_text, int expect_status, char *expect_body, ...) { grpc_http_parser parser; - gpr_slice input_slice = gpr_slice_from_copied_string(response); + gpr_slice input_slice = gpr_slice_from_copied_string(response_text); size_t num_slices; size_t i; gpr_slice *slices; va_list args; + grpc_http_response response; grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); gpr_slice_unref(input_slice); - grpc_http_parser_init(&parser); + grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response); for (i = 0; i < num_slices; i++) { - GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i])); + GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i]) == GRPC_ERROR_NONE); gpr_slice_unref(slices[i]); } GPR_ASSERT(grpc_http_parser_eof(&parser)); GPR_ASSERT(GRPC_HTTP_RESPONSE == parser.type); - GPR_ASSERT(expect_status == parser.http.response.status); + GPR_ASSERT(expect_status == response.status); if (expect_body != NULL) { - GPR_ASSERT(strlen(expect_body) == parser.http.response.body_length); - GPR_ASSERT(0 == memcmp(expect_body, parser.http.response.body, - parser.http.response.body_length)); + GPR_ASSERT(strlen(expect_body) == response.body_length); + GPR_ASSERT(0 == memcmp(expect_body, response.body, response.body_length)); } else { - GPR_ASSERT(parser.http.response.body_length == 0); + GPR_ASSERT(response.body_length == 0); } va_start(args, expect_body); @@ -136,32 +137,67 @@ static void test_succeeds(grpc_slice_split_mode split_mode, char *response, char *expect_value; expect_key = va_arg(args, char *); if (!expect_key) break; - GPR_ASSERT(i < parser.http.response.hdr_count); + GPR_ASSERT(i < response.hdr_count); expect_value = va_arg(args, char *); GPR_ASSERT(expect_value); - GPR_ASSERT(0 == strcmp(expect_key, parser.http.response.hdrs[i].key)); - GPR_ASSERT(0 == strcmp(expect_value, parser.http.response.hdrs[i].value)); + GPR_ASSERT(0 == strcmp(expect_key, response.hdrs[i].key)); + GPR_ASSERT(0 == strcmp(expect_value, response.hdrs[i].value)); i++; } va_end(args); - GPR_ASSERT(i == parser.http.response.hdr_count); + GPR_ASSERT(i == response.hdr_count); grpc_http_parser_destroy(&parser); gpr_free(slices); } -static void test_fails(grpc_slice_split_mode split_mode, char *response) { +static void test_fails(grpc_slice_split_mode split_mode, char *response_text) { grpc_http_parser parser; - gpr_slice input_slice = gpr_slice_from_copied_string(response); + gpr_slice input_slice = gpr_slice_from_copied_string(response_text); + size_t num_slices; + size_t i; + gpr_slice *slices; + grpc_error *error = GRPC_ERROR_NONE; + grpc_http_response response; + memset(&response, 0, sizeof(response)); + + grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); + gpr_slice_unref(input_slice); + + grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response); + + for (i = 0; i < num_slices; i++) { + if (GRPC_ERROR_NONE == error) { + error = grpc_http_parser_parse(&parser, slices[i]); + } + gpr_slice_unref(slices[i]); + } + if (GRPC_ERROR_NONE == error) { + error = grpc_http_parser_eof(&parser); + } + GPR_ASSERT(error != GRPC_ERROR_NONE); + GRPC_ERROR_UNREF(error); + + grpc_http_response_destroy(&response); + grpc_http_parser_destroy(&parser); + gpr_free(slices); +} + +static void test_request_fails(grpc_slice_split_mode split_mode, + char *request_text) { + grpc_http_parser parser; + gpr_slice input_slice = gpr_slice_from_copied_string(request_text); size_t num_slices; size_t i; gpr_slice *slices; int done = 0; + grpc_http_request request; + memset(&request, 0, sizeof(request)); grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); gpr_slice_unref(input_slice); - grpc_http_parser_init(&parser); + grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request); for (i = 0; i < num_slices; i++) { if (!done && !grpc_http_parser_parse(&parser, slices[i])) { @@ -174,41 +210,11 @@ static void test_fails(grpc_slice_split_mode split_mode, char *response) { } GPR_ASSERT(done); + grpc_http_request_destroy(&request); grpc_http_parser_destroy(&parser); gpr_free(slices); } -static const uint8_t failed_test1[] = { - 0x9e, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x4a, - 0x48, 0x54, 0x54, 0x30, 0x32, 0x16, 0xa, 0x2f, 0x48, 0x20, - 0x31, 0x2e, 0x31, 0x20, 0x32, 0x30, 0x31, 0x54, 0x54, 0xb9, - 0x32, 0x31, 0x2e, 0x20, 0x32, 0x30, 0x20, -}; - -typedef struct { - const char *name; - const uint8_t *data; - size_t length; -} failed_test; - -#define FAILED_TEST(name) \ - { #name, name, sizeof(name) } - -failed_test failed_tests[] = { - FAILED_TEST(failed_test1), -}; - -static void test_doesnt_crash(failed_test t) { - gpr_log(GPR_DEBUG, "Run previously failed test: %s", t.name); - grpc_http_parser p; - grpc_http_parser_init(&p); - gpr_slice slice = - gpr_slice_from_copied_buffer((const char *)t.data, t.length); - grpc_http_parser_parse(&p, slice); - gpr_slice_unref(slice); - grpc_http_parser_destroy(&p); -} - int main(int argc, char **argv) { size_t i; const grpc_slice_split_mode split_modes[] = {GRPC_SLICE_SPLIT_IDENTITY, @@ -217,10 +223,6 @@ int main(int argc, char **argv) { grpc_test_init(argc, argv); - for (i = 0; i < GPR_ARRAY_SIZE(failed_tests); i++) { - test_doesnt_crash(failed_tests[i]); - } - for (i = 0; i < GPR_ARRAY_SIZE(split_modes); i++) { test_succeeds(split_modes[i], "HTTP/1.0 200 OK\r\n" @@ -286,12 +288,12 @@ int main(int argc, char **argv) { " def\r\n" "\r\n" "hello world!"); - test_fails(split_modes[i], "GET\r\n"); - test_fails(split_modes[i], "GET /\r\n"); - test_fails(split_modes[i], "GET / HTTP/0.0\r\n"); - test_fails(split_modes[i], "GET / ____/1.0\r\n"); - test_fails(split_modes[i], "GET / HTTP/1.2\r\n"); - test_fails(split_modes[i], "GET / HTTP/1.0\n"); + test_request_fails(split_modes[i], "GET\r\n"); + test_request_fails(split_modes[i], "GET /\r\n"); + test_request_fails(split_modes[i], "GET / HTTP/0.0\r\n"); + test_request_fails(split_modes[i], "GET / ____/1.0\r\n"); + test_request_fails(split_modes[i], "GET / HTTP/1.2\r\n"); + test_request_fails(split_modes[i], "GET / HTTP/1.0\n"); tmp1 = gpr_malloc(2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH); memset(tmp1, 'a', 2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH - 1); diff --git a/test/core/http/corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 b/test/core/http/request_corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 index 3d6face56a..3d6face56a 100644 --- a/test/core/http/corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 +++ b/test/core/http/request_corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 diff --git a/test/core/http/corpus/05e613853d64a9669ea3cf41b0de777dc24931ba b/test/core/http/request_corpus/05e613853d64a9669ea3cf41b0de777dc24931ba index 5cbaf2e460..5cbaf2e460 100644 --- a/test/core/http/corpus/05e613853d64a9669ea3cf41b0de777dc24931ba +++ b/test/core/http/request_corpus/05e613853d64a9669ea3cf41b0de777dc24931ba diff --git a/test/core/http/corpus/069352518a1d1baa05f317c677d275cefda2ac97 b/test/core/http/request_corpus/069352518a1d1baa05f317c677d275cefda2ac97 index 8831f0786b..8831f0786b 100644 --- a/test/core/http/corpus/069352518a1d1baa05f317c677d275cefda2ac97 +++ b/test/core/http/request_corpus/069352518a1d1baa05f317c677d275cefda2ac97 diff --git a/test/core/http/corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 b/test/core/http/request_corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 index 10967d975c..10967d975c 100644 --- a/test/core/http/corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 +++ b/test/core/http/request_corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 diff --git a/test/core/http/corpus/0c5b7c2569410b526605e308309a7f36574e530d b/test/core/http/request_corpus/0c5b7c2569410b526605e308309a7f36574e530d index c79e456904..c79e456904 100644 --- a/test/core/http/corpus/0c5b7c2569410b526605e308309a7f36574e530d +++ b/test/core/http/request_corpus/0c5b7c2569410b526605e308309a7f36574e530d diff --git a/test/core/http/corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf b/test/core/http/request_corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf index 7b979b5e10..7b979b5e10 100644 --- a/test/core/http/corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf +++ b/test/core/http/request_corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf diff --git a/test/core/http/corpus/1e1273f90187fdf5df3625764245610f86af6aa4 b/test/core/http/request_corpus/1e1273f90187fdf5df3625764245610f86af6aa4 index 67382b4f3a..67382b4f3a 100644 --- a/test/core/http/corpus/1e1273f90187fdf5df3625764245610f86af6aa4 +++ b/test/core/http/request_corpus/1e1273f90187fdf5df3625764245610f86af6aa4 diff --git a/test/core/http/corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 b/test/core/http/request_corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 index deb8265a30..deb8265a30 100644 --- a/test/core/http/corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 +++ b/test/core/http/request_corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 diff --git a/test/core/http/corpus/24756c396bc72894fd720092bb6f9c03e66b469f b/test/core/http/request_corpus/24756c396bc72894fd720092bb6f9c03e66b469f index 9f2e0e4a25..9f2e0e4a25 100644 --- a/test/core/http/corpus/24756c396bc72894fd720092bb6f9c03e66b469f +++ b/test/core/http/request_corpus/24756c396bc72894fd720092bb6f9c03e66b469f diff --git a/test/core/http/corpus/276def41311933421ae7a9ee42e906c85b6a4d3f b/test/core/http/request_corpus/276def41311933421ae7a9ee42e906c85b6a4d3f index 4db04b260a..4db04b260a 100644 --- a/test/core/http/corpus/276def41311933421ae7a9ee42e906c85b6a4d3f +++ b/test/core/http/request_corpus/276def41311933421ae7a9ee42e906c85b6a4d3f diff --git a/test/core/http/corpus/29daa75432381937fd005cb25e314e328de6e9f9 b/test/core/http/request_corpus/29daa75432381937fd005cb25e314e328de6e9f9 index cee70bfe71..cee70bfe71 100644 --- a/test/core/http/corpus/29daa75432381937fd005cb25e314e328de6e9f9 +++ b/test/core/http/request_corpus/29daa75432381937fd005cb25e314e328de6e9f9 diff --git a/test/core/http/corpus/2a75204bc492084ad853682f8de3fb137d5907bc b/test/core/http/request_corpus/2a75204bc492084ad853682f8de3fb137d5907bc index e76b00e34c..e76b00e34c 100644 --- a/test/core/http/corpus/2a75204bc492084ad853682f8de3fb137d5907bc +++ b/test/core/http/request_corpus/2a75204bc492084ad853682f8de3fb137d5907bc diff --git a/test/core/http/corpus/2d34ba249b755a880525cf53c665633a5e359305 b/test/core/http/request_corpus/2d34ba249b755a880525cf53c665633a5e359305 index 7435f52ea5..7435f52ea5 100644 --- a/test/core/http/corpus/2d34ba249b755a880525cf53c665633a5e359305 +++ b/test/core/http/request_corpus/2d34ba249b755a880525cf53c665633a5e359305 diff --git a/test/core/http/corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 b/test/core/http/request_corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 index cce8ded71a..cce8ded71a 100644 --- a/test/core/http/corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 +++ b/test/core/http/request_corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 diff --git a/test/core/http/corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b b/test/core/http/request_corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b index 57efa3cabc..57efa3cabc 100644 --- a/test/core/http/corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b +++ b/test/core/http/request_corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b diff --git a/test/core/http/corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece b/test/core/http/request_corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece index 8df43e4dce..8df43e4dce 100644 --- a/test/core/http/corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece +++ b/test/core/http/request_corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece diff --git a/test/core/http/corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf b/test/core/http/request_corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf index 4efa386f3b..4efa386f3b 100644 --- a/test/core/http/corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf +++ b/test/core/http/request_corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf diff --git a/test/core/http/corpus/3953688866ccb3b4f371f1a858570d6afdb6452d b/test/core/http/request_corpus/3953688866ccb3b4f371f1a858570d6afdb6452d index f85f1df035..f85f1df035 100644 --- a/test/core/http/corpus/3953688866ccb3b4f371f1a858570d6afdb6452d +++ b/test/core/http/request_corpus/3953688866ccb3b4f371f1a858570d6afdb6452d diff --git a/test/core/http/corpus/39b19c41ba537f37511eff7727733715db432e76 b/test/core/http/request_corpus/39b19c41ba537f37511eff7727733715db432e76 index fefa4512a8..fefa4512a8 100644 --- a/test/core/http/corpus/39b19c41ba537f37511eff7727733715db432e76 +++ b/test/core/http/request_corpus/39b19c41ba537f37511eff7727733715db432e76 diff --git a/test/core/http/corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac b/test/core/http/request_corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac index b967b57614..b967b57614 100644 --- a/test/core/http/corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac +++ b/test/core/http/request_corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac diff --git a/test/core/http/corpus/3f03265921120c6ffa61b944e213e062a5538d4b b/test/core/http/request_corpus/3f03265921120c6ffa61b944e213e062a5538d4b index 8af90071c3..8af90071c3 100644 --- a/test/core/http/corpus/3f03265921120c6ffa61b944e213e062a5538d4b +++ b/test/core/http/request_corpus/3f03265921120c6ffa61b944e213e062a5538d4b diff --git a/test/core/http/corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 b/test/core/http/request_corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 index 7d20266703..7d20266703 100644 --- a/test/core/http/corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 +++ b/test/core/http/request_corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 diff --git a/test/core/http/corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 b/test/core/http/request_corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 index 5996b9a75c..5996b9a75c 100644 --- a/test/core/http/corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 +++ b/test/core/http/request_corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 diff --git a/test/core/http/corpus/487725eb38511c79a9340bf4560a1411061fa6fa b/test/core/http/request_corpus/487725eb38511c79a9340bf4560a1411061fa6fa index c59c4d2246..c59c4d2246 100644 --- a/test/core/http/corpus/487725eb38511c79a9340bf4560a1411061fa6fa +++ b/test/core/http/request_corpus/487725eb38511c79a9340bf4560a1411061fa6fa diff --git a/test/core/http/corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 b/test/core/http/request_corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 index 8ac7ceb2d5..8ac7ceb2d5 100644 --- a/test/core/http/corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 +++ b/test/core/http/request_corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 diff --git a/test/core/http/corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 b/test/core/http/request_corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 index 49d1c8f1d2..49d1c8f1d2 100644 --- a/test/core/http/corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 +++ b/test/core/http/request_corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 diff --git a/test/core/http/corpus/5028c56a5116a186b7343ff59567b47347a0796d b/test/core/http/request_corpus/5028c56a5116a186b7343ff59567b47347a0796d index 5f2c4dfef0..5f2c4dfef0 100644 --- a/test/core/http/corpus/5028c56a5116a186b7343ff59567b47347a0796d +++ b/test/core/http/request_corpus/5028c56a5116a186b7343ff59567b47347a0796d diff --git a/test/core/http/corpus/533f62b3f495ce704babf3ee8d840f196a714dff b/test/core/http/request_corpus/533f62b3f495ce704babf3ee8d840f196a714dff index 6313cd967a..6313cd967a 100644 --- a/test/core/http/corpus/533f62b3f495ce704babf3ee8d840f196a714dff +++ b/test/core/http/request_corpus/533f62b3f495ce704babf3ee8d840f196a714dff diff --git a/test/core/http/corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 b/test/core/http/request_corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 index fee5512152..fee5512152 100644 --- a/test/core/http/corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 +++ b/test/core/http/request_corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 diff --git a/test/core/http/corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee b/test/core/http/request_corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee index bd7e239537..bd7e239537 100644 --- a/test/core/http/corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee +++ b/test/core/http/request_corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee diff --git a/test/core/http/corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 b/test/core/http/request_corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 index 9a15ab025f..9a15ab025f 100644 --- a/test/core/http/corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 +++ b/test/core/http/request_corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 diff --git a/test/core/http/corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 b/test/core/http/request_corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 index 480708e033..480708e033 100644 --- a/test/core/http/corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 +++ b/test/core/http/request_corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 diff --git a/test/core/http/corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e b/test/core/http/request_corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e index 0ed0dfadec..0ed0dfadec 100644 --- a/test/core/http/corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e +++ b/test/core/http/request_corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e diff --git a/test/core/http/corpus/657368df512ca6294b9df16adf935a3f374a8be2 b/test/core/http/request_corpus/657368df512ca6294b9df16adf935a3f374a8be2 index 1f14f69103..1f14f69103 100644 --- a/test/core/http/corpus/657368df512ca6294b9df16adf935a3f374a8be2 +++ b/test/core/http/request_corpus/657368df512ca6294b9df16adf935a3f374a8be2 diff --git a/test/core/http/corpus/7fc4520094902ce2c760d70eaad5b674d2817337 b/test/core/http/request_corpus/7fc4520094902ce2c760d70eaad5b674d2817337 index 8fc481d92b..8fc481d92b 100644 --- a/test/core/http/corpus/7fc4520094902ce2c760d70eaad5b674d2817337 +++ b/test/core/http/request_corpus/7fc4520094902ce2c760d70eaad5b674d2817337 diff --git a/test/core/http/corpus/81f59a12b458ec3604035cb962165c604d1355e6 b/test/core/http/request_corpus/81f59a12b458ec3604035cb962165c604d1355e6 index d4223ccf81..d4223ccf81 100644 --- a/test/core/http/corpus/81f59a12b458ec3604035cb962165c604d1355e6 +++ b/test/core/http/request_corpus/81f59a12b458ec3604035cb962165c604d1355e6 diff --git a/test/core/http/corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 b/test/core/http/request_corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 index 99e2c48bbd..99e2c48bbd 100644 --- a/test/core/http/corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 +++ b/test/core/http/request_corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 diff --git a/test/core/http/corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c b/test/core/http/request_corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c index 776253d750..776253d750 100644 --- a/test/core/http/corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c +++ b/test/core/http/request_corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c diff --git a/test/core/http/corpus/97e4499d450c95660de86747f527e670f2012548 b/test/core/http/request_corpus/97e4499d450c95660de86747f527e670f2012548 index b1927fbf63..b1927fbf63 100644 --- a/test/core/http/corpus/97e4499d450c95660de86747f527e670f2012548 +++ b/test/core/http/request_corpus/97e4499d450c95660de86747f527e670f2012548 diff --git a/test/core/http/corpus/9a996857196e0998a1278994a9bab3d35526e7f1 b/test/core/http/request_corpus/9a996857196e0998a1278994a9bab3d35526e7f1 index 0eb2c0da3a..0eb2c0da3a 100644 --- a/test/core/http/corpus/9a996857196e0998a1278994a9bab3d35526e7f1 +++ b/test/core/http/request_corpus/9a996857196e0998a1278994a9bab3d35526e7f1 diff --git a/test/core/http/corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 b/test/core/http/request_corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 index f93b9a08e3..f93b9a08e3 100644 --- a/test/core/http/corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 +++ b/test/core/http/request_corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 diff --git a/test/core/http/corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 b/test/core/http/request_corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 index 4ea07dc137..4ea07dc137 100644 --- a/test/core/http/corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 +++ b/test/core/http/request_corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 diff --git a/test/core/http/corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 b/test/core/http/request_corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 index 2e95bac35c..2e95bac35c 100644 --- a/test/core/http/corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 +++ b/test/core/http/request_corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 diff --git a/test/core/http/corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 b/test/core/http/request_corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 index 837449dda3..837449dda3 100644 --- a/test/core/http/corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 +++ b/test/core/http/request_corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 diff --git a/test/core/http/corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 b/test/core/http/request_corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 index 6075d0a5d7..6075d0a5d7 100644 --- a/test/core/http/corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 +++ b/test/core/http/request_corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 diff --git a/test/core/http/corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 b/test/core/http/request_corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 index 10905bed39..10905bed39 100644 --- a/test/core/http/corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 +++ b/test/core/http/request_corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 diff --git a/test/core/http/corpus/c4acff8aa2ff886f35439f72625d05002990c940 b/test/core/http/request_corpus/c4acff8aa2ff886f35439f72625d05002990c940 index 4539d9f012..4539d9f012 100644 --- a/test/core/http/corpus/c4acff8aa2ff886f35439f72625d05002990c940 +++ b/test/core/http/request_corpus/c4acff8aa2ff886f35439f72625d05002990c940 diff --git a/test/core/http/corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 b/test/core/http/request_corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 index 2704e4fb39..2704e4fb39 100644 --- a/test/core/http/corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 +++ b/test/core/http/request_corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 diff --git a/test/core/http/corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 b/test/core/http/request_corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 index f5cbbc69e7..f5cbbc69e7 100644 --- a/test/core/http/corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 +++ b/test/core/http/request_corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 diff --git a/test/core/http/corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 b/test/core/http/request_corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 index f6ea09c41b..f6ea09c41b 100644 --- a/test/core/http/corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 +++ b/test/core/http/request_corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 diff --git a/test/core/http/corpus/d39c8ee11a697634a09b309460c0bbd967e7effa b/test/core/http/request_corpus/d39c8ee11a697634a09b309460c0bbd967e7effa index e241a0c01c..e241a0c01c 100644 --- a/test/core/http/corpus/d39c8ee11a697634a09b309460c0bbd967e7effa +++ b/test/core/http/request_corpus/d39c8ee11a697634a09b309460c0bbd967e7effa diff --git a/test/core/http/corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 b/test/core/http/request_corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 index be33d81102..be33d81102 100644 --- a/test/core/http/corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 +++ b/test/core/http/request_corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 diff --git a/test/core/http/corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 b/test/core/http/request_corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 index e81a59f30b..e81a59f30b 100644 --- a/test/core/http/corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 +++ b/test/core/http/request_corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 diff --git a/test/core/http/corpus/d936dad71c129cf659097dc3db64550c4dd467f4 b/test/core/http/request_corpus/d936dad71c129cf659097dc3db64550c4dd467f4 index ccf918751d..ccf918751d 100644 --- a/test/core/http/corpus/d936dad71c129cf659097dc3db64550c4dd467f4 +++ b/test/core/http/request_corpus/d936dad71c129cf659097dc3db64550c4dd467f4 diff --git a/test/core/http/corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b b/test/core/http/request_corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b index b6fc095920..b6fc095920 100644 --- a/test/core/http/corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b +++ b/test/core/http/request_corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b diff --git a/test/core/http/corpus/e5c364b205855a2991ce07482aebb2a3a6147089 b/test/core/http/request_corpus/e5c364b205855a2991ce07482aebb2a3a6147089 index 98b5f62b2a..98b5f62b2a 100644 --- a/test/core/http/corpus/e5c364b205855a2991ce07482aebb2a3a6147089 +++ b/test/core/http/request_corpus/e5c364b205855a2991ce07482aebb2a3a6147089 diff --git a/test/core/http/corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb b/test/core/http/request_corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb index 78b36c913b..78b36c913b 100644 --- a/test/core/http/corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb +++ b/test/core/http/request_corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb diff --git a/test/core/http/corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 b/test/core/http/request_corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 index 06f1a3b800..06f1a3b800 100644 --- a/test/core/http/corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 +++ b/test/core/http/request_corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 diff --git a/test/core/http/corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b b/test/core/http/request_corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b index eb63d31fa5..eb63d31fa5 100644 --- a/test/core/http/corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b +++ b/test/core/http/request_corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b diff --git a/test/core/http/corpus/request1.txt b/test/core/http/request_corpus/request1.txt index 16a750fbf9..16a750fbf9 100644 --- a/test/core/http/corpus/request1.txt +++ b/test/core/http/request_corpus/request1.txt diff --git a/test/core/http/corpus/request2.txt b/test/core/http/request_corpus/request2.txt index 897a28406c..897a28406c 100644 --- a/test/core/http/corpus/request2.txt +++ b/test/core/http/request_corpus/request2.txt diff --git a/test/core/http/corpus/request3.txt b/test/core/http/request_corpus/request3.txt index aaa75bbb52..aaa75bbb52 100644 --- a/test/core/http/corpus/request3.txt +++ b/test/core/http/request_corpus/request3.txt diff --git a/test/core/http/corpus/request4.txt b/test/core/http/request_corpus/request4.txt index 593f6fa7b6..593f6fa7b6 100644 --- a/test/core/http/corpus/request4.txt +++ b/test/core/http/request_corpus/request4.txt diff --git a/test/core/http/corpus/request5.txt b/test/core/http/request_corpus/request5.txt index 19fb244355..19fb244355 100644 --- a/test/core/http/corpus/request5.txt +++ b/test/core/http/request_corpus/request5.txt diff --git a/test/core/http/corpus/response1.txt b/test/core/http/request_corpus/response1.txt index a17139982e..a17139982e 100644 --- a/test/core/http/corpus/response1.txt +++ b/test/core/http/request_corpus/response1.txt diff --git a/test/core/http/corpus/response2.txt b/test/core/http/request_corpus/response2.txt index 1b86449bb6..1b86449bb6 100644 --- a/test/core/http/corpus/response2.txt +++ b/test/core/http/request_corpus/response2.txt diff --git a/test/core/http/corpus/response3.txt b/test/core/http/request_corpus/response3.txt index 9e5b046c59..9e5b046c59 100644 --- a/test/core/http/corpus/response3.txt +++ b/test/core/http/request_corpus/response3.txt diff --git a/test/core/http/corpus/response4.txt b/test/core/http/request_corpus/response4.txt index b237b01fe0..b237b01fe0 100644 --- a/test/core/http/corpus/response4.txt +++ b/test/core/http/request_corpus/response4.txt diff --git a/test/core/http/corpus/response5.txt b/test/core/http/request_corpus/response5.txt index 2630595713..2630595713 100644 --- a/test/core/http/corpus/response5.txt +++ b/test/core/http/request_corpus/response5.txt diff --git a/test/core/http/corpus/response6.txt b/test/core/http/request_corpus/response6.txt index 797b6ee773..797b6ee773 100644 --- a/test/core/http/corpus/response6.txt +++ b/test/core/http/request_corpus/response6.txt diff --git a/test/core/http/corpus/toolong.txt b/test/core/http/request_corpus/toolong.txt index 9a9d5e2fc3..9a9d5e2fc3 100644 --- a/test/core/http/corpus/toolong.txt +++ b/test/core/http/request_corpus/toolong.txt diff --git a/test/core/http/fuzzer.c b/test/core/http/request_fuzzer.c index 7e4f4eb993..aac6cbb252 100644 --- a/test/core/http/fuzzer.c +++ b/test/core/http/request_fuzzer.c @@ -40,11 +40,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_http_parser parser; - grpc_http_parser_init(&parser); + grpc_http_request request; + memset(&request, 0, sizeof(request)); + grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request); gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size); - grpc_http_parser_parse(&parser, slice); - grpc_http_parser_eof(&parser); + GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice)); + GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser)); gpr_slice_unref(slice); grpc_http_parser_destroy(&parser); + grpc_http_request_destroy(&request); return 0; } diff --git a/test/core/http/response_corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 b/test/core/http/response_corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 new file mode 100644 index 0000000000..3d6face56a --- /dev/null +++ b/test/core/http/response_corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 @@ -0,0 +1,2 @@ +HTTP/1.1 …200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/05e613853d64a9669ea3cf41b0de777dc24931ba b/test/core/http/response_corpus/05e613853d64a9669ea3cf41b0de777dc24931ba new file mode 100644 index 0000000000..5cbaf2e460 --- /dev/null +++ b/test/core/http/response_corpus/05e613853d64a9669ea3cf41b0de777dc24931ba @@ -0,0 +1,2 @@ +HTTP/1.1 8) pMKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/069352518a1d1baa05f317c677d275cefda2ac97 b/test/core/http/response_corpus/069352518a1d1baa05f317c677d275cefda2ac97 new file mode 100644 index 0000000000..8831f0786b --- /dev/null +++ b/test/core/http/response_corpus/069352518a1d1baa05f317c677d275cefda2ac97 @@ -0,0 +1,2 @@ +HTTP/1.1 80) OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 b/test/core/http/response_corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 new file mode 100644 index 0000000000..10967d975c --- /dev/null +++ b/test/core/http/response_corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 @@ -0,0 +1,2 @@ +„HTT/21. 200 HT!TP/1OKH.1HTTP 200 OKH
+tHT//1T0P.1y 2001.
\ No newline at end of file diff --git a/test/core/http/response_corpus/0c5b7c2569410b526605e308309a7f36574e530d b/test/core/http/response_corpus/0c5b7c2569410b526605e308309a7f36574e530d new file mode 100644 index 0000000000..c79e456904 --- /dev/null +++ b/test/core/http/response_corpus/0c5b7c2569410b526605e308309a7f36574e530d @@ -0,0 +1,4 @@ +H
TTP/16.1 200 OK +test: h!ello + +abcd diff --git a/test/core/http/response_corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf b/test/core/http/response_corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf new file mode 100644 index 0000000000..7b979b5e10 --- /dev/null +++ b/test/core/http/response_corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKH
+tHTTP/01.021 Oes,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/1e1273f90187fdf5df3625764245610f86af6aa4 b/test/core/http/response_corpus/1e1273f90187fdf5df3625764245610f86af6aa4 new file mode 100644 index 0000000000..67382b4f3a --- /dev/null +++ b/test/core/http/response_corpus/1e1273f90187fdf5df3625764245610f86af6aa4 @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKHHTTP‰/1.200 OKH
+
+tHTHTTP/0 20T:tes/01.
\ No newline at end of file diff --git a/test/core/http/response_corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 b/test/core/http/response_corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 new file mode 100644 index 0000000000..deb8265a30 --- /dev/null +++ b/test/core/http/response_corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 @@ -0,0 +1,3 @@ +JHTT/21. 2è0 HTTP/1.1 200 OKHHTTP‰/1.200 OKH
+
+tHTHTHTJHTTPT
\ No newline at end of file diff --git a/test/core/http/response_corpus/24756c396bc72894fd720092bb6f9c03e66b469f b/test/core/http/response_corpus/24756c396bc72894fd720092bb6f9c03e66b469f new file mode 100644 index 0000000000..9f2e0e4a25 --- /dev/null +++ b/test/core/http/response_corpus/24756c396bc72894fd720092bb6f9c03e66b469f @@ -0,0 +1,2 @@ +JHTT/21. 200œHTT/0OKH.1 HTTP/200 OKH
+tH1.T
\ No newline at end of file diff --git a/test/core/http/response_corpus/276def41311933421ae7a9ee42e906c85b6a4d3f b/test/core/http/response_corpus/276def41311933421ae7a9ee42e906c85b6a4d3f new file mode 100644 index 0000000000..4db04b260a --- /dev/null +++ b/test/core/http/response_corpus/276def41311933421ae7a9ee42e906c85b6a4d3f @@ -0,0 +1,2 @@ +ITTP/11 …20O HTTP/11 2*0 OKH
+ HTDP/01.021 : OesHK
,H
diff --git a/test/core/http/response_corpus/29daa75432381937fd005cb25e314e328de6e9f9 b/test/core/http/response_corpus/29daa75432381937fd005cb25e314e328de6e9f9 new file mode 100644 index 0000000000..cee70bfe71 --- /dev/null +++ b/test/core/http/response_corpus/29daa75432381937fd005cb25e314e328de6e9f9 @@ -0,0 +1,2 @@ +JHTT¹21. 200HTT/0OKH1 HTTP/100 OKH
+tH1.T
\ No newline at end of file diff --git a/test/core/http/response_corpus/2a75204bc492084ad853682f8de3fb137d5907bc b/test/core/http/response_corpus/2a75204bc492084ad853682f8de3fb137d5907bc new file mode 100644 index 0000000000..e76b00e34c --- /dev/null +++ b/test/core/http/response_corpus/2a75204bc492084ad853682f8de3fb137d5907bc @@ -0,0 +1,2 @@ +GET / HTTHTTP/1.1 200 OKH
+t10H
\ No newline at end of file diff --git a/test/core/http/response_corpus/2d34ba249b755a880525cf53c665633a5e359305 b/test/core/http/response_corpus/2d34ba249b755a880525cf53c665633a5e359305 new file mode 100644 index 0000000000..7435f52ea5 --- /dev/null +++ b/test/core/http/response_corpus/2d34ba249b755a880525cf53c665633a5e359305 @@ -0,0 +1,2 @@ +ITTP/11 …20O HTTP/22 2*0 OKH
+ HTDP/01.021 : OesHK
,H
diff --git a/test/core/http/response_corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 b/test/core/http/response_corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 new file mode 100644 index 0000000000..cce8ded71a --- /dev/null +++ b/test/core/http/response_corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 @@ -0,0 +1,2 @@ +HTTP/1*9y 200 OKm
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b b/test/core/http/response_corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b new file mode 100644 index 0000000000..57efa3cabc --- /dev/null +++ b/test/core/http/response_corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b @@ -0,0 +1,4 @@ +JHTT/21. 200 HTTP/0OKH.1 200 OKH
+tHTTP/01.021 Oes,H
+t
+t
\ No newline at end of file diff --git a/test/core/http/response_corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece b/test/core/http/response_corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece new file mode 100644 index 0000000000..8df43e4dce --- /dev/null +++ b/test/core/http/response_corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece @@ -0,0 +1,2 @@ +HTTP/1.9y 200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf b/test/core/http/response_corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf new file mode 100644 index 0000000000..4efa386f3b --- /dev/null +++ b/test/core/http/response_corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf @@ -0,0 +1,9 @@ +HTTP/1.1 200 OKH
TTP/16.1 200 OK +tesH
+tHTTP/00.021 :Oe¶,H
+test: h!eHTTP/1.1 200 OKH
+llo + +abcdtH +TTP/01.021 : Oes,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/3953688866ccb3b4f371f1a858570d6afdb6452d b/test/core/http/response_corpus/3953688866ccb3b4f371f1a858570d6afdb6452d new file mode 100644 index 0000000000..f85f1df035 --- /dev/null +++ b/test/core/http/response_corpus/3953688866ccb3b4f371f1a858570d6afdb6452d @@ -0,0 +1,3 @@ +žHTTP/1.1 200 HH +OK
TDP/01.021 : Oe:,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/39b19c41ba537f37511eff7727733715db432e76 b/test/core/http/response_corpus/39b19c41ba537f37511eff7727733715db432e76 new file mode 100644 index 0000000000..fefa4512a8 --- /dev/null +++ b/test/core/http/response_corpus/39b19c41ba537f37511eff7727733715db432e76 @@ -0,0 +1,2 @@ +HTTP/1.1 000 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac b/test/core/http/response_corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac new file mode 100644 index 0000000000..b967b57614 --- /dev/null +++ b/test/core/http/response_corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKH
+tHTTP/01.021 : Oes,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/3f03265921120c6ffa61b944e213e062a5538d4b b/test/core/http/response_corpus/3f03265921120c6ffa61b944e213e062a5538d4b new file mode 100644 index 0000000000..8af90071c3 --- /dev/null +++ b/test/core/http/response_corpus/3f03265921120c6ffa61b944e213e062a5538d4b @@ -0,0 +1,2 @@ +@TTP/1.1y 002ÿOKH
+ves
\ No newline at end of file diff --git a/test/core/http/response_corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 b/test/core/http/response_corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 new file mode 100644 index 0000000000..7d20266703 --- /dev/null +++ b/test/core/http/response_corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 @@ -0,0 +1,2 @@ +HTTP/1.1y 200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 b/test/core/http/response_corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 new file mode 100644 index 0000000000..5996b9a75c --- /dev/null +++ b/test/core/http/response_corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 @@ -0,0 +1,4 @@ +JHTTP/1.1 +00 HTTP/1.1 200 OKHHTTPOKH
‰/1. +200 OKtH
+
+tHTH
\ No newline at end of file diff --git a/test/core/http/response_corpus/487725eb38511c79a9340bf4560a1411061fa6fa b/test/core/http/response_corpus/487725eb38511c79a9340bf4560a1411061fa6fa new file mode 100644 index 0000000000..c59c4d2246 --- /dev/null +++ b/test/core/http/response_corpus/487725eb38511c79a9340bf4560a1411061fa6fa @@ -0,0 +1,2 @@ +HTTP/01.021 O,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 b/test/core/http/response_corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 new file mode 100644 index 0000000000..8ac7ceb2d5 --- /dev/null +++ b/test/core/http/response_corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 @@ -0,0 +1,2 @@ +ITTP/11 …20O HK
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 b/test/core/http/response_corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 new file mode 100644 index 0000000000..49d1c8f1d2 --- /dev/null +++ b/test/core/http/response_corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 @@ -0,0 +1,2 @@ +HTTP/1.1 200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/5028c56a5116a186b7343ff59567b47347a0796d b/test/core/http/response_corpus/5028c56a5116a186b7343ff59567b47347a0796d new file mode 100644 index 0000000000..5f2c4dfef0 --- /dev/null +++ b/test/core/http/response_corpus/5028c56a5116a186b7343ff59567b47347a0796d @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKH
+ HTDP/01.021 : Oes,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/533f62b3f495ce704babf3ee8d840f196a714dff b/test/core/http/response_corpus/533f62b3f495ce704babf3ee8d840f196a714dff new file mode 100644 index 0000000000..6313cd967a --- /dev/null +++ b/test/core/http/response_corpus/533f62b3f495ce704babf3ee8d840f196a714dff @@ -0,0 +1,4 @@ +JHTT/21. 200 HTTP/1OKH.1 200 OKH
+tHTTP/01.021 Oes,H
+t
+t
\ No newline at end of file diff --git a/test/core/http/response_corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 b/test/core/http/response_corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 new file mode 100644 index 0000000000..fee5512152 --- /dev/null +++ b/test/core/http/response_corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 @@ -0,0 +1,2 @@ +JÏHTTP‰/1.200:OKHHTã/21. 2è0 HTTP/
+1.1 200 OKHHTtTP‰
\ No newline at end of file diff --git a/test/core/http/response_corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee b/test/core/http/response_corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee new file mode 100644 index 0000000000..bd7e239537 --- /dev/null +++ b/test/core/http/response_corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee @@ -0,0 +1,2 @@ +ITTP/11 …20O HTTP/11 2*0 OKH
+ HTDP/01.021 : OesHK
,H
diff --git a/test/core/http/response_corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 b/test/core/http/response_corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 new file mode 100644 index 0000000000..9a15ab025f --- /dev/null +++ b/test/core/http/response_corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 @@ -0,0 +1,2 @@ +HTTP/1. 200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 b/test/core/http/response_corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 new file mode 100644 index 0000000000..480708e033 --- /dev/null +++ b/test/core/http/response_corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 @@ -0,0 +1,2 @@ +@TTP/1.1y 00'JHTTP/1.1 +00ÿOïH HTTP/
+ve1.1 200s
\ No newline at end of file diff --git a/test/core/http/response_corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e b/test/core/http/response_corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e new file mode 100644 index 0000000000..0ed0dfadec --- /dev/null +++ b/test/core/http/response_corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e @@ -0,0 +1,2 @@ +ITTP/11 …20O HTTP/1.1 200 OKH
+ HTDP/01.021 : OesHK
,H
diff --git a/test/core/http/response_corpus/657368df512ca6294b9df16adf935a3f374a8be2 b/test/core/http/response_corpus/657368df512ca6294b9df16adf935a3f374a8be2 new file mode 100644 index 0000000000..1f14f69103 --- /dev/null +++ b/test/core/http/response_corpus/657368df512ca6294b9df16adf935a3f374a8be2 @@ -0,0 +1,3 @@ +HTT +/1.1 201 OKH
+des
\ No newline at end of file diff --git a/test/core/http/response_corpus/7fc4520094902ce2c760d70eaad5b674d2817337 b/test/core/http/response_corpus/7fc4520094902ce2c760d70eaad5b674d2817337 new file mode 100644 index 0000000000..8fc481d92b --- /dev/null +++ b/test/core/http/response_corpus/7fc4520094902ce2c760d70eaad5b674d2817337 @@ -0,0 +1,5 @@ +JHTTP/1.GET / HTTP/1.0 +1 200 OKH
+ + +t
\ No newline at end of file diff --git a/test/core/http/response_corpus/81f59a12b458ec3604035cb962165c604d1355e6 b/test/core/http/response_corpus/81f59a12b458ec3604035cb962165c604d1355e6 new file mode 100644 index 0000000000..d4223ccf81 --- /dev/null +++ b/test/core/http/response_corpus/81f59a12b458ec3604035cb962165c604d1355e6 @@ -0,0 +1,2 @@ +HTTP/1.1 8p) )MKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 b/test/core/http/response_corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 new file mode 100644 index 0000000000..99e2c48bbd --- /dev/null +++ b/test/core/http/response_corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 @@ -0,0 +1,4 @@ +HTTP/1.1 200 OKH
+tHTHTTP/1. 20TP/01.020(: Oes,H0 OKH
+
+tteses
\ No newline at end of file diff --git a/test/core/http/response_corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c b/test/core/http/response_corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c new file mode 100644 index 0000000000..776253d750 --- /dev/null +++ b/test/core/http/response_corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c @@ -0,0 +1,2 @@ +ITTp/11 …20O HTTP/*1.1 200 OKH
+ HTDP/02.021 : OesHK
,H
diff --git a/test/core/http/response_corpus/97e4499d450c95660de86747f527e670f2012548 b/test/core/http/response_corpus/97e4499d450c95660de86747f527e670f2012548 new file mode 100644 index 0000000000..b1927fbf63 --- /dev/null +++ b/test/core/http/response_corpus/97e4499d450c95660de86747f527e670f2012548 @@ -0,0 +1,3 @@ +HTHHTT`TT +/1.1 201 P*/OKH
+des1.1 2T
\ No newline at end of file diff --git a/test/core/http/response_corpus/9a996857196e0998a1278994a9bab3d35526e7f1 b/test/core/http/response_corpus/9a996857196e0998a1278994a9bab3d35526e7f1 new file mode 100644 index 0000000000..0eb2c0da3a --- /dev/null +++ b/test/core/http/response_corpus/9a996857196e0998a1278994a9bab3d35526e7f1 @@ -0,0 +1,2 @@ +@TTP/1.1y 002ÿOKH
+ves
\ No newline at end of file diff --git a/test/core/http/response_corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 b/test/core/http/response_corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 new file mode 100644 index 0000000000..f93b9a08e3 --- /dev/null +++ b/test/core/http/response_corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 @@ -0,0 +1,3 @@ +„HTT/21. 200 HTTP/1.1 HT!TP/1OKH.1HTTP 200 OKH
+tHT/:/80 OKH
+1
\ No newline at end of file diff --git a/test/core/http/response_corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 b/test/core/http/response_corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 new file mode 100644 index 0000000000..4ea07dc137 --- /dev/null +++ b/test/core/http/response_corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 @@ -0,0 +1,5 @@ +JHTTP/1>GET / HTTP/2.0 +1 200 OKH
+ + +t
\ No newline at end of file diff --git a/test/core/http/response_corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 b/test/core/http/response_corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 new file mode 100644 index 0000000000..2e95bac35c --- /dev/null +++ b/test/core/http/response_corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 @@ -0,0 +1,3 @@ +„HTT/21. 200 HTTP/1.1 HT!TP/1OKH.1HTTP 200 OKH
+tHT//80) OKH
+1
\ No newline at end of file diff --git a/test/core/http/response_corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 b/test/core/http/response_corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 new file mode 100644 index 0000000000..837449dda3 --- /dev/null +++ b/test/core/http/response_corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 @@ -0,0 +1,2 @@ +HTTP/1.1 80î OH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 b/test/core/http/response_corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 new file mode 100644 index 0000000000..6075d0a5d7 --- /dev/null +++ b/test/core/http/response_corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 @@ -0,0 +1,17 @@ +HTTP/1.1 200 OKH
TTP/16.1 200 OK +tesH
+tHHTTP/1.1 20TTP/00.021 :Oe¶,H
+test: h!eHTTP/1.1 200 OKH
+llo + +abcdtH +TTP/01.021 : Oes,0 OKH
TTP/16.1 200 OK +tesH
+tHTTP/00.021 :Oe¶,H
+test: h!eHTTP/1.1 200 OKH
+llo + +abcdtH +TTP/01.021 : Oes,H
+Ht
+teses
\ No newline at end of file diff --git a/test/core/http/response_corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 b/test/core/http/response_corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 new file mode 100644 index 0000000000..10905bed39 --- /dev/null +++ b/test/core/http/response_corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 @@ -0,0 +1,2 @@ +JHTTP/1.1 200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/c4acff8aa2ff886f35439f72625d05002990c940 b/test/core/http/response_corpus/c4acff8aa2ff886f35439f72625d05002990c940 new file mode 100644 index 0000000000..4539d9f012 --- /dev/null +++ b/test/core/http/response_corpus/c4acff8aa2ff886f35439f72625d05002990c940 @@ -0,0 +1,4 @@ +JHTT/21. 200 HTTP/2OKH.1 200 OKH
+tHTTP/01.021 Oes,H
+t
+t
\ No newline at end of file diff --git a/test/core/http/response_corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 b/test/core/http/response_corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 new file mode 100644 index 0000000000..2704e4fb39 --- /dev/null +++ b/test/core/http/response_corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 @@ -0,0 +1,2 @@ +HTTP/1.1 767) OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 b/test/core/http/response_corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 new file mode 100644 index 0000000000..f5cbbc69e7 --- /dev/null +++ b/test/core/http/response_corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 @@ -0,0 +1,3 @@ +HJHTHHTT`TT +/1.1 201 P*HHTT/T1/OKH
+des1.1 2.1T 20T1
\ No newline at end of file diff --git a/test/core/http/response_corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 b/test/core/http/response_corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 new file mode 100644 index 0000000000..f6ea09c41b --- /dev/null +++ b/test/core/http/response_corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 @@ -0,0 +1,3 @@ +JHTT/21. 200 HTTPHTTP/1.1 80î OH/1OKH.0 200 OKH
+tHTTP/0
+te
\ No newline at end of file diff --git a/test/core/http/response_corpus/d39c8ee11a697634a09b309460c0bbd967e7effa b/test/core/http/response_corpus/d39c8ee11a697634a09b309460c0bbd967e7effa new file mode 100644 index 0000000000..e241a0c01c --- /dev/null +++ b/test/core/http/response_corpus/d39c8ee11a697634a09b309460c0bbd967e7effa @@ -0,0 +1,17 @@ +HTTP/1.1 200 OKH
TTP/16.1 200 OK +tesHTTP/1.1 200 OKH
TTP/16.1 200 OK +tesH
+tHTTP/00.021 :Oe¶,H
+test: h!eHTTP/1.1 200H
+tHTTP/00.010 :Oe¶,H
+test: h!eHTTP/1.… 200 OKH
+llo + +abcdtH +TTP/01.02 : Oes,H OKH
+llo + +abcdtH +TTP/01.021 : Oes
, +H
+tteess
\ No newline at end of file diff --git a/test/core/http/response_corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 b/test/core/http/response_corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 new file mode 100644 index 0000000000..be33d81102 --- /dev/null +++ b/test/core/http/response_corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKH
+ HTTP/01.021 : Oes,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 b/test/core/http/response_corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 new file mode 100644 index 0000000000..e81a59f30b --- /dev/null +++ b/test/core/http/response_corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 @@ -0,0 +1,2 @@ +ÏHTTP‰/1.200:OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/d936dad71c129cf659097dc3db64550c4dd467f4 b/test/core/http/response_corpus/d936dad71c129cf659097dc3db64550c4dd467f4 new file mode 100644 index 0000000000..ccf918751d --- /dev/null +++ b/test/core/http/response_corpus/d936dad71c129cf659097dc3db64550c4dd467f4 @@ -0,0 +1,2 @@ +HTTP‰/1.200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b b/test/core/http/response_corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b new file mode 100644 index 0000000000..b6fc095920 --- /dev/null +++ b/test/core/http/response_corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b @@ -0,0 +1,3 @@ +JHTT/21. 200 HTTRHTTP/1.1 0î OL/1OKH.0 200 OKH
+tHTTP/0
+te
\ No newline at end of file diff --git a/test/core/http/response_corpus/e5c364b205855a2991ce07482aebb2a3a6147089 b/test/core/http/response_corpus/e5c364b205855a2991ce07482aebb2a3a6147089 new file mode 100644 index 0000000000..98b5f62b2a --- /dev/null +++ b/test/core/http/response_corpus/e5c364b205855a2991ce07482aebb2a3a6147089 @@ -0,0 +1,2 @@ +TTHP‰/1.200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb b/test/core/http/response_corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb new file mode 100644 index 0000000000..78b36c913b --- /dev/null +++ b/test/core/http/response_corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb @@ -0,0 +1,2 @@ +ITHTTTPHT/12 …2S HTKP/1.1 767) OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 b/test/core/http/response_corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 new file mode 100644 index 0000000000..06f1a3b800 --- /dev/null +++ b/test/core/http/response_corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 @@ -0,0 +1 @@ +HH
\ No newline at end of file diff --git a/test/core/http/response_corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b b/test/core/http/response_corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b new file mode 100644 index 0000000000..eb63d31fa5 --- /dev/null +++ b/test/core/http/response_corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b @@ -0,0 +1,2 @@ +ITTP/11 …20O HTTP/1.1 200 OKH
+HT DP/01021 : OesHK
,H
diff --git a/test/core/http/response_corpus/request1.txt b/test/core/http/response_corpus/request1.txt new file mode 100644 index 0000000000..16a750fbf9 --- /dev/null +++ b/test/core/http/response_corpus/request1.txt @@ -0,0 +1,3 @@ +GET / HTTP/1.0 + + diff --git a/test/core/http/response_corpus/request2.txt b/test/core/http/response_corpus/request2.txt new file mode 100644 index 0000000000..897a28406c --- /dev/null +++ b/test/core/http/response_corpus/request2.txt @@ -0,0 +1,3 @@ +GET / HTTP/1.0 +Content-Length: 128 + diff --git a/test/core/http/response_corpus/request3.txt b/test/core/http/response_corpus/request3.txt new file mode 100644 index 0000000000..aaa75bbb52 --- /dev/null +++ b/test/core/http/response_corpus/request3.txt @@ -0,0 +1,3 @@ +GET / HTTP/1.1 +Content-Length: 128 + diff --git a/test/core/http/response_corpus/request4.txt b/test/core/http/response_corpus/request4.txt new file mode 100644 index 0000000000..593f6fa7b6 --- /dev/null +++ b/test/core/http/response_corpus/request4.txt @@ -0,0 +1,3 @@ +GET /foo.bar HTTP/1.1 +Content-Length: 128 + diff --git a/test/core/http/response_corpus/request5.txt b/test/core/http/response_corpus/request5.txt new file mode 100644 index 0000000000..19fb244355 --- /dev/null +++ b/test/core/http/response_corpus/request5.txt @@ -0,0 +1,3 @@ +POST / HTTP/1.0 + +asdlfkjadsfl;akdjsfasdf diff --git a/test/core/http/response_corpus/response1.txt b/test/core/http/response_corpus/response1.txt new file mode 100644 index 0000000000..a17139982e --- /dev/null +++ b/test/core/http/response_corpus/response1.txt @@ -0,0 +1,4 @@ +HTTP/1.1 200 OK +test: hello + +abcd diff --git a/test/core/http/response_corpus/response2.txt b/test/core/http/response_corpus/response2.txt new file mode 100644 index 0000000000..1b86449bb6 --- /dev/null +++ b/test/core/http/response_corpus/response2.txt @@ -0,0 +1,4 @@ +HTTP/0.9 200 OK +test: hello + +abcd diff --git a/test/core/http/response_corpus/response3.txt b/test/core/http/response_corpus/response3.txt new file mode 100644 index 0000000000..9e5b046c59 --- /dev/null +++ b/test/core/http/response_corpus/response3.txt @@ -0,0 +1,5 @@ +HTTP/0.9 200 OK +test: hello +content-length: 102384398 + +abcd diff --git a/test/core/http/response_corpus/response4.txt b/test/core/http/response_corpus/response4.txt new file mode 100644 index 0000000000..b237b01fe0 --- /dev/null +++ b/test/core/http/response_corpus/response4.txt @@ -0,0 +1,2 @@ +HTTP/1.1 404 Not Found + diff --git a/test/core/http/response_corpus/response5.txt b/test/core/http/response_corpus/response5.txt new file mode 100644 index 0000000000..2630595713 --- /dev/null +++ b/test/core/http/response_corpus/response5.txt @@ -0,0 +1,5 @@ +HTTP/0.9 200 OK +test: hello +content-length: 4 + +abcd diff --git a/test/core/http/response_corpus/response6.txt b/test/core/http/response_corpus/response6.txt new file mode 100644 index 0000000000..797b6ee773 --- /dev/null +++ b/test/core/http/response_corpus/response6.txt @@ -0,0 +1,5 @@ +HTTP/0.9 200 OK +test: hello +content-length: 6 + +abcd diff --git a/test/core/http/response_corpus/toolong.txt b/test/core/http/response_corpus/toolong.txt new file mode 100644 index 0000000000..9a9d5e2fc3 --- /dev/null +++ b/test/core/http/response_corpus/toolong.txt @@ -0,0 +1,2 @@ +GET / HTTP/1.1 +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb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bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb diff --git a/test/core/http/response_fuzzer.c b/test/core/http/response_fuzzer.c new file mode 100644 index 0000000000..c453e1d667 --- /dev/null +++ b/test/core/http/response_fuzzer.c @@ -0,0 +1,53 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include <stdint.h> +#include <string.h> + +#include <grpc/support/alloc.h> + +#include "src/core/lib/http/parser.h" + +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + grpc_http_parser parser; + grpc_http_response response; + memset(&response, 0, sizeof(response)); + grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response); + gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size); + GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice)); + GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser)); + gpr_slice_unref(slice); + grpc_http_parser_destroy(&parser); + grpc_http_response_destroy(&response); + return 0; +} diff --git a/test/core/internal_api_canaries/iomgr.c b/test/core/internal_api_canaries/iomgr.c index f87a80cd90..84ff8ff556 100644 --- a/test/core/internal_api_canaries/iomgr.c +++ b/test/core/internal_api_canaries/iomgr.c @@ -54,7 +54,7 @@ static void test_code(void) { grpc_closure closure; closure.cb = NULL; closure.cb_arg = NULL; - closure.final_data = 0; + closure.next_data.scratch = 0; grpc_closure_list closure_list = GRPC_CLOSURE_LIST_INIT; closure_list.head = NULL; @@ -65,15 +65,14 @@ static void test_code(void) { grpc_closure_create(NULL, NULL); grpc_closure_list_move(NULL, NULL); - grpc_closure_list_add(NULL, NULL, true); - bool x = grpc_closure_list_empty(closure_list); - grpc_closure_next(&closure); + grpc_closure_list_append(NULL, NULL, GRPC_ERROR_CREATE("Foo")); + grpc_closure_list_empty(closure_list); /* exec_ctx.h */ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx_flush(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx); - grpc_exec_ctx_enqueue(&exec_ctx, &closure, x, NULL); + grpc_exec_ctx_push(&exec_ctx, &closure, GRPC_ERROR_CREATE("Foo"), NULL); grpc_exec_ctx_enqueue_list(&exec_ctx, &closure_list, NULL); /* endpoint.h */ @@ -95,7 +94,7 @@ static void test_code(void) { /* executor.h */ grpc_executor_init(); - grpc_executor_enqueue(&closure, x); + grpc_executor_push(&closure, GRPC_ERROR_CREATE("Phi")); grpc_executor_shutdown(); /* pollset.h */ diff --git a/test/core/iomgr/endpoint_pair_test.c b/test/core/iomgr/endpoint_pair_test.c index 0df94a878f..99b86b6213 100644 --- a/test/core/iomgr/endpoint_pair_test.c +++ b/test/core/iomgr/endpoint_pair_test.c @@ -64,7 +64,8 @@ static grpc_endpoint_test_config configs[] = { {"tcp/tcp_socketpair", create_fixture_endpoint_pair, clean_up}, }; -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c index f97f33712e..02a7b341de 100644 --- a/test/core/iomgr/fd_posix_test.c +++ b/test/core/iomgr/fd_posix_test.c @@ -133,14 +133,14 @@ static void session_shutdown_cb(grpc_exec_ctx *exec_ctx, void *arg, /*session */ /* Called when data become readable in a session. */ static void session_read_cb(grpc_exec_ctx *exec_ctx, void *arg, /*session */ - bool success) { + grpc_error *error) { session *se = arg; int fd = grpc_fd_wrapped_fd(se->em_fd); ssize_t read_once = 0; ssize_t read_total = 0; - if (!success) { + if (error != GRPC_ERROR_NONE) { session_shutdown_cb(exec_ctx, arg, 1); return; } @@ -191,7 +191,7 @@ static void listen_shutdown_cb(grpc_exec_ctx *exec_ctx, void *arg /*server */, /* Called when a new TCP connection request arrives in the listening port. */ static void listen_cb(grpc_exec_ctx *exec_ctx, void *arg, /*=sv_arg*/ - bool success) { + grpc_error *error) { server *sv = arg; int fd; int flags; @@ -200,7 +200,7 @@ static void listen_cb(grpc_exec_ctx *exec_ctx, void *arg, /*=sv_arg*/ socklen_t slen = sizeof(ss); grpc_fd *listen_em_fd = sv->em_fd; - if (!success) { + if (error != GRPC_ERROR_NONE) { listen_shutdown_cb(exec_ctx, arg, 1); return; } @@ -305,12 +305,12 @@ static void client_session_shutdown_cb(grpc_exec_ctx *exec_ctx, /* Write as much as possible, then register notify_on_write. */ static void client_session_write(grpc_exec_ctx *exec_ctx, void *arg, /*client */ - bool success) { + grpc_error *error) { client *cl = arg; int fd = grpc_fd_wrapped_fd(cl->em_fd); ssize_t write_once = 0; - if (!success) { + if (error != GRPC_ERROR_NONE) { gpr_mu_lock(g_mu); client_session_shutdown_cb(exec_ctx, arg, 1); gpr_mu_unlock(g_mu); @@ -363,7 +363,7 @@ static void client_start(grpc_exec_ctx *exec_ctx, client *cl, int port) { cl->em_fd = grpc_fd_create(fd, "client"); grpc_pollset_add_fd(exec_ctx, g_pollset, cl->em_fd); - client_session_write(exec_ctx, cl, 1); + client_session_write(exec_ctx, cl, GRPC_ERROR_NONE); } /* Wait for the signal to shutdown a client. */ @@ -411,7 +411,8 @@ void init_change_data(fd_change_data *fdc) { fdc->cb_that_ran = NULL; } void destroy_change_data(fd_change_data *fdc) {} static void first_read_callback(grpc_exec_ctx *exec_ctx, - void *arg /* fd_change_data */, bool success) { + void *arg /* fd_change_data */, + grpc_error *error) { fd_change_data *fdc = arg; gpr_mu_lock(g_mu); @@ -421,7 +422,8 @@ static void first_read_callback(grpc_exec_ctx *exec_ctx, } static void second_read_callback(grpc_exec_ctx *exec_ctx, - void *arg /* fd_change_data */, bool success) { + void *arg /* fd_change_data */, + grpc_error *error) { fd_change_data *fdc = arg; gpr_mu_lock(g_mu); @@ -514,7 +516,8 @@ static void test_grpc_fd_change(void) { close(sv[1]); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/iomgr/resolve_address_test.c b/test/core/iomgr/resolve_address_test.c index c3ede1801d..023d7e6c68 100644 --- a/test/core/iomgr/resolve_address_test.c +++ b/test/core/iomgr/resolve_address_test.c @@ -42,54 +42,74 @@ static gpr_timespec test_deadline(void) { return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(100); } -static void must_succeed(grpc_exec_ctx *exec_ctx, void *evp, - grpc_resolved_addresses *p) { - GPR_ASSERT(p); - GPR_ASSERT(p->naddrs >= 1); - grpc_resolved_addresses_destroy(p); - gpr_event_set(evp, (void *)1); +typedef struct args_struct { + gpr_event ev; + grpc_resolved_addresses *addrs; +} args_struct; + +void args_init(args_struct *args) { + gpr_event_init(&args->ev); + args->addrs = NULL; +} + +void args_finish(args_struct *args) { + GPR_ASSERT(gpr_event_wait(&args->ev, test_deadline())); + grpc_resolved_addresses_destroy(args->addrs); +} + +static void must_succeed(grpc_exec_ctx *exec_ctx, void *argsp, + grpc_error *err) { + args_struct *args = argsp; + GPR_ASSERT(err == GRPC_ERROR_NONE); + GPR_ASSERT(args->addrs != NULL); + GPR_ASSERT(args->addrs->naddrs > 1); + gpr_event_set(&args->ev, (void *)1); } -static void must_fail(grpc_exec_ctx *exec_ctx, void *evp, - grpc_resolved_addresses *p) { - GPR_ASSERT(!p); - gpr_event_set(evp, (void *)1); +static void must_fail(grpc_exec_ctx *exec_ctx, void *argsp, grpc_error *err) { + args_struct *args = argsp; + GPR_ASSERT(err != GRPC_ERROR_NONE); + gpr_event_set(&args->ev, (void *)1); } static void test_localhost(void) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, "localhost:1", NULL, must_succeed, &ev); + grpc_resolve_address(&exec_ctx, "localhost:1", NULL, + grpc_closure_create(must_succeed, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } static void test_default_port(void) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, "localhost", "1", must_succeed, &ev); + grpc_resolve_address(&exec_ctx, "localhost", "1", + grpc_closure_create(must_succeed, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } static void test_missing_default_port(void) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, "localhost", NULL, must_fail, &ev); + grpc_resolve_address(&exec_ctx, "localhost", NULL, + grpc_closure_create(must_fail, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } static void test_ipv6_with_port(void) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, "[2001:db8::1]:1", NULL, must_succeed, &ev); + grpc_resolve_address(&exec_ctx, "[2001:db8::1]:1", NULL, + grpc_closure_create(must_succeed, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } static void test_ipv6_without_port(void) { @@ -98,12 +118,13 @@ static void test_ipv6_without_port(void) { }; unsigned i; for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, kCases[i], "80", must_succeed, &ev); + grpc_resolve_address(&exec_ctx, kCases[i], "80", + grpc_closure_create(must_succeed, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } } @@ -113,12 +134,13 @@ static void test_invalid_ip_addresses(void) { }; unsigned i; for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, kCases[i], NULL, must_fail, &ev); + grpc_resolve_address(&exec_ctx, kCases[i], NULL, + grpc_closure_create(must_fail, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } } @@ -128,12 +150,13 @@ static void test_unparseable_hostports(void) { }; unsigned i; for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, kCases[i], "1", must_fail, &ev); + grpc_resolve_address(&exec_ctx, kCases[i], "1", + grpc_closure_create(must_fail, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } } diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c index 22dc9366c3..d1c57ca769 100644 --- a/test/core/iomgr/tcp_client_posix_test.c +++ b/test/core/iomgr/tcp_client_posix_test.c @@ -67,18 +67,19 @@ static void finish_connection() { gpr_mu_unlock(g_mu); } -static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { GPR_ASSERT(g_connecting != NULL); - GPR_ASSERT(success); + GPR_ASSERT(error == GRPC_ERROR_NONE); grpc_endpoint_shutdown(exec_ctx, g_connecting); grpc_endpoint_destroy(exec_ctx, g_connecting); g_connecting = NULL; finish_connection(); } -static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { GPR_ASSERT(g_connecting == NULL); - GPR_ASSERT(!success); + GPR_ASSERT(error != GRPC_ERROR_NONE); finish_connection(); } @@ -179,7 +180,8 @@ void test_fails(void) { grpc_exec_ctx_finish(&exec_ctx); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c index 7a98fa0e50..6b21f0dc27 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -139,12 +139,13 @@ static size_t count_slices(gpr_slice *slices, size_t nslices, return num_bytes; } -static void read_cb(grpc_exec_ctx *exec_ctx, void *user_data, bool success) { +static void read_cb(grpc_exec_ctx *exec_ctx, void *user_data, + grpc_error *error) { struct read_socket_state *state = (struct read_socket_state *)user_data; size_t read_bytes; int current_data; - GPR_ASSERT(success); + GPR_ASSERT(error == GRPC_ERROR_NONE); gpr_mu_lock(g_mu); current_data = state->read_bytes % 256; @@ -281,7 +282,8 @@ static gpr_slice *allocate_blocks(size_t num_bytes, size_t slice_size, } static void write_done(grpc_exec_ctx *exec_ctx, - void *user_data /* write_socket_state */, bool success) { + void *user_data /* write_socket_state */, + grpc_error *error) { struct write_socket_state *state = (struct write_socket_state *)user_data; gpr_log(GPR_INFO, "Write done callback called"); gpr_mu_lock(g_mu); @@ -384,7 +386,7 @@ static void write_test(size_t num_bytes, size_t slice_size) { grpc_exec_ctx_finish(&exec_ctx); } -void on_fd_released(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +void on_fd_released(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *errors) { int *done = arg; *done = 1; grpc_pollset_kick(g_pollset, NULL); @@ -504,7 +506,8 @@ static grpc_endpoint_test_config configs[] = { {"tcp/tcp_socketpair", create_fixture_tcp_socketpair, clean_up}, }; -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c index 266d2396af..00ec175c8f 100644 --- a/test/core/iomgr/tcp_server_posix_test.c +++ b/test/core/iomgr/tcp_server_posix_test.c @@ -90,7 +90,7 @@ static void on_connect_result_set(on_connect_result *result, } static void server_weak_ref_shutdown(grpc_exec_ctx *exec_ctx, void *arg, - bool success) { + grpc_error *error) { server_weak_ref *weak_ref = arg; weak_ref->server = NULL; } @@ -126,14 +126,16 @@ static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp, static void test_no_op(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_tcp_server *s = grpc_tcp_server_create(NULL); + grpc_tcp_server *s; + GPR_ASSERT(GRPC_ERROR_NONE == grpc_tcp_server_create(NULL, &s)); grpc_tcp_server_unref(&exec_ctx, s); grpc_exec_ctx_finish(&exec_ctx); } static void test_no_op_with_start(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_tcp_server *s = grpc_tcp_server_create(NULL); + grpc_tcp_server *s; + GPR_ASSERT(GRPC_ERROR_NONE == grpc_tcp_server_create(NULL, &s)); LOG_TEST("test_no_op_with_start"); grpc_tcp_server_start(&exec_ctx, s, NULL, 0, on_connect, NULL); grpc_tcp_server_unref(&exec_ctx, s); @@ -143,13 +145,16 @@ static void test_no_op_with_start(void) { static void test_no_op_with_port(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; struct sockaddr_in addr; - grpc_tcp_server *s = grpc_tcp_server_create(NULL); + grpc_tcp_server *s; + GPR_ASSERT(GRPC_ERROR_NONE == grpc_tcp_server_create(NULL, &s)); LOG_TEST("test_no_op_with_port"); memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; - GPR_ASSERT( - grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, sizeof(addr)) > 0); + int port; + GPR_ASSERT(grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, sizeof(addr), + &port) == GRPC_ERROR_NONE && + port > 0); grpc_tcp_server_unref(&exec_ctx, s); grpc_exec_ctx_finish(&exec_ctx); @@ -158,13 +163,16 @@ static void test_no_op_with_port(void) { static void test_no_op_with_port_and_start(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; struct sockaddr_in addr; - grpc_tcp_server *s = grpc_tcp_server_create(NULL); + grpc_tcp_server *s; + GPR_ASSERT(GRPC_ERROR_NONE == grpc_tcp_server_create(NULL, &s)); LOG_TEST("test_no_op_with_port_and_start"); + int port; memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; - GPR_ASSERT( - grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, sizeof(addr)) > 0); + GPR_ASSERT(grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, sizeof(addr), + &port) == GRPC_ERROR_NONE && + port > 0); grpc_tcp_server_start(&exec_ctx, s, NULL, 0, on_connect, NULL); @@ -213,7 +221,8 @@ static void test_connect(unsigned n) { int svr_port; unsigned svr1_fd_count; int svr1_port; - grpc_tcp_server *s = grpc_tcp_server_create(NULL); + grpc_tcp_server *s; + GPR_ASSERT(GRPC_ERROR_NONE == grpc_tcp_server_create(NULL, &s)); unsigned i; server_weak_ref weak_ref; server_weak_ref_init(&weak_ref); @@ -222,14 +231,17 @@ static void test_connect(unsigned n) { memset(&addr, 0, sizeof(addr)); memset(&addr1, 0, sizeof(addr1)); addr.ss_family = addr1.ss_family = AF_INET; - svr_port = grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, addr_len); + GPR_ASSERT(GRPC_ERROR_NONE == + grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, addr_len, + &svr_port)); GPR_ASSERT(svr_port > 0); /* Cannot use wildcard (port==0), because add_port() will try to reuse the same port as a previous add_port(). */ svr1_port = grpc_pick_unused_port_or_die(); grpc_sockaddr_set_port((struct sockaddr *)&addr1, svr1_port); - GPR_ASSERT(grpc_tcp_server_add_port(s, (struct sockaddr *)&addr1, addr_len) == - svr1_port); + GPR_ASSERT(grpc_tcp_server_add_port(s, (struct sockaddr *)&addr1, addr_len, + &svr_port) == GRPC_ERROR_NONE && + svr_port == svr1_port); /* Bad port_index. */ GPR_ASSERT(grpc_tcp_server_port_fd_count(s, 2) == 0); @@ -305,7 +317,8 @@ static void test_connect(unsigned n) { grpc_exec_ctx_finish(&exec_ctx); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/iomgr/timer_list_test.c b/test/core/iomgr/timer_list_test.c index 2e0f5c8701..be8988ab75 100644 --- a/test/core/iomgr/timer_list_test.c +++ b/test/core/iomgr/timer_list_test.c @@ -42,8 +42,8 @@ static int cb_called[MAX_CB][2]; -static void cb(grpc_exec_ctx *exec_ctx, void *arg, bool success) { - cb_called[(intptr_t)arg][success]++; +static void cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { + cb_called[(intptr_t)arg][error == GRPC_ERROR_NONE]++; } static void add_test(void) { diff --git a/test/core/iomgr/workqueue_test.c b/test/core/iomgr/workqueue_test.c index 874e696fc2..2818e55b45 100644 --- a/test/core/iomgr/workqueue_test.c +++ b/test/core/iomgr/workqueue_test.c @@ -42,8 +42,8 @@ static gpr_mu *g_mu; static grpc_pollset *g_pollset; -static void must_succeed(grpc_exec_ctx *exec_ctx, void *p, bool success) { - GPR_ASSERT(success == 1); +static void must_succeed(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) { + GPR_ASSERT(error == GRPC_ERROR_NONE); gpr_mu_lock(g_mu); *(int *)p = 1; grpc_pollset_kick(g_pollset, NULL); @@ -68,7 +68,7 @@ static void test_add_closure(void) { grpc_pollset_worker *worker = NULL; grpc_closure_init(&c, must_succeed, &done); - grpc_workqueue_push(wq, &c, 1); + grpc_workqueue_push(wq, &c, GRPC_ERROR_NONE); grpc_workqueue_add_to_pollset(&exec_ctx, wq, g_pollset); gpr_mu_lock(g_mu); @@ -92,7 +92,7 @@ static void test_flush(void) { grpc_pollset_worker *worker = NULL; grpc_closure_init(&c, must_succeed, &done); - grpc_exec_ctx_enqueue(&exec_ctx, &c, true, NULL); + grpc_exec_ctx_push(&exec_ctx, &c, GRPC_ERROR_NONE, NULL); grpc_workqueue_flush(&exec_ctx, wq); grpc_workqueue_add_to_pollset(&exec_ctx, wq, g_pollset); @@ -108,7 +108,8 @@ static void test_flush(void) { grpc_exec_ctx_finish(&exec_ctx); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c index 31e06372b9..eaa3563bec 100644 --- a/test/core/security/credentials_test.c +++ b/test/core/security/credentials_test.c @@ -549,37 +549,37 @@ static void validate_compute_engine_http_request( static int compute_engine_httpcli_get_success_override( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = - http_response(200, valid_oauth2_json_response); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { validate_compute_engine_http_request(request); - on_response(exec_ctx, user_data, &response); + *response = http_response(200, valid_oauth2_json_response); + grpc_exec_ctx_push(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } static int compute_engine_httpcli_get_failure_override( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = http_response(403, "Not Authorized."); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { validate_compute_engine_http_request(request); - on_response(exec_ctx, user_data, &response); + *response = http_response(403, "Not Authorized."); + grpc_exec_ctx_push(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } static int httpcli_post_should_not_be_called( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, const char *body_bytes, size_t body_size, gpr_timespec deadline, - grpc_httpcli_response_cb on_response, void *user_data) { + grpc_closure *on_done, grpc_httpcli_response *response) { GPR_ASSERT("HTTP POST should not be called" == NULL); return 1; } -static int httpcli_get_should_not_be_called( - grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { +static int httpcli_get_should_not_be_called(grpc_exec_ctx *exec_ctx, + const grpc_httpcli_request *request, + gpr_timespec deadline, + grpc_closure *on_done, + grpc_httpcli_response *response) { GPR_ASSERT("HTTP GET should not be called" == NULL); return 1; } @@ -653,21 +653,20 @@ static void validate_refresh_token_http_request( static int refresh_token_httpcli_post_success( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, const char *body, size_t body_size, gpr_timespec deadline, - grpc_httpcli_response_cb on_response, void *user_data) { - grpc_httpcli_response response = - http_response(200, valid_oauth2_json_response); + grpc_closure *on_done, grpc_httpcli_response *response) { validate_refresh_token_http_request(request, body, body_size); - on_response(exec_ctx, user_data, &response); + *response = http_response(200, valid_oauth2_json_response); + grpc_exec_ctx_push(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } static int refresh_token_httpcli_post_failure( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, const char *body, size_t body_size, gpr_timespec deadline, - grpc_httpcli_response_cb on_response, void *user_data) { - grpc_httpcli_response response = http_response(403, "Not Authorized."); + grpc_closure *on_done, grpc_httpcli_response *response) { validate_refresh_token_http_request(request, body, body_size); - on_response(exec_ctx, user_data, &response); + *response = http_response(403, "Not Authorized."); + grpc_exec_ctx_push(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } @@ -899,17 +898,17 @@ static void test_google_default_creds_refresh_token(void) { static int default_creds_gce_detection_httpcli_get_success_override( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = http_response(200, ""); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { + *response = http_response(200, ""); grpc_http_header header; header.key = "Metadata-Flavor"; header.value = "Google"; - response.hdr_count = 1; - response.hdrs = &header; + response->hdr_count = 1; + response->hdrs = &header; GPR_ASSERT(strcmp(request->http.path, "/") == 0); GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0); - on_response(exec_ctx, user_data, &response); + grpc_exec_ctx_push(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } @@ -961,13 +960,13 @@ static void test_google_default_creds_gce(void) { static int default_creds_gce_detection_httpcli_get_failure_override( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { /* No magic header. */ - grpc_httpcli_response response = http_response(200, ""); GPR_ASSERT(strcmp(request->http.path, "/") == 0); GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0); - on_response(exec_ctx, user_data, &response); + *response = http_response(200, ""); + grpc_exec_ctx_push(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } diff --git a/test/core/security/jwt_verifier_test.c b/test/core/security/jwt_verifier_test.c index 50bf25171c..79a69278be 100644 --- a/test/core/security/jwt_verifier_test.c +++ b/test/core/security/jwt_verifier_test.c @@ -43,8 +43,8 @@ #include <grpc/support/string_util.h> #include "src/core/lib/http/httpcli.h" -#include "src/core/lib/security/util/b64.h" #include "src/core/lib/security/credentials/jwt/json_token.h" +#include "src/core/lib/security/util/b64.h" #include "test/core/util/test_config.h" /* This JSON key was generated with the GCE console and revoked immediately. @@ -278,24 +278,23 @@ static grpc_httpcli_response http_response(int status, char *body) { static int httpcli_post_should_not_be_called( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, const char *body_bytes, size_t body_size, gpr_timespec deadline, - grpc_httpcli_response_cb on_response, void *user_data) { + grpc_closure *on_done, grpc_httpcli_response *response) { GPR_ASSERT("HTTP POST should not be called" == NULL); return 1; } static int httpcli_get_google_keys_for_email( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = http_response(200, good_google_email_keys()); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { + *response = http_response(200, good_google_email_keys()); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0); GPR_ASSERT(strcmp(request->http.path, "/robot/v1/metadata/x509/" "777-abaslkan11hlb6nmim3bpspl31ud@developer." "gserviceaccount.com") == 0); - on_response(exec_ctx, user_data, &response); - gpr_free(response.body); + grpc_exec_ctx_push(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } @@ -333,14 +332,13 @@ static void test_jwt_verifier_google_email_issuer_success(void) { static int httpcli_get_custom_keys_for_email( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = http_response(200, gpr_strdup(good_jwk_set)); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { + *response = http_response(200, gpr_strdup(good_jwk_set)); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(strcmp(request->host, "keys.bar.com") == 0); GPR_ASSERT(strcmp(request->http.path, "/jwk/foo@bar.com") == 0); - on_response(exec_ctx, user_data, &response); - gpr_free(response.body); + grpc_exec_ctx_push(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } @@ -368,32 +366,28 @@ static void test_jwt_verifier_custom_email_issuer_success(void) { static int httpcli_get_jwk_set(grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, - grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = http_response(200, gpr_strdup(good_jwk_set)); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { + *response = http_response(200, gpr_strdup(good_jwk_set)); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0); GPR_ASSERT(strcmp(request->http.path, "/oauth2/v3/certs") == 0); - on_response(exec_ctx, user_data, &response); - gpr_free(response.body); + grpc_exec_ctx_push(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } static int httpcli_get_openid_config(grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, gpr_timespec deadline, - grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = - http_response(200, gpr_strdup(good_openid_config)); + grpc_closure *on_done, + grpc_httpcli_response *response) { + *response = http_response(200, gpr_strdup(good_openid_config)); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(strcmp(request->host, "accounts.google.com") == 0); GPR_ASSERT(strcmp(request->http.path, GRPC_OPENID_CONFIG_URL_SUFFIX) == 0); grpc_httpcli_set_override(httpcli_get_jwk_set, httpcli_post_should_not_be_called); - on_response(exec_ctx, user_data, &response); - gpr_free(response.body); + grpc_exec_ctx_push(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } @@ -429,14 +423,11 @@ static void on_verification_key_retrieval_error(void *user_data, static int httpcli_get_bad_json(grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, - grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = - http_response(200, gpr_strdup("{\"bad\": \"stuff\"}")); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { + *response = http_response(200, gpr_strdup("{\"bad\": \"stuff\"}")); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); - on_response(exec_ctx, user_data, &response); - gpr_free(response.body); + grpc_exec_ctx_push(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } @@ -535,10 +526,11 @@ static void test_jwt_verifier_bad_signature(void) { grpc_exec_ctx_finish(&exec_ctx); } -static int httpcli_get_should_not_be_called( - grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { +static int httpcli_get_should_not_be_called(grpc_exec_ctx *exec_ctx, + const grpc_httpcli_request *request, + gpr_timespec deadline, + grpc_closure *on_done, + grpc_httpcli_response *response) { GPR_ASSERT(0); return 1; } diff --git a/test/core/security/print_google_default_creds_token.c b/test/core/security/print_google_default_creds_token.c index 10a5e5224e..1b7036cf9e 100644 --- a/test/core/security/print_google_default_creds_token.c +++ b/test/core/security/print_google_default_creds_token.c @@ -42,8 +42,8 @@ #include <grpc/support/slice.h> #include <grpc/support/sync.h> -#include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/credentials/composite/composite_credentials.h" +#include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/support/string.h" typedef struct { diff --git a/test/core/security/secure_endpoint_test.c b/test/core/security/secure_endpoint_test.c index 6aba21a98c..1d2bf73bb1 100644 --- a/test/core/security/secure_endpoint_test.c +++ b/test/core/security/secure_endpoint_test.c @@ -139,7 +139,8 @@ static grpc_endpoint_test_config configs[] = { secure_endpoint_create_fixture_tcp_socketpair_leftover, clean_up}, }; -static void inc_call_ctr(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void inc_call_ctr(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { ++*(int *)arg; } @@ -172,7 +173,8 @@ static void test_leftover(grpc_endpoint_test_config config, size_t slice_size) { clean_up(); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index d62d5a93b1..10087780ef 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -90,8 +90,8 @@ static void test_cq_end_op(void) { cc = grpc_completion_queue_create(NULL); grpc_cq_begin_op(cc, tag); - grpc_cq_end_op(&exec_ctx, cc, tag, 1, do_nothing_end_completion, NULL, - &completion); + grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE, do_nothing_end_completion, + NULL, &completion); ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); @@ -149,8 +149,8 @@ static void test_pluck(void) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { grpc_cq_begin_op(cc, tags[i]); - grpc_cq_end_op(&exec_ctx, cc, tags[i], 1, do_nothing_end_completion, NULL, - &completions[i]); + grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, + do_nothing_end_completion, NULL, &completions[i]); } for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { @@ -161,8 +161,8 @@ static void test_pluck(void) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { grpc_cq_begin_op(cc, tags[i]); - grpc_cq_end_op(&exec_ctx, cc, tags[i], 1, do_nothing_end_completion, NULL, - &completions[i]); + grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, + do_nothing_end_completion, NULL, &completions[i]); } for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { @@ -234,8 +234,8 @@ static void test_too_many_plucks(void) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { grpc_cq_begin_op(cc, tags[i]); - grpc_cq_end_op(&exec_ctx, cc, tags[i], 1, do_nothing_end_completion, NULL, - &completions[i]); + grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, + do_nothing_end_completion, NULL, &completions[i]); } for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { @@ -288,8 +288,9 @@ static void producer_thread(void *arg) { gpr_log(GPR_INFO, "producer %d phase 2", opt->id); for (i = 0; i < TEST_THREAD_EVENTS; i++) { - grpc_cq_end_op(&exec_ctx, opt->cc, (void *)(intptr_t)1, 1, free_completion, - NULL, gpr_malloc(sizeof(grpc_cq_completion))); + grpc_cq_end_op(&exec_ctx, opt->cc, (void *)(intptr_t)1, GRPC_ERROR_NONE, + free_completion, NULL, + gpr_malloc(sizeof(grpc_cq_completion))); opt->events_triggered++; grpc_exec_ctx_finish(&exec_ctx); } diff --git a/test/core/surface/concurrent_connectivity_test.c b/test/core/surface/concurrent_connectivity_test.c index 28ddf58cc8..4bafd35803 100644 --- a/test/core/surface/concurrent_connectivity_test.c +++ b/test/core/surface/concurrent_connectivity_test.c @@ -111,10 +111,13 @@ void bad_server_thread(void *vargs) { struct sockaddr_storage addr; socklen_t addr_len = sizeof(addr); int port; - grpc_tcp_server *s = grpc_tcp_server_create(NULL); + grpc_tcp_server *s; + grpc_error *error = grpc_tcp_server_create(NULL, &s); + GPR_ASSERT(error == GRPC_ERROR_NONE); memset(&addr, 0, sizeof(addr)); addr.ss_family = AF_INET; - port = grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, addr_len); + error = + grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, addr_len, &port); GPR_ASSERT(port > 0); gpr_asprintf(&args->addr, "localhost:%d", port); @@ -143,7 +146,7 @@ void bad_server_thread(void *vargs) { } static void done_pollset_shutdown(grpc_exec_ctx *exec_ctx, void *pollset, - bool success) { + grpc_error *error) { grpc_pollset_destroy(pollset); gpr_free(pollset); } diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c index 12fa9de6cf..68f75bc2ab 100644 --- a/test/core/surface/lame_client_test.c +++ b/test/core/surface/lame_client_test.c @@ -47,13 +47,14 @@ grpc_closure transport_op_cb; static void *tag(intptr_t x) { return (void *)x; } -void verify_connectivity(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +void verify_connectivity(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { grpc_transport_op *op = arg; GPR_ASSERT(GRPC_CHANNEL_FATAL_FAILURE == *op->connectivity_state); - GPR_ASSERT(success); + GPR_ASSERT(error == GRPC_ERROR_NONE); } -void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, bool success) {} +void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {} void test_transport_op(grpc_channel *channel) { grpc_transport_op op; diff --git a/test/core/transport/connectivity_state_test.c b/test/core/transport/connectivity_state_test.c index 6bb7c3b06b..0b7a7013b3 100644 --- a/test/core/transport/connectivity_state_test.c +++ b/test/core/transport/connectivity_state_test.c @@ -43,14 +43,15 @@ int g_counter; -static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg, bool success) { - GPR_ASSERT(success); +static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { + GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(arg == THE_ARG); g_counter++; } -static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, bool success) { - GPR_ASSERT(!success); +static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { + GPR_ASSERT(error != GRPC_ERROR_NONE); GPR_ASSERT(arg == THE_ARG); g_counter++; } @@ -74,9 +75,12 @@ static void test_connectivity_state_name(void) { static void test_check(void) { grpc_connectivity_state_tracker tracker; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_error *error; gpr_log(GPR_DEBUG, "test_check"); grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_IDLE, "xxx"); - GPR_ASSERT(grpc_connectivity_state_check(&tracker) == GRPC_CHANNEL_IDLE); + GPR_ASSERT(grpc_connectivity_state_check(&tracker, &error) == + GRPC_CHANNEL_IDLE); + GPR_ASSERT(error == GRPC_ERROR_NONE); grpc_connectivity_state_destroy(&exec_ctx, &tracker); grpc_exec_ctx_finish(&exec_ctx); } diff --git a/test/core/util/test_tcp_server.c b/test/core/util/test_tcp_server.c index e39a95712c..fc89c41907 100644 --- a/test/core/util/test_tcp_server.c +++ b/test/core/util/test_tcp_server.c @@ -46,7 +46,7 @@ #include "test/core/util/port.h" static void on_server_destroyed(grpc_exec_ctx *exec_ctx, void *data, - bool success) { + grpc_error *error) { test_tcp_server *server = data; server->shutdown = 1; } @@ -72,9 +72,12 @@ void test_tcp_server_start(test_tcp_server *server, int port) { addr.sin_port = htons((uint16_t)port); memset(&addr.sin_addr, 0, sizeof(addr.sin_addr)); - server->tcp_server = grpc_tcp_server_create(&server->shutdown_complete); - port_added = - grpc_tcp_server_add_port(server->tcp_server, &addr, sizeof(addr)); + grpc_error *error = + grpc_tcp_server_create(&server->shutdown_complete, &server->tcp_server); + GPR_ASSERT(error == GRPC_ERROR_NONE); + error = grpc_tcp_server_add_port(server->tcp_server, &addr, sizeof(addr), + &port_added); + GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(port_added == port); grpc_tcp_server_start(&exec_ctx, server->tcp_server, &server->pollset, 1, @@ -97,7 +100,7 @@ void test_tcp_server_poll(test_tcp_server *server, int seconds) { grpc_exec_ctx_finish(&exec_ctx); } -static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, bool success) {} +static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {} void test_tcp_server_destroy(test_tcp_server *server) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; |