aboutsummaryrefslogtreecommitdiff
path: root/src/transport/inproc/inproc.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-01-22 14:05:10 -0800
committerGarrett D'Amore <garrett@damore.org>2018-01-22 17:11:58 -0800
commit3d075fad7496ec126c5087d1c36ab7a4af73ce16 (patch)
treec5b5d6fe44eaa2996310683b5080de87160b9b41 /src/transport/inproc/inproc.c
parent5b1a3af7be4ae712868ae84b9a7d5a974d272b16 (diff)
downloadnng-3d075fad7496ec126c5087d1c36ab7a4af73ce16.tar.gz
nng-3d075fad7496ec126c5087d1c36ab7a4af73ce16.tar.bz2
nng-3d075fad7496ec126c5087d1c36ab7a4af73ce16.zip
fixes #219 transports should take URL structure instead of string address
This eliminates a bunch of redundant URL parsing, using the common URL logic we already have in place. While here I fixed a problem with the TLS and WSS test suites that was failing on older Ubuntu -- apparently older versions of mbedTLS were unhappy if selecting OPTIONAL verification without a validate certificate chain.
Diffstat (limited to 'src/transport/inproc/inproc.c')
-rw-r--r--src/transport/inproc/inproc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/transport/inproc/inproc.c b/src/transport/inproc/inproc.c
index 5b52e80a..4cd1c97d 100644
--- a/src/transport/inproc/inproc.c
+++ b/src/transport/inproc/inproc.c
@@ -47,7 +47,7 @@ struct nni_inproc_pair {
};
struct nni_inproc_ep {
- char addr[NNG_MAXADDRLEN + 1];
+ const char * addr;
int mode;
nni_list_node node;
uint16_t proto;
@@ -190,13 +190,10 @@ nni_inproc_pipe_get_addr(void *arg, void *buf, size_t *szp)
}
static int
-nni_inproc_ep_init(void **epp, const char *url, nni_sock *sock, int mode)
+nni_inproc_ep_init(void **epp, nni_url *url, nni_sock *sock, int mode)
{
nni_inproc_ep *ep;
- if (strlen(url) > NNG_MAXADDRLEN - 1) {
- return (NNG_EINVAL);
- }
if ((ep = NNI_ALLOC_STRUCT(ep)) == NULL) {
return (NNG_ENOMEM);
}
@@ -206,8 +203,8 @@ nni_inproc_ep_init(void **epp, const char *url, nni_sock *sock, int mode)
NNI_LIST_INIT(&ep->clients, nni_inproc_ep, node);
nni_aio_list_init(&ep->aios);
- (void) snprintf(ep->addr, sizeof(ep->addr), "%s", url);
- *epp = ep;
+ ep->addr = url->u_rawurl; // we match on the full URL.
+ *epp = ep;
return (0);
}