diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-06 10:07:19 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-06 10:07:19 -0800 |
| commit | 59a4b69c7989ac4fef1645f929abfa91b884215b (patch) | |
| tree | 5ac708af2420fbc67b17ae25bfe253878012bea6 /src/protocol/pubsub/pub.c | |
| parent | a2801adffebb6a3679e41789b38ba925ed32832b (diff) | |
| download | nng-59a4b69c7989ac4fef1645f929abfa91b884215b.tar.gz nng-59a4b69c7989ac4fef1645f929abfa91b884215b.tar.bz2 nng-59a4b69c7989ac4fef1645f929abfa91b884215b.zip | |
Fixes for PUB/SUB.
This fixes several issues, and brings PUB/SUB to operational
correctness. Included is test code to verify that.
Diffstat (limited to 'src/protocol/pubsub/pub.c')
| -rw-r--r-- | src/protocol/pubsub/pub.c | 5 |
1 files changed, 2 insertions, 3 deletions
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); } } |
