From e88f07b434dbcfdb57435a14e1beadcdae3cef0d Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 24 Jan 2017 19:26:31 -0800 Subject: Add endpoint tuning of maxrcv size. Fix cmsg API. The CMSG handling was completely borked. This is fixed now, and we stash the SP header size (ugh) in the CMSG contents to match what nanomsg does. We now pass the cmsg validation test. We also fixed handling of certain endpoint-related options, so that endpoints can get options from the socket at initialization time. This required a minor change to the transport API for endpoints. Finally, we fixed a critical fault in the REP handling of RAW sockets, which caused them to always return NNG_ESTATE in all cases. It should now honor the actual socket option. --- src/transport/inproc/inproc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/transport/inproc') diff --git a/src/transport/inproc/inproc.c b/src/transport/inproc/inproc.c index d6b1ac74..66f076ea 100644 --- a/src/transport/inproc/inproc.c +++ b/src/transport/inproc/inproc.c @@ -189,7 +189,7 @@ nni_inproc_pipe_getopt(void *arg, int option, void *buf, size_t *szp) static int -nni_inproc_ep_init(void **epp, const char *url, uint16_t proto) +nni_inproc_ep_init(void **epp, const char *url, nni_sock *sock) { nni_inproc_ep *ep; int rv; @@ -207,7 +207,7 @@ nni_inproc_ep_init(void **epp, const char *url, uint16_t proto) ep->mode = NNI_INPROC_EP_IDLE; ep->closed = 0; - ep->proto = proto; + ep->proto = nni_sock_proto(sock); NNI_LIST_NODE_INIT(&ep->node); NNI_LIST_INIT(&ep->clients, nni_inproc_ep, node); @@ -291,8 +291,6 @@ nni_inproc_ep_connect(void *arg, void **pipep) return (NNG_ECONNREFUSED); } - // XXX check protocol peer validity... - ep->mode = NNI_INPROC_EP_DIAL; nni_list_append(&server->clients, ep); nni_cv_wake(&server->cv); -- cgit v1.2.3-70-g09d2