Skip to content

Commit

Permalink
net: downloader: fix coap url parsing
Browse files Browse the repository at this point in the history
CoAP URLs were parsed twice, leading to errors.
Now, the backend doesn't try to treat the file name as a URL anymore.

Signed-off-by: Maximilian Deubel <[email protected]>
  • Loading branch information
maxd-nordic committed Jan 20, 2025
1 parent 8b19d9d commit b7333a2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions subsys/net/lib/downloader/src/transports/coap.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,8 @@ static int coap_request_send(struct downloader *dl)
return err;
}

err = dl_parse_url_file(dl->file, file, sizeof(file));
if (err) {
LOG_ERR("Unable to parse url");
return err;
}
LOG_DBG("dl->file: %s", dl->file);
strncpy(file, dl->file, sizeof(file) - 1);

path_elem = strtok_r(file, COAP_PATH_ELEM_DELIM, &path_elem_saveptr);
do {
Expand Down Expand Up @@ -470,7 +467,7 @@ static int dl_coap_connect(struct downloader *dl)

/* run auth callback if set */
if (coap->auth_cb != NULL) {
coap->auth_cb(coap->sock.fd);
return coap->auth_cb(coap->sock.fd);
}

return err;
Expand Down

0 comments on commit b7333a2

Please sign in to comment.