From 5914e40c2ff7fcf346c90705785f3fb7650a9fdc Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 29 Jan 2018 13:27:52 -0800 Subject: Expose scatter/gather I/O vectors; we will use for HTTP API. --- tests/httpclient.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests/httpclient.c') diff --git a/tests/httpclient.c b/tests/httpclient.c index b58dc81f..f965cf2d 100644 --- a/tests/httpclient.c +++ b/tests/httpclient.c @@ -83,6 +83,7 @@ TestMain("HTTP Client", { void * data; const char *cstr; size_t sz; + nng_iov iov; cstr = nni_http_res_get_header( res, "Content-Length"); @@ -94,16 +95,16 @@ TestMain("HTTP Client", { So(data != NULL); Reset({ nni_free(data, sz); }); - iaio->a_niov = 1; - iaio->a_iov[0].iov_len = sz; - iaio->a_iov[0].iov_buf = data; + iov.iov_buf = data; + iov.iov_len = sz; + So(nng_aio_set_iov(aio, 1, &iov) == 0); - nni_aio_wait(iaio); + nng_aio_wait(aio); So(nng_aio_result(aio) == 0); nni_http_read_full(http, iaio); - nni_aio_wait(iaio); - So(nni_aio_result(iaio) == 0); + nng_aio_wait(aio); + So(nng_aio_result(aio) == 0); nni_sha1(data, sz, digest); So(memcmp(digest, utf8_sha1sum, 20) == 0); -- cgit v1.2.3-70-g09d2