From 1d650869f32c56f6d49d898c38f7525191a60bd1 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 4 Jan 2017 02:10:13 -0800 Subject: Initial cut at TCP, totally untested beyond compilation. This also adds checks in the protocols to verify that pipe peers are of the proper protocol. --- src/protocol/pair/pair.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/protocol/pair') diff --git a/src/protocol/pair/pair.c b/src/protocol/pair/pair.c index cc906791..f86a9fa7 100644 --- a/src/protocol/pair/pair.c +++ b/src/protocol/pair/pair.c @@ -102,6 +102,9 @@ nni_pair_pipe_add(void *arg) nni_pair_pipe *pp = arg; nni_pair_sock *pair = pp->pair; + if (nni_pipe_peer(pp->pipe) != NNG_PROTO_PAIR) { + return (NNG_EPROTO); + } if (pair->pipe != NULL) { return (NNG_EBUSY); // Already have a peer, denied. } -- cgit v1.2.3-70-g09d2