mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-14 04:09:43 +03:00
split proxy uri to multiple options when exceeding 270 bytes
This commit is contained in:
1 parent
dc04333820
commit
a3f8fdaa59
1 file changed
+13
-5
+13
-5
@@ -634,12 +634,20 @@ cmdline_uri(char *arg) {
|
||||
int res;
|
||||
|
||||
if (proxy.length) { /* create Proxy-Uri from argument */
|
||||
size_t len = strlen(arg);
|
||||
while (len > 270) {
|
||||
coap_insert(&optlist,
|
||||
new_option_node(COAP_OPTION_PROXY_URI,
|
||||
270, (unsigned char *)arg),
|
||||
order_opts);
|
||||
len -= 270;
|
||||
arg += 270;
|
||||
}
|
||||
|
||||
coap_insert( &optlist,
|
||||
new_option_node(COAP_OPTION_PROXY_URI,
|
||||
strlen(arg), (unsigned char *)arg),
|
||||
order_opts);
|
||||
|
||||
coap_insert(&optlist,
|
||||
new_option_node(COAP_OPTION_PROXY_URI,
|
||||
len, (unsigned char *)arg),
|
||||
order_opts);
|
||||
} else { /* split arg into Uri-* options */
|
||||
coap_split_uri((unsigned char *)arg, strlen(arg), &uri );
|
||||
|
||||
|
||||
Reference in new issue
Block a user