aboutsummaryrefslogtreecommitdiff
path: root/src/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol')
-rw-r--r--src/protocol/bus0/bus.c12
-rw-r--r--src/protocol/pair1/pair.c4
-rw-r--r--src/protocol/pair1/pair1_poly.c4
-rw-r--r--src/protocol/reqrep0/req.c2
-rw-r--r--src/protocol/reqrep0/xrep.c2
-rw-r--r--src/protocol/survey0/survey.c4
-rw-r--r--src/protocol/survey0/xrespond.c2
7 files changed, 13 insertions, 17 deletions
diff --git a/src/protocol/bus0/bus.c b/src/protocol/bus0/bus.c
index c409292e..9a610ac6 100644
--- a/src/protocol/bus0/bus.c
+++ b/src/protocol/bus0/bus.c
@@ -99,7 +99,8 @@ bus0_sock_init_raw(void *arg, nni_sock *nsock)
NNI_LIST_INIT(&s->pipes, bus0_pipe, node);
nni_mtx_init(&s->mtx);
- if ((rv = nni_aio_alloc(&s->aio_getq, bus0_sock_getq_cb_raw, s)) != 0) {
+ if ((rv = nni_aio_alloc(&s->aio_getq, bus0_sock_getq_cb_raw, s)) !=
+ 0) {
bus0_sock_fini(s);
return (rv);
}
@@ -257,13 +258,8 @@ bus0_pipe_recv_cb(void *arg)
}
msg = nni_aio_get_msg(p->aio_recv);
- if (s->raw &&
- (nni_msg_header_insert_u32(msg, nni_pipe_id(p->npipe)) != 0)) {
- // XXX: bump a nomemory stat
- nni_msg_free(msg);
- nni_aio_set_msg(p->aio_recv, NULL);
- nni_pipe_close(p->npipe);
- return;
+ if (s->raw) {
+ nni_msg_header_append_u32(msg, nni_pipe_id(p->npipe));
}
nni_msg_set_pipe(msg, nni_pipe_id(p->npipe));
diff --git a/src/protocol/pair1/pair.c b/src/protocol/pair1/pair.c
index b98975c3..00959a4c 100644
--- a/src/protocol/pair1/pair.c
+++ b/src/protocol/pair1/pair.c
@@ -281,7 +281,7 @@ pair1_pipe_recv_cb(void *arg)
}
// Store the hop count in the header.
- nni_msg_header_must_append_u32(msg, hdr);
+ nni_msg_header_append_u32(msg, hdr);
// Send the message up.
nni_aio_set_msg(&p->aio_put, msg);
@@ -345,7 +345,7 @@ pair1_pipe_get_cb(void *arg)
hops++;
// Insert the hops header.
- nni_msg_header_must_append_u32(msg, hops);
+ nni_msg_header_append_u32(msg, hops);
nni_aio_set_msg(&p->aio_send, msg);
nni_pipe_send(p->pipe, &p->aio_send);
diff --git a/src/protocol/pair1/pair1_poly.c b/src/protocol/pair1/pair1_poly.c
index 183c10da..950c60f7 100644
--- a/src/protocol/pair1/pair1_poly.c
+++ b/src/protocol/pair1/pair1_poly.c
@@ -280,7 +280,7 @@ pair1poly_pipe_recv_cb(void *arg)
}
// Store the hop count in the header.
- nni_msg_header_must_append_u32(msg, hdr);
+ nni_msg_header_append_u32(msg, hdr);
// Send the message up.
nni_aio_set_msg(&p->aio_put, msg);
@@ -361,7 +361,7 @@ pair1poly_pipe_get_cb(void *arg)
nni_msg_header_clear(msg);
// Insert the hops header.
- nni_msg_header_must_append_u32(msg, 1);
+ nni_msg_header_append_u32(msg, 1);
nni_aio_set_msg(&p->aio_send, msg);
nni_pipe_send(p->pipe, &p->aio_send);
diff --git a/src/protocol/reqrep0/req.c b/src/protocol/reqrep0/req.c
index fea95725..cb716941 100644
--- a/src/protocol/reqrep0/req.c
+++ b/src/protocol/reqrep0/req.c
@@ -667,7 +667,7 @@ req0_ctx_send(void *arg, nni_aio *aio)
}
ctx->request_id = (uint32_t) id;
nni_msg_header_clear(msg);
- nni_msg_header_must_append_u32(msg, ctx->request_id);
+ nni_msg_header_append_u32(msg, ctx->request_id);
// If no pipes are ready, and the request was a poll (no background
// schedule), then fail it. Should be NNG_ETIMEDOUT.
diff --git a/src/protocol/reqrep0/xrep.c b/src/protocol/reqrep0/xrep.c
index 901cecc4..0bce27ba 100644
--- a/src/protocol/reqrep0/xrep.c
+++ b/src/protocol/reqrep0/xrep.c
@@ -290,7 +290,7 @@ xrep0_pipe_recv_cb(void *arg)
nni_msg_set_pipe(msg, nni_pipe_id(p->pipe));
// Store the pipe id in the header, first thing.
- nni_msg_header_must_append_u32(msg, nni_pipe_id(p->pipe));
+ nni_msg_header_append_u32(msg, nni_pipe_id(p->pipe));
// Move backtrace from body to header
hops = 1;
diff --git a/src/protocol/survey0/survey.c b/src/protocol/survey0/survey.c
index 22677a17..e4cdca2c 100644
--- a/src/protocol/survey0/survey.c
+++ b/src/protocol/survey0/survey.c
@@ -244,7 +244,7 @@ surv0_ctx_send(void *arg, nni_aio *aio)
return;
}
nni_msg_header_clear(msg);
- nni_msg_header_must_append_u32(msg, (uint32_t) ctx->survey_id);
+ nni_msg_header_append_u32(msg, (uint32_t) ctx->survey_id);
// From this point, we're committed to success. Note that we send
// regardless of whether there are any pipes or not. If no pipes,
@@ -473,7 +473,7 @@ surv0_pipe_recv_cb(void *arg)
return;
}
id = nni_msg_trim_u32(msg);
- nni_msg_header_must_append_u32(msg, id);
+ nni_msg_header_append_u32(msg, id);
nni_mtx_lock(&sock->mtx);
// Best effort at delivery. Discard if no context or context is
diff --git a/src/protocol/survey0/xrespond.c b/src/protocol/survey0/xrespond.c
index c664f009..25aacc2c 100644
--- a/src/protocol/survey0/xrespond.c
+++ b/src/protocol/survey0/xrespond.c
@@ -284,7 +284,7 @@ xresp0_recv_cb(void *arg)
nni_msg_set_pipe(msg, p->id);
// Store the pipe id in the header, first thing.
- nni_msg_header_must_append_u32(msg, p->id);
+ nni_msg_header_append_u32(msg, p->id);
// Move backtrace from body to header
hops = 1;