From 3b73756a5e5d075adfd03f5c49014094428d818f Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 24 Dec 2016 15:54:44 -0800 Subject: 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. --- src/nng.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/nng.c') diff --git a/src/nng.c b/src/nng.c index 5a0acaac..a55b210f 100644 --- a/src/nng.c +++ b/src/nng.c @@ -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)); +} -- cgit v1.2.3-70-g09d2