From: Stephan Bosch Date: Fri, 21 May 2021 11:16:54 +0000 (+0200) Subject: lib-http: test-http-payload - Switch ioloop implicitly using callback X-Git-Tag: 2.4.1~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=903d606b313b104023b72f89eb833d8bdc17f157;p=thirdparty%2Fdovecot%2Fcore.git lib-http: test-http-payload - Switch ioloop implicitly using callback --- diff --git a/src/lib-http/test-http-payload.c b/src/lib-http/test-http-payload.c index 56fa767aed..ada971dcd1 100644 --- a/src/lib-http/test-http-payload.c +++ b/src/lib-http/test-http-payload.c @@ -930,10 +930,12 @@ static void test_client_request_destroy(struct test_client_request *tcreq) test_client_request_unref(&tcreq); } -static void test_client_switch_ioloop(void) +static void test_client_switch_ioloop(struct ioloop *prev_ioloop ATTR_UNUSED) { struct test_client_request *tcreq; + e_debug(client_event, "switch ioloop"); + if (to_continue != NULL) to_continue = io_loop_move_timeout(&to_continue); if (to_client_progress != NULL) @@ -964,6 +966,8 @@ static void test_client_init(void) CLIENT_PROGRESS_TIMEOUT*1000, test_client_progress_timeout, NULL); } + + io_loop_add_switch_callback(test_client_switch_ioloop); } static void test_client_deinit(void) @@ -976,6 +980,7 @@ static void test_client_deinit(void) tset.parallel_clients = 1; + io_loop_remove_switch_callback(test_client_switch_ioloop); timeout_remove(&to_continue); timeout_remove(&to_client_progress); @@ -1623,14 +1628,12 @@ static void test_client_echo_continue(void *context ATTR_UNUSED) ioloop_nested = io_loop_create(); for (i = 0; i < tset.parallel_clients; i++) http_client_switch_ioloop(http_clients[i]); - test_client_switch_ioloop(); io_loop_run(ioloop_nested); io_loop_set_current(prev_ioloop); for (i = 0; i < tset.parallel_clients; i++) http_client_switch_ioloop(http_clients[i]); - test_client_switch_ioloop(); io_loop_set_current(ioloop_nested); io_loop_destroy(&ioloop_nested); ioloop_nested = NULL;