aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/core/http/parser_test.c11
-rw-r--r--test/core/surface/concurrent_connectivity_test.c13
2 files changed, 22 insertions, 2 deletions
diff --git a/test/core/http/parser_test.c b/test/core/http/parser_test.c
index 10936754d9..7fdf60cc2b 100644
--- a/test/core/http/parser_test.c
+++ b/test/core/http/parser_test.c
@@ -238,6 +238,11 @@ int main(int argc, char **argv) {
"\r\n"
"hello world!",
200, "hello world!", "xyz", "abc", NULL);
+ test_succeeds(split_modes[i],
+ "HTTP/1.1 200 OK\n"
+ "\n"
+ "abc",
+ 200, "abc", NULL);
test_request_succeeds(split_modes[i],
"GET / HTTP/1.0\r\n"
"\r\n",
@@ -264,6 +269,11 @@ int main(int argc, char **argv) {
"xyz",
"GET", GRPC_HTTP_HTTP10, "/", "xyz", "xyz", "abc",
NULL);
+ test_request_succeeds(split_modes[i],
+ "GET / HTTP/1.0\n"
+ "\n"
+ "xyz",
+ "GET", GRPC_HTTP_HTTP10, "/", "xyz", NULL);
test_fails(split_modes[i], "HTTP/1.0\r\n");
test_fails(split_modes[i], "HTTP/1.2\r\n");
test_fails(split_modes[i], "HTTP/1.0 000 XYX\r\n");
@@ -281,6 +291,7 @@ int main(int argc, char **argv) {
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");
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/surface/concurrent_connectivity_test.c b/test/core/surface/concurrent_connectivity_test.c
index a2fdf73596..28ddf58cc8 100644
--- a/test/core/surface/concurrent_connectivity_test.c
+++ b/test/core/surface/concurrent_connectivity_test.c
@@ -142,6 +142,12 @@ void bad_server_thread(void *vargs) {
gpr_free(args->addr);
}
+static void done_pollset_shutdown(grpc_exec_ctx *exec_ctx, void *pollset,
+ bool success) {
+ grpc_pollset_destroy(pollset);
+ gpr_free(pollset);
+}
+
int main(int argc, char **argv) {
struct server_thread_args args;
memset(&args, 0, sizeof(args));
@@ -207,8 +213,11 @@ int main(int argc, char **argv) {
gpr_atm_rel_store(&args.stop, 1);
gpr_thd_join(server);
- grpc_pollset_destroy(args.pollset);
- gpr_free(args.pollset);
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_pollset_shutdown(
+ &exec_ctx, args.pollset,
+ grpc_closure_create(done_pollset_shutdown, args.pollset));
+ grpc_exec_ctx_finish(&exec_ctx);
grpc_shutdown();
return 0;