summaryrefslogtreecommitdiff
path: root/test/regress_http.c
diff options
context:
space:
mode:
authorAzat Khuzhin <azat@libevent.org>2020-05-25 02:06:32 +0300
committerAzat Khuzhin <azat@libevent.org>2020-05-25 02:07:44 +0300
commite8c8951029a0a084dd73b27e6dc3b637a7c914db (patch)
tree19a416d821b4f241fb3005aa36fbb71f1a520918 /test/regress_http.c
parenteee26deed38fc7a6b6780b54628b007a2810efcd (diff)
downloadlibevent-e8c8951029a0a084dd73b27e6dc3b637a7c914db.tar.gz
test: http/autofree_connection cleanup
Diffstat (limited to 'test/regress_http.c')
-rw-r--r--test/regress_http.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/test/regress_http.c b/test/regress_http.c
index b7656cf8..6b664e05 100644
--- a/test/regress_http.c
+++ b/test/regress_http.c
@@ -1526,14 +1526,10 @@ http_autofree_connection_test(void *arg)
evhttp_add_header(evhttp_request_get_output_headers(req[i]), "Host", "somehost");
evhttp_add_header(evhttp_request_get_output_headers(req[i]), "Connection", "close");
evhttp_add_header(evhttp_request_get_output_headers(req[i]), "Empty", "itis");
- }
- /* We give ownership of the request to the connection */
- if (evhttp_make_request(evcon, req[0], EVHTTP_REQ_GET, "/test") == -1) {
- tt_abort_msg("couldn't make request");
- }
- if (evhttp_make_request(evcon, req[1], EVHTTP_REQ_GET, "/test") == -1) {
- tt_abort_msg("couldn't make request");
+ if (evhttp_make_request(evcon, req[i], EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("couldn't make request");
+ }
}
/*
@@ -1544,10 +1540,8 @@ http_autofree_connection_test(void *arg)
evhttp_connection_free_on_completion(evcon);
evcon = NULL;
- // req0
- event_base_dispatch(data->base);
- // req1
- event_base_dispatch(data->base);
+ for (i = 0; i < ARRAY_SIZE(req); ++i)
+ event_base_dispatch(data->base);
/* at this point, the http server should have no connection */
tt_assert(TAILQ_FIRST(&http->connections) == NULL);