diff options
| author | Garrett D'Amore <garrett@damore.org> | 2020-01-08 20:34:26 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2020-01-08 21:16:30 -0800 |
| commit | b21d7805523a407a14567017edbdef57ca81781f (patch) | |
| tree | e07f08bdc047ee4dfb057b670766e3de5bf2f981 /src/core/dialer.c | |
| parent | 8479b4c8861c77cfd9eb64e724615605bdd1cbcb (diff) | |
| download | nng-b21d7805523a407a14567017edbdef57ca81781f.tar.gz nng-b21d7805523a407a14567017edbdef57ca81781f.tar.bz2 nng-b21d7805523a407a14567017edbdef57ca81781f.zip | |
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
Diffstat (limited to 'src/core/dialer.c')
| -rw-r--r-- | src/core/dialer.c | 12 |
1 files changed, 6 insertions, 6 deletions
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); |
