diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-22 18:16:24 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-22 18:25:33 -0800 |
| commit | cef6e70c0b3e92e36b6895e7d6e981b00c702f9b (patch) | |
| tree | 72db6da5a8a68418f6aa47f99c9e7e1c6eec0ce5 /src/core/dialer.c | |
| parent | 5836e6b0308d8562420256aebff29cc39f5d3344 (diff) | |
| download | nng-cef6e70c0b3e92e36b6895e7d6e981b00c702f9b.tar.gz nng-cef6e70c0b3e92e36b6895e7d6e981b00c702f9b.tar.bz2 nng-cef6e70c0b3e92e36b6895e7d6e981b00c702f9b.zip | |
Select transport using raw URL string.
This is done so that we can provide transport specific logic
for URL parsing later (we're going to want this for ZeroTier
for example.)
Diffstat (limited to 'src/core/dialer.c')
| -rw-r--r-- | src/core/dialer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/dialer.c b/src/core/dialer.c index 27020b37..3cd6620f 100644 --- a/src/core/dialer.c +++ b/src/core/dialer.c @@ -219,15 +219,15 @@ nni_dialer_create(nni_dialer **dp, nni_sock *s, const char *url_str) if ((d = NNI_ALLOC_STRUCT(d)) == NULL) { return (NNG_ENOMEM); } - if ((rv = nni_url_parse_inline(&d->d_url, url_str)) != 0) { + if (((tran = nni_sp_tran_find(url_str)) == NULL) || + (tran->tran_dialer == NULL)) { NNI_FREE_STRUCT(d); - return (rv); + return (NNG_ENOTSUP); } - if (((tran = nni_sp_tran_find(&d->d_url)) == NULL) || - (tran->tran_dialer == NULL)) { + if ((rv = nni_url_parse_inline(&d->d_url, url_str)) != 0) { nni_url_fini(&d->d_url); NNI_FREE_STRUCT(d); - return (NNG_ENOTSUP); + return (rv); } d->d_closed = false; d->d_data = NULL; |
