aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/http
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-08-04 12:58:16 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-08-04 12:58:16 -0700
commit714c7ec74aab3e99d5e577eddd3665cbcbca5dd6 (patch)
treeea77abfb8ce345ccd021ccfbb01526c7a6967b57 /test/core/http
parent32387b3a34918ae0cc16348e001c08f1d60ed121 (diff)
Plumbed read_buffer through and fixed leftover bytes problem.
Diffstat (limited to 'test/core/http')
-rw-r--r--test/core/http/parser_test.c10
-rw-r--r--test/core/http/request_fuzzer.c2
-rw-r--r--test/core/http/response_fuzzer.c2
3 files changed, 8 insertions, 6 deletions
diff --git a/test/core/http/parser_test.c b/test/core/http/parser_test.c
index d645d2879c..211690eff9 100644
--- a/test/core/http/parser_test.c
+++ b/test/core/http/parser_test.c
@@ -62,7 +62,8 @@ static void test_request_succeeds(grpc_slice_split_mode split_mode,
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]) == GRPC_ERROR_NONE);
+ GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i], NULL)
+ == GRPC_ERROR_NONE);
gpr_slice_unref(slices[i]);
}
GPR_ASSERT(grpc_http_parser_eof(&parser) == GRPC_ERROR_NONE);
@@ -118,7 +119,8 @@ static void test_succeeds(grpc_slice_split_mode split_mode, char *response_text,
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]) == GRPC_ERROR_NONE);
+ GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i], NULL)
+ == GRPC_ERROR_NONE);
gpr_slice_unref(slices[i]);
}
GPR_ASSERT(grpc_http_parser_eof(&parser) == GRPC_ERROR_NONE);
@@ -171,7 +173,7 @@ static void test_fails(grpc_slice_split_mode split_mode, char *response_text) {
for (i = 0; i < num_slices; i++) {
if (GRPC_ERROR_NONE == error) {
- error = grpc_http_parser_parse(&parser, slices[i]);
+ error = grpc_http_parser_parse(&parser, slices[i], NULL);
}
gpr_slice_unref(slices[i]);
}
@@ -204,7 +206,7 @@ static void test_request_fails(grpc_slice_split_mode split_mode,
for (i = 0; i < num_slices; i++) {
if (error == GRPC_ERROR_NONE) {
- error = grpc_http_parser_parse(&parser, slices[i]);
+ error = grpc_http_parser_parse(&parser, slices[i], NULL);
}
gpr_slice_unref(slices[i]);
}
diff --git a/test/core/http/request_fuzzer.c b/test/core/http/request_fuzzer.c
index 5941401867..bb6cb92c0c 100644
--- a/test/core/http/request_fuzzer.c
+++ b/test/core/http/request_fuzzer.c
@@ -48,7 +48,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
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_ERROR_UNREF(grpc_http_parser_parse(&parser, slice));
+ GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice, NULL));
GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser));
gpr_slice_unref(slice);
grpc_http_parser_destroy(&parser);
diff --git a/test/core/http/response_fuzzer.c b/test/core/http/response_fuzzer.c
index acde7c80a4..4393840484 100644
--- a/test/core/http/response_fuzzer.c
+++ b/test/core/http/response_fuzzer.c
@@ -47,7 +47,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
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_parse(&parser, slice, NULL));
GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser));
gpr_slice_unref(slice);
grpc_http_parser_destroy(&parser);