From 3d075fad7496ec126c5087d1c36ab7a4af73ce16 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 22 Jan 2018 14:05:10 -0800 Subject: fixes #219 transports should take URL structure instead of string address This eliminates a bunch of redundant URL parsing, using the common URL logic we already have in place. While here I fixed a problem with the TLS and WSS test suites that was failing on older Ubuntu -- apparently older versions of mbedTLS were unhappy if selecting OPTIONAL verification without a validate certificate chain. --- tests/httpclient.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/httpclient.c') diff --git a/tests/httpclient.c b/tests/httpclient.c index 76a3566b..b58dc81f 100644 --- a/tests/httpclient.c +++ b/tests/httpclient.c @@ -34,11 +34,13 @@ TestMain("HTTP Client", { nni_aio * iaio; nni_http_client *cli; nni_http * http; + nni_url * url; So(nng_aio_alloc(&aio, NULL, NULL) == 0); iaio = (nni_aio *) aio; - So(nni_http_client_init(&cli, "http://httpbin.org") == 0); + So(nni_url_parse(&url, "http://httpbin.org") == 0); + So(nni_http_client_init(&cli, url) == 0); nni_http_client_connect(cli, iaio); nng_aio_wait(aio); So(nng_aio_result(aio) == 0); @@ -47,6 +49,7 @@ TestMain("HTTP Client", { nni_http_client_fini(cli); nni_http_fini(http); nng_aio_free(aio); + nni_url_free(url); }); Convey("We can initiate a message", { -- cgit v1.2.3-70-g09d2