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. --- tests/survey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/survey.c') diff --git a/tests/survey.c b/tests/survey.c index 6f85850f..2a757a98 100644 --- a/tests/survey.c +++ b/tests/survey.c @@ -123,7 +123,7 @@ Main({ msg = NULL; So(nng_recvmsg(resp, &msg, 0) == 0); CHECKSTR(msg, "abc"); - nng_msg_trunc(msg, 3); + nng_msg_chop(msg, 3); APPENDSTR(msg, "def"); So(nng_sendmsg(resp, msg, 0) == 0); msg = NULL; -- cgit v1.2.3-70-g09d2