From 59a4b69c7989ac4fef1645f929abfa91b884215b Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 6 Jan 2017 10:07:19 -0800 Subject: Fixes for PUB/SUB. This fixes several issues, and brings PUB/SUB to operational correctness. Included is test code to verify that. --- src/protocol/pubsub/pub.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/protocol/pubsub/pub.c') diff --git a/src/protocol/pubsub/pub.c b/src/protocol/pubsub/pub.c index b1f91fe2..860c7c7d 100644 --- a/src/protocol/pubsub/pub.c +++ b/src/protocol/pubsub/pub.c @@ -121,7 +121,6 @@ nni_pub_pipe_add(void *arg) { nni_pub_pipe *pp = arg; nni_pub_sock *pub = pp->pub; - int rv; if (nni_pipe_peer(pp->pipe) != NNG_PROTO_SUB) { return (NNG_EPROTO); @@ -130,7 +129,7 @@ nni_pub_pipe_add(void *arg) nni_list_append(&pub->pipes, pp); nni_mtx_unlock(&pub->mx); - return (rv); + return (0); } @@ -173,7 +172,7 @@ nni_pub_broadcast(void *arg) } else { dup = msg; } - if ((rv = nni_msgq_tryput(pp->sendq, msg)) != 0) { + if ((rv = nni_msgq_tryput(pp->sendq, dup)) != 0) { nni_msg_free(dup); } } -- cgit v1.2.3-70-g09d2