From 70d478f5d185e147ca8d3dcba4cbd8bb6da3719a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 17 May 2018 12:54:01 -0700 Subject: fixes #449 Want more flexible pipe events This changes the signature of nng_pipe_notify(), and the associated events. The documentation is updated to reflect this. We have also broken the lock up so that we don't hold the master socket lock for some of these things, which may have beneficial impact on performance. --- src/protocol/pair0/pair.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/protocol/pair0') diff --git a/src/protocol/pair0/pair.c b/src/protocol/pair0/pair.c index 2fb42df5..87900793 100644 --- a/src/protocol/pair0/pair.c +++ b/src/protocol/pair0/pair.c @@ -129,6 +129,11 @@ pair0_pipe_start(void *arg) pair0_pipe *p = arg; pair0_sock *s = p->psock; + if (nni_pipe_peer(p->npipe) != NNI_PROTO_PAIR_V0) { + // Peer protocol mismatch. + return (NNG_EPROTO); + } + nni_mtx_lock(&s->mtx); if (s->ppipe != NULL) { nni_mtx_unlock(&s->mtx); -- cgit v1.2.3-70-g09d2