From b21d7805523a407a14567017edbdef57ca81781f Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 8 Jan 2020 20:34:26 -0800 Subject: fixes #1094 Consider in-lining task and aio This only does it for rep, but it also has changes that should increase the overall test coverage for the REP protocol --- src/core/dialer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/core/dialer.c') diff --git a/src/core/dialer.c b/src/core/dialer.c index e1178783..8a463452 100644 --- a/src/core/dialer.c +++ b/src/core/dialer.c @@ -60,8 +60,8 @@ nni_dialer_destroy(nni_dialer *d) nni_aio_stop(d->d_con_aio); nni_aio_stop(d->d_tmo_aio); - nni_aio_fini(d->d_con_aio); - nni_aio_fini(d->d_tmo_aio); + nni_aio_free(d->d_con_aio); + nni_aio_free(d->d_tmo_aio); if (d->d_data != NULL) { d->d_ops.d_fini(d->d_data); @@ -204,8 +204,8 @@ nni_dialer_create(nni_dialer **dp, nni_sock *s, const char *urlstr) nni_mtx_init(&d->d_mtx); dialer_stats_init(d); - if (((rv = nni_aio_init(&d->d_con_aio, dialer_connect_cb, d)) != 0) || - ((rv = nni_aio_init(&d->d_tmo_aio, dialer_timer_cb, d)) != 0) || + if (((rv = nni_aio_alloc(&d->d_con_aio, dialer_connect_cb, d)) != 0) || + ((rv = nni_aio_alloc(&d->d_tmo_aio, dialer_timer_cb, d)) != 0) || ((rv = d->d_ops.d_init(&d->d_data, url, d)) != 0) || ((rv = nni_idhash_alloc32(dialers, &d->d_id, d)) != 0) || ((rv = nni_sock_add_dialer(s, d)) != 0)) { @@ -382,7 +382,7 @@ nni_dialer_start(nni_dialer *d, int flags) if ((flags & NNG_FLAG_NONBLOCK) != 0) { aio = NULL; } else { - if ((rv = nni_aio_init(&aio, NULL, NULL)) != 0) { + if ((rv = nni_aio_alloc(&aio, NULL, NULL)) != 0) { nni_atomic_flag_reset(&d->d_started); return (rv); } @@ -397,7 +397,7 @@ nni_dialer_start(nni_dialer *d, int flags) if (aio != NULL) { nni_aio_wait(aio); rv = nni_aio_result(aio); - nni_aio_fini(aio); + nni_aio_free(aio); } return (rv); -- cgit v1.2.3-70-g09d2