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/protocol/pair/pair_v1.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/protocol/pair') diff --git a/src/protocol/pair/pair_v1.c b/src/protocol/pair/pair_v1.c index ea8c1226..812617f1 100644 --- a/src/protocol/pair/pair_v1.c +++ b/src/protocol/pair/pair_v1.c @@ -224,7 +224,7 @@ pair1_pipe_recv_cb(void *arg) // If we bounced too many times, discard the message, but // keep getting more. - if (hdr >= s->ttl) { + if (hdr >= (unsigned) s->ttl) { nni_msg_free(msg); nni_pipe_recv(npipe, &p->aio_recv); return; @@ -309,7 +309,6 @@ pair1_pipe_getq_cb(void *arg) pair1_sock *s = p->psock; nni_msg * msg; uint32_t hops; - uint8_t * data; if (nni_aio_result(&p->aio_getq) != 0) { nni_pipe_stop(p->npipe); -- cgit v1.2.3-70-g09d2