diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-01-22 14:05:10 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-01-22 17:11:58 -0800 |
| commit | 3d075fad7496ec126c5087d1c36ab7a4af73ce16 (patch) | |
| tree | c5b5d6fe44eaa2996310683b5080de87160b9b41 /tests/httpclient.c | |
| parent | 5b1a3af7be4ae712868ae84b9a7d5a974d272b16 (diff) | |
| download | nng-3d075fad7496ec126c5087d1c36ab7a4af73ce16.tar.gz nng-3d075fad7496ec126c5087d1c36ab7a4af73ce16.tar.bz2 nng-3d075fad7496ec126c5087d1c36ab7a4af73ce16.zip | |
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.
Diffstat (limited to 'tests/httpclient.c')
| -rw-r--r-- | tests/httpclient.c | 5 |
1 files changed, 4 insertions, 1 deletions
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", { |
