diff options
| author | Garrett D'Amore <garrett@damore.org> | 2016-12-24 15:54:44 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2016-12-24 22:51:01 -0800 |
| commit | 3b73756a5e5d075adfd03f5c49014094428d818f (patch) | |
| tree | 7109b8952eeb03fd47c293c5d915b6a9f7d6433d /src/nng.c | |
| parent | 3bed9dca3a3ae5b226e3bf6aee3352d7665dbcc2 (diff) | |
| download | nng-3b73756a5e5d075adfd03f5c49014094428d818f.tar.gz nng-3b73756a5e5d075adfd03f5c49014094428d818f.tar.bz2 nng-3b73756a5e5d075adfd03f5c49014094428d818f.zip | |
Change in handling of extended info for messages.
Instead of supplying a pipe, and expecting that the info there would be included
we use nng_msg_getopt(). This will be enabled by the app asking for extended
information by setting an option, we don't copy the data for every app (most won't
care). This means we don't have to worry about reference counting the pipe for
the life of associated messages.
Diffstat (limited to 'src/nng.c')
| -rw-r--r-- | src/nng.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -70,6 +70,7 @@ nng_recvmsg(nng_socket *s, nng_msg **msgp, int flags) return (nni_socket_recvmsg(s, msgp, expire)); } + int nng_sendmsg(nng_socket *s, nng_msg *msg, int flags) { @@ -180,3 +181,15 @@ nng_msg_free(nng_msg *msg) nni_init(); return (nni_msg_free(msg)); } + + +int +nng_msg_getopt(nng_msg *msg, int opt, void *ptr, size_t *szp) +{ + int rv; + + if ((rv = nni_init()) != 0) { + return (rv); + } + return (nni_msg_getopt(msg, opt, ptr, szp)); +} |
