mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
test: add family argument for http_connection_test_()
This commit is contained in:
parent
12c29b0f6e
commit
177b8a7ce8
@ -858,7 +858,8 @@ static void http_request_done(struct evhttp_request *, void *);
|
|||||||
static void http_request_empty_done(struct evhttp_request *, void *);
|
static void http_request_empty_done(struct evhttp_request *, void *);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
http_connection_test_(struct basic_test_data *data, int persistent, const char *address, struct evdns_base *dnsbase, int ipv6)
|
http_connection_test_(struct basic_test_data *data, int persistent,
|
||||||
|
const char *address, struct evdns_base *dnsbase, int ipv6, int family)
|
||||||
{
|
{
|
||||||
ev_uint16_t port = 0;
|
ev_uint16_t port = 0;
|
||||||
struct evhttp_connection *evcon = NULL;
|
struct evhttp_connection *evcon = NULL;
|
||||||
@ -870,6 +871,7 @@ http_connection_test_(struct basic_test_data *data, int persistent, const char *
|
|||||||
|
|
||||||
evcon = evhttp_connection_base_new(data->base, dnsbase, address, port);
|
evcon = evhttp_connection_base_new(data->base, dnsbase, address, port);
|
||||||
tt_assert(evcon);
|
tt_assert(evcon);
|
||||||
|
evhttp_connection_set_family(evcon, family);
|
||||||
|
|
||||||
tt_assert(evhttp_connection_get_base(evcon) == data->base);
|
tt_assert(evhttp_connection_get_base(evcon) == data->base);
|
||||||
|
|
||||||
@ -943,12 +945,12 @@ http_connection_test_(struct basic_test_data *data, int persistent, const char *
|
|||||||
static void
|
static void
|
||||||
http_connection_test(void *arg)
|
http_connection_test(void *arg)
|
||||||
{
|
{
|
||||||
http_connection_test_(arg, 0, "127.0.0.1", NULL, 0);
|
http_connection_test_(arg, 0, "127.0.0.1", NULL, 0, AF_UNSPEC);
|
||||||
}
|
}
|
||||||
static void
|
static void
|
||||||
http_persist_connection_test(void *arg)
|
http_persist_connection_test(void *arg)
|
||||||
{
|
{
|
||||||
http_connection_test_(arg, 1, "127.0.0.1", NULL, 0);
|
http_connection_test_(arg, 1, "127.0.0.1", NULL, 0, AF_UNSPEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct regress_dns_server_table search_table[] = {
|
static struct regress_dns_server_table search_table[] = {
|
||||||
@ -3656,7 +3658,8 @@ http_ipv6_for_domain_test(void *arg)
|
|||||||
evutil_snprintf(address, sizeof(address), "127.0.0.1:%d", portnum);
|
evutil_snprintf(address, sizeof(address), "127.0.0.1:%d", portnum);
|
||||||
evdns_base_nameserver_ip_add(dns_base, address);
|
evdns_base_nameserver_ip_add(dns_base, address);
|
||||||
|
|
||||||
http_connection_test_(arg, 0 /* not persistent */, "localhost", dns_base, 1 /* ipv6 */);
|
http_connection_test_(arg, 0 /* not persistent */, "localhost", dns_base,
|
||||||
|
1 /* ipv6 */, AF_UNSPEC);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (dns_base)
|
if (dns_base)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user