diff options
| author | Garrett D'Amore <garrett@damore.org> | 2020-11-15 17:47:54 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2020-11-15 17:47:54 -0800 |
| commit | 249932f3a208260f6b9c99d778b22d51cfabe87b (patch) | |
| tree | 4fd4826127e9c225d5232c39d4ae1db89b539689 /src/supplemental/http/http_client.c | |
| parent | eb328da56c3fc7167b536dcb206df0abb0f4a9b9 (diff) | |
| download | nng-249932f3a208260f6b9c99d778b22d51cfabe87b.tar.gz nng-249932f3a208260f6b9c99d778b22d51cfabe87b.tar.bz2 nng-249932f3a208260f6b9c99d778b22d51cfabe87b.zip | |
fixes #1071 tran_chkopt can be cleaned up
This is a sweeping cleanup of the transport logic around options,
and also harmonizes the names used when setting or getting options.
Additionally, legacy methods are now moved into a separate file and
can be elided via CMake or a preprocessor define.
Fundamentally, the ability to set to transport options via the socket
is deprecated; there are numerous problems with this and my earlier
approaches to deal with this have been somewhat misguided. Further
these approaches will not work with future protocol work that is
planned (were some options need to be negotiated with peers at the
time of connection establishment.)
Documentation has been updated to reflect this. The test suites still
make rather broad use of the older APIs, and will be converted later.
Diffstat (limited to 'src/supplemental/http/http_client.c')
| -rw-r--r-- | src/supplemental/http/http_client.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/supplemental/http/http_client.c b/src/supplemental/http/http_client.c index 68f0f61c..c420e1ff 100644 --- a/src/supplemental/http/http_client.c +++ b/src/supplemental/http/http_client.c @@ -142,7 +142,7 @@ int nni_http_client_set_tls(nni_http_client *c, nng_tls_config *tls) { int rv; - rv = nni_stream_dialer_setx(c->dialer, NNG_OPT_TLS_CONFIG, &tls, + rv = nni_stream_dialer_set(c->dialer, NNG_OPT_TLS_CONFIG, &tls, sizeof(tls), NNI_TYPE_POINTER); return (rv); } @@ -152,24 +152,24 @@ nni_http_client_get_tls(nni_http_client *c, nng_tls_config **tlsp) { size_t sz = sizeof(*tlsp); int rv; - rv = nni_stream_dialer_getx( + rv = nni_stream_dialer_get( c->dialer, NNG_OPT_TLS_CONFIG, tlsp, &sz, NNI_TYPE_POINTER); return (rv); } int -nni_http_client_setx(nni_http_client *c, const char *name, const void *buf, +nni_http_client_set(nni_http_client *c, const char *name, const void *buf, size_t sz, nni_type t) { // We have no local options, but we just pass them straight through. - return (nni_stream_dialer_setx(c->dialer, name, buf, sz, t)); + return (nni_stream_dialer_set(c->dialer, name, buf, sz, t)); } int -nni_http_client_getx( +nni_http_client_get( nni_http_client *c, const char *name, void *buf, size_t *szp, nni_type t) { - return (nni_stream_dialer_getx(c->dialer, name, buf, szp, t)); + return (nni_stream_dialer_get(c->dialer, name, buf, szp, t)); } static void |
