From 0242199ddc95e8a683304897a3e1bc26c7e74c0f Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 18 Jan 2020 14:35:36 -0800 Subject: fixes #1142 raw mode use of message headers is inconsistent This correctly moves the entire protocol header for XREQ and XRESPONDENT protocols to the message header (not the body). This is where it should always have been. There is some small chance that applications which were coded to parse the header from the body will break. We don't think there are any such applications in use. --- src/protocol/reqrep0/req_test.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/protocol/reqrep0/req_test.c') diff --git a/src/protocol/reqrep0/req_test.c b/src/protocol/reqrep0/req_test.c index 8b57740d..75cff14a 100644 --- a/src/protocol/reqrep0/req_test.c +++ b/src/protocol/reqrep0/req_test.c @@ -17,10 +17,6 @@ #include #include -#ifndef NNI_PROTO -#define NNI_PROTO(x, y) (((x) << 4u) | (y)) -#endif - static void test_req_identity(void) { @@ -30,14 +26,14 @@ test_req_identity(void) TEST_NNG_PASS(nng_req0_open(&s)); TEST_NNG_PASS(nng_getopt_int(s, NNG_OPT_PROTO, &p)); - TEST_CHECK(p == NNI_PROTO(3u, 0u)); // 48 + TEST_CHECK(p == NNG_REQ0_SELF); TEST_NNG_PASS(nng_getopt_int(s, NNG_OPT_PEER, &p)); - TEST_CHECK(p == NNI_PROTO(3u, 1u)); // 49 + TEST_CHECK(p == NNG_REQ0_PEER); // 49 TEST_NNG_PASS(nng_getopt_string(s, NNG_OPT_PROTONAME, &n)); - TEST_CHECK(strcmp(n, "req") == 0); + TEST_CHECK(strcmp(n, NNG_REQ0_SELF_NAME) == 0); nng_strfree(n); TEST_NNG_PASS(nng_getopt_string(s, NNG_OPT_PEERNAME, &n)); - TEST_CHECK(strcmp(n, "rep") == 0); + TEST_CHECK(strcmp(n, NNG_REQ0_PEER_NAME) == 0); nng_strfree(n); TEST_NNG_PASS(nng_close(s)); } -- cgit v1.2.3-70-g09d2