From dbbee1a3ea7fbd26c528eb96ebe0dbfd7075e292 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 10 Aug 2017 18:14:27 -0700 Subject: Unify the msg API. This makes the operations that work on headers start with nni_msg_header or nng_msg_header. It also renames _trunc to _chop (same strlen as _trim), and renames prepend to insert. We add a shorthand for clearing message content, and make better use of the endian safe 32-bit accessors too. This also fixes a bug in inserting large headers into messages. A test suite for message handling is included. --- src/transport/inproc/inproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/transport/inproc') diff --git a/src/transport/inproc/inproc.c b/src/transport/inproc/inproc.c index 9cc43ad7..37d7153f 100644 --- a/src/transport/inproc/inproc.c +++ b/src/transport/inproc/inproc.c @@ -159,11 +159,11 @@ nni_inproc_pipe_send(void *arg, nni_aio *aio) // side won't know what to do otherwise. h = nni_msg_header(msg); l = nni_msg_header_len(msg); - if ((rv = nni_msg_prepend(msg, h, l)) != 0) { + if ((rv = nni_msg_insert(msg, h, l)) != 0) { nni_aio_finish(aio, rv, aio->a_count); return; } - nni_msg_trunc_header(msg, l); + nni_msg_header_chop(msg, l); nni_msgq_aio_put(pipe->wq, aio); } -- cgit v1.2.3-70-g09d2