diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-08-20 10:45:27 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-08-21 07:18:31 -0700 |
| commit | 75adda86be49e6839e50443f0bae5875d9910897 (patch) | |
| tree | e29b8b449c863be01e5f02945940dc390b239462 /src/platform/posix/posix_udp.c | |
| parent | 6305e16ab64e42fd9791819d416a6e3534439b0b (diff) | |
| download | nng-75adda86be49e6839e50443f0bae5875d9910897.tar.gz nng-75adda86be49e6839e50443f0bae5875d9910897.tar.bz2 nng-75adda86be49e6839e50443f0bae5875d9910897.zip | |
fixes #41 Move DNS out of tcp transport
This moves the DNS related functionality into common code, and also
removes all the URL parsing stuff out of the platform specific code
and into the transports. Now the transports just take sockaddr's on
initialization. (We may want to move this until later.)
We also add UDP resolution as another separate API.
Diffstat (limited to 'src/platform/posix/posix_udp.c')
| -rw-r--r-- | src/platform/posix/posix_udp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/platform/posix/posix_udp.c b/src/platform/posix/posix_udp.c index 7bad2db4..59389a64 100644 --- a/src/platform/posix/posix_udp.c +++ b/src/platform/posix/posix_udp.c @@ -97,8 +97,8 @@ nni_posix_udp_dorecv(nni_plat_udp *udp) // We need to store the address information. // It is incumbent on the AIO submitter to supply // storage for the address. - if (aio->a_naddrs > 0) { - nni_posix_sockaddr2nn(&aio->a_addrs[0], (void *) &ss); + if (aio->a_addr != NULL) { + nni_posix_sockaddr2nn(aio->a_addr, (void *) &ss); } nni_aio_finish(aio, 0, rv); @@ -117,16 +117,16 @@ nni_posix_udp_dosend(nni_plat_udp *udp) int len; nni_list * q = &udp->udp_sendq; - // While we're able to recv, do so. + // While we're able to send, do so. while ((aio = nni_list_first(q)) != NULL) { nni_list_remove(q, aio); - if (aio->a_naddrs < 1) { - // No incoming address? + if (aio->a_addr == NULL) { + // No outgoing address? nni_aio_finish_error(aio, NNG_EADDRINVAL); return; } - len = nni_posix_nn2sockaddr(&ss, &aio->a_addrs[0]); + len = nni_posix_nn2sockaddr(&ss, aio->a_addr); if (len < 0) { nni_aio_finish_error(aio, NNG_EADDRINVAL); return; |
