From 8157d0452f435ad198f3a56ca1afa94ceaf3a607 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Fri, 28 Jun 2024 10:00:27 +0100 Subject: [PATCH] coap-client.c: Add in correct Uri-Host / Uri-Port for proxy --- examples/coap-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/coap-client.c b/examples/coap-client.c index 5c9b919a9e..3fdc121dd0 100644 --- a/examples/coap-client.c +++ b/examples/coap-client.c @@ -511,7 +511,7 @@ usage(const char *program, const char *version) { "\t\t[-T token] [-U] [-V num] [-X size]\n" "\t\t[[-h match_hint_file] [-k key] [-u user]]\n" "\t\t[[-c certfile] [-j keyfile] [-n] [-C cafile]\n" - "\t\t[-J pkcs11_pin] [-M raw_pk] [-R trust_casfile]\n" + "\t\t[-J pkcs11_pin] [-M raw_pk] [-R trust_casfile]] URI\n" "\tURI can be an absolute URI or a URI prefixed with scheme and host\n\n" "General Options\n" "\t-a addr\t\tThe local interface address to use\n" @@ -1928,7 +1928,7 @@ main(int argc, char **argv) { coap_session_init_token(session, the_token.length, the_token.s); /* Convert provided uri into CoAP options */ - if (!coap_uri_into_optlist(&uri, !uri_host_option && !proxy.host.length ? + if (!coap_uri_into_optlist(proxy.host.length ? &proxy : &uri, !uri_host_option ? &dst : NULL, &optlist, create_uri_opts)) { coap_log_err("Failed to create options for URI\n");