diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/aio.c | 2 | ||||
| -rw-r--r-- | src/core/defs.h | 38 | ||||
| -rw-r--r-- | src/core/pipe.c | 2 | ||||
| -rw-r--r-- | src/core/platform.h | 4 | ||||
| -rw-r--r-- | src/core/url.c | 3 |
5 files changed, 28 insertions, 21 deletions
diff --git a/src/core/aio.c b/src/core/aio.c index 4c4c78b6..76ca7726 100644 --- a/src/core/aio.c +++ b/src/core/aio.c @@ -499,7 +499,7 @@ nni_aio_finish_sync(nni_aio *aio, nng_err result, size_t count) void nni_aio_finish_error(nni_aio *aio, nng_err result) { - nni_aio_finish_impl(aio, result, NNG_OK, NULL, false); + nni_aio_finish_impl(aio, result, 0, NULL, false); } void diff --git a/src/core/defs.h b/src/core/defs.h index 419f5ba7..432c0be7 100644 --- a/src/core/defs.h +++ b/src/core/defs.h @@ -151,25 +151,25 @@ typedef void (*nni_cb)(void *); (ptr)[0] = (uint8_t) ((uint64_t) (u)); \ } while (0) -#define NNI_GET16LE(ptr, v) \ - v = (((uint16_t) ((uint8_t) (ptr)[1])) << 8u) + \ - (((uint16_t) (uint8_t) (ptr)[0])) - -#define NNI_GET32LE(ptr, v) \ - v = (((uint32_t) ((uint8_t) (ptr)[3])) << 24u) + \ - (((uint32_t) ((uint8_t) (ptr)[2])) << 16u) + \ - (((uint32_t) ((uint8_t) (ptr)[1])) << 8u) + \ - (((uint32_t) (uint8_t) (ptr)[0])) - -#define NNI_GET64LE(ptr, v) \ - v = (((uint64_t) ((uint8_t) (ptr)[7])) << 56u) + \ - (((uint64_t) ((uint8_t) (ptr)[6])) << 48u) + \ - (((uint64_t) ((uint8_t) (ptr)[5])) << 40u) + \ - (((uint64_t) ((uint8_t) (ptr)[4])) << 32u) + \ - (((uint64_t) ((uint8_t) (ptr)[3])) << 24u) + \ - (((uint64_t) ((uint8_t) (ptr)[2])) << 16u) + \ - (((uint64_t) ((uint8_t) (ptr)[1])) << 8u) + \ - (((uint64_t) (uint8_t) (ptr)[0])) +#define NNI_GET16LE(ptr, v) \ + v = (((uint16_t) (((uint8_t *) (ptr))[1])) << 8u) + \ + ((uint16_t) ((uint8_t *) (ptr))[0]) + +#define NNI_GET32LE(ptr, v) \ + v = (((uint32_t) (((uint8_t *) (ptr))[3])) << 24u) + \ + (((uint32_t) (((uint8_t *) (ptr))[2])) << 16u) + \ + (((uint32_t) (((uint8_t *) (ptr))[1])) << 8u) + \ + (((uint32_t) ((uint8_t *) (ptr))[0])) + +#define NNI_GET64LE(ptr, v) \ + v = (((uint64_t) (((uint8_t *) (ptr))[7])) << 56u) + \ + (((uint64_t) (((uint8_t *) (ptr))[6])) << 48u) + \ + (((uint64_t) (((uint8_t *) (ptr))[5])) << 40u) + \ + (((uint64_t) (((uint8_t *) (ptr))[4])) << 32u) + \ + (((uint64_t) (((uint8_t *) (ptr))[3])) << 24u) + \ + (((uint64_t) (((uint8_t *) (ptr))[2])) << 16u) + \ + (((uint64_t) (((uint8_t *) (ptr))[1])) << 8u) + \ + (((uint64_t) ((uint8_t *) (ptr))[0])) // This increments a pointer a fixed number of byte cells. #define NNI_INCPTR(ptr, n) ((ptr) = (void *) ((char *) (ptr) + (n))) diff --git a/src/core/pipe.c b/src/core/pipe.c index c57a8d43..5ce85420 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -250,7 +250,7 @@ pipe_create(nni_pipe **pp, nni_sock *sock, nni_sp_tran *tran, nni_dialer *d, size_t sz; sz = NNI_ALIGN_UP(sizeof(*p)) + NNI_ALIGN_UP(pops->pipe_size) + - NNI_ALIGN_UP(tops->p_size); + NNI_ALIGN_UP(tops->p_size()); if ((p = nni_zalloc(sz)) == NULL) { return (NNG_ENOMEM); diff --git a/src/core/platform.h b/src/core/platform.h index a13ae9f2..cdb0d887 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -359,6 +359,10 @@ typedef struct nni_plat_udp nni_plat_udp; // aio's a_pipe. extern int nni_plat_udp_open(nni_plat_udp **, const nni_sockaddr *); +// nni_plat_udp_stop stops I/O on the socket, but does not close it +// or free the underlying data. May block for callbacks to complete. +extern void nni_plat_udp_stop(nni_plat_udp *); + // nni_plat_udp_close closes the underlying UDP socket. extern void nni_plat_udp_close(nni_plat_udp *); diff --git a/src/core/url.c b/src/core/url.c index 9db92992..fb13ee59 100644 --- a/src/core/url.c +++ b/src/core/url.c @@ -273,6 +273,9 @@ static const char *nni_schemes[] = { "udp", "udp4", "udp6", + "dtls", + "dtls4", + "dtls6", // we don't support these "file", "mailto", |
