From 13e380343c0eec96a723e7407d59fb7f5d20aba0 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 2 Jan 2017 17:35:49 -0800 Subject: Fixes to enable REQ/REP to operate. This uncovered a few problems - inproc was not moving the headers to the body on transmit, and the message chunk allocator had a serious bug leading to memory corruption. I've also added a message dumper, which turns out to be incredibly useful during debugging. --- src/protocol/reqrep/req.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/protocol/reqrep/req.c') diff --git a/src/protocol/reqrep/req.c b/src/protocol/reqrep/req.c index b8401107..9cfc6f54 100644 --- a/src/protocol/reqrep/req.c +++ b/src/protocol/reqrep/req.c @@ -308,7 +308,6 @@ nni_req_sendfilter(void *arg, nni_msg *msg) { nni_req_sock *req = arg; uint32_t id; - uint8_t buf[4]; nni_mtx_lock(&req->mx); if (req->raw) { @@ -329,7 +328,7 @@ nni_req_sendfilter(void *arg, nni_msg *msg) req->reqid[2] = (uint8_t) (id >> 8); req->reqid[3] = (uint8_t) (id); - if (nni_msg_append_header(msg, buf, 4) != 0) { + if (nni_msg_append_header(msg, req->reqid, 4) != 0) { // Should be ENOMEM. nni_mtx_unlock(&req->mx); nni_msg_free(msg); -- cgit v1.2.3-70-g09d2