From 123e1439a284716c651eca037b95ba997e6c30db Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 27 Dec 2016 20:46:32 -0800 Subject: Send and receive now work. This fixes a few core issues, and improves readability for the message queue code as well. inproc delivery of messages works now. --- src/core/socket.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/core/socket.c') diff --git a/src/core/socket.c b/src/core/socket.c index 91c3c03e..aabcab7c 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -61,7 +61,8 @@ nni_reaper(void *arg) // If pipe was a connected (dialer) pipe, // then let the endpoint know so it can try to // reestablish the connection. - if ((ep = pipe->p_ep) != NULL) { + if (((ep = pipe->p_ep) != NULL) && + ((ep->ep_pipe == pipe))) { ep->ep_pipe = NULL; pipe->p_ep = NULL; nni_mutex_enter(&ep->ep_mx); @@ -318,7 +319,9 @@ nni_socket_recvmsg(nni_socket *sock, nni_msg **msgp, nni_time expire) if (rv != 0) { return (rv); } - msg = sock->s_ops.proto_recv_filter(sock->s_data, msg); + if (sock->s_ops.proto_recv_filter != NULL) { + msg = sock->s_ops.proto_recv_filter(sock->s_data, msg); + } if (msg != NULL) { break; } -- cgit v1.2.3-70-g09d2