From ec72893af877d42deae677361e7b01f3afdc3297 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Fri, 23 Jul 2010 18:20:03 +0200 Subject: [PATCH] do not include authority in request include scheme only if not default --- examples/client.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/client.c b/examples/client.c index ef0ed22e..0f8d88b2 100644 --- a/examples/client.c +++ b/examples/client.c @@ -418,16 +418,18 @@ void cmdline_uri(char *arg) { coap_split_uri((unsigned char *)arg, &uri ); - if (uri.scheme.length) + if (uri.scheme.length && + (uri.scheme.length != strlen(COAP_DEFAULT_SCHEME) + || memcmp(uri.scheme.s, COAP_DEFAULT_SCHEME, uri.scheme.length))) coap_insert( &optlist, new_option_node(COAP_OPTION_URI_SCHEME, uri.scheme.length, uri.scheme.s), - order_opts); - + order_opts); +#if 0 /* need authority only for proxy requests */ if (uri.na.length) coap_insert( &optlist, new_option_node(COAP_OPTION_URI_AUTHORITY, uri.na.length, uri.na.s), - order_opts); - + order_opts); +#endif if (uri.path.length) coap_insert( &optlist, new_option_node(COAP_OPTION_URI_PATH, uri.path.length, uri.path.s),