Skip to content

Commit 7279874

Browse files
eivindj-nordicrlubos
authored andcommitted
net: new downloader
The new downloader is replacing the download_client library and is based on that. Internal restructuring: * Restructuring of socket functions and files. * Parse HTTP header line for line. This reduces the size requirement for the download client recv buffer. * Change TLS range override logic. * Use range requests for nRF91 TLS only, and when specified by app. API updates: * Let application provide client buffer. This allows for multiple download clients with different buffer sizes. * Add downloader_deinit() * Add downloader_stop() * Remove downloader_disconnect() * Changed signature of downloader_init(), downloader_start() and downloader_get() to take a URI. * Added downloader_get_with_host_and_path() for downloads where host and path are separate arguments to keep backwards compatibility. * The transports (http, coap) are now separated out of the download client with its own API. Future work: * Take uri as input param to fota_download library and use URI in other relevant libaries and structures. * Curent download client is deprecated and will be removed later. Signed-off-by: Eivind Jølsgard <[email protected]>
1 parent 5eb1bd1 commit 7279874

File tree

120 files changed

+6503
-468
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+6503
-468
lines changed

.github/test-spec.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
- "lib/nrf_modem_lib/**/*"
3939
- "lib/sms/**/*"
4040
- "subsys/dfu/dfu_target/**/*"
41-
- "subsys/net/lib/download_client/**/*"
41+
- "subsys/net/lib/downloader/**/*"
4242
- "subsys/net/lib/fota_download/**/*"
4343
- "subsys/net/lib/ftp_client/**/*"
4444
- "subsys/net/lib/nrf_cloud/**/*"
@@ -51,7 +51,7 @@
5151
- "lib/modem_info/**/*"
5252
- "lib/modem_key_mgmt/**/*"
5353
- "lib/date_time/**/*"
54-
- "subsys/net/lib/download_client/**/*"
54+
- "subsys/net/lib/downloader/**/*"
5555
- "subsys/net/lib/fota_download/**/*"
5656
- "subsys/net/lib/lwm2m_client_utils/**/*"
5757
- "subsys/dfu/dfu_target/**/*"
@@ -81,7 +81,7 @@
8181
- "include/modem/nrf_modem_lib.h"
8282
- "include/modem/pdn.h"
8383
- "include/modem/sms.h"
84-
- "include/net/download_client.h"
84+
- "include/net/downloader.h"
8585
- "include/secure_services.h"
8686
- "lib/at_host/**/*"
8787
- "lib/at_monitor/**/*"
@@ -102,7 +102,7 @@
102102
- "samples/cellular/pdn/**/*"
103103
- "samples/cellular/sms/**/*"
104104
- "samples/cellular/udp/**/*"
105-
- "subsys/net/lib/download_client/**/*"
105+
- "subsys/net/lib/downloader/**/*"
106106

107107
"CI-lwm2m-test":
108108
- "include/modem/lte_lc*.h"
@@ -114,8 +114,8 @@
114114
- "samples/cellular/lwm2m_carrier/**/*"
115115
- "include/modem/at_monitor.h"
116116
- "lib/at_monitor/**/*"
117-
- "include/net/download_client.h"
118-
- "subsys/net/lib/download_client/**/*"
117+
- "include/net/downloader.h"
118+
- "subsys/net/lib/downloader/**/*"
119119
- "lib/sms/**/*"
120120
- "include/modem/sms.h"
121121
- "lib/pdn/**/*"
@@ -147,7 +147,7 @@
147147
- "subsys/mgmt/**/*"
148148
- "subsys/pcd/*"
149149
- "subsys/net/lib/*fota*/**/*"
150-
- "subsys/net/lib/download_client/**/*"
150+
- "subsys/net/lib/downloader/**/*"
151151
- "tests/subsys/bootloader/**/*"
152152
- "tests/subsys/dfu/**/*"
153153

@@ -433,7 +433,7 @@
433433
- "include/modem/nrf_modem_lib.h"
434434
- "include/modem/pdn.h"
435435
- "include/modem/sms.h"
436-
- "include/net/download_client.h"
436+
- "include/net/downloader.h"
437437
- "include/net/fota_download.h"
438438
- "include/net/nrf_cloud.h"
439439
- "include/net/nrf_cloud_agnss.h"
@@ -457,7 +457,7 @@
457457
- "lib/sms/**/*"
458458
- "lib/supl/**/*"
459459
- "samples/cellular/modem_shell/**/*"
460-
- "subsys/net/lib/download_client/**/*"
460+
- "subsys/net/lib/downloader/**/*"
461461
- "subsys/net/lib/fota_download/**/*"
462462
- "subsys/net/lib/nrf_cloud/**/*"
463463
- "subsys/net/lib/rest_client/**/*"
@@ -509,7 +509,7 @@
509509
- "include/drivers/flash/**/*"
510510
- "include/flash_map_pm.h"
511511
- "include/modem/**/*"
512-
- "include/net/download_client.h"
512+
- "include/net/downloader.h"
513513
- "include/net/fota_download.h"
514514
- "include/net/nrf_cloud*"
515515
- "include/net/rest_client.h"
@@ -531,7 +531,7 @@
531531
- "subsys/bootloader/**/*"
532532
- "subsys/caf/**/*"
533533
- "subsys/dfu/**/*"
534-
- "subsys/net/lib/download_client/**/*"
534+
- "subsys/net/lib/downloader/**/*"
535535
- "subsys/net/lib/fota_download/**/*"
536536
- "subsys/net/lib/nrf_cloud/**/*"
537537
- "subsys/net/lib/nrf_provisioning/**/*"

CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@
167167
/doc/nrf/libraries/networking/azure_*.rst @nrfconnect/ncs-cia-doc
168168
/doc/nrf/libraries/networking/coap_utils.rst @nrfconnect/ncs-terahertz-doc
169169
/doc/nrf/libraries/networking/download_client.rst @nrfconnect/ncs-modem-doc
170+
/doc/nrf/libraries/networking/downloader.rst @nrfconnect/ncs-modem-doc
170171
/doc/nrf/libraries/networking/fota_download.rst @nrfconnect/ncs-pluto-doc
171172
/doc/nrf/libraries/networking/ftp_client.rst @nrfconnect/ncs-iot-oulu-tampere-doc
172173
/doc/nrf/libraries/networking/icalendar_parser.rst @nrfconnect/ncs-doc-leads
@@ -335,7 +336,10 @@
335336
/include/mgmt/ @nrfconnect/ncs-pluto
336337
/include/modem/ @nrfconnect/ncs-modem
337338
/include/mpsl/ @nrfconnect/ncs-dragoon
339+
/include/net/ @nrfconnect/ncs-co-networking
338340
/include/net/azure_* @nrfconnect/ncs-cia
341+
/include/net/download_client* @nrfconnect/ncs-modem
342+
/include/net/downloader* @nrfconnect/ncs-modem
339343
/include/net/nrf_cloud_* @nrfconnect/ncs-nrf-cloud
340344
/include/net/wifi_credentials.h @nrfconnect/ncs-cia
341345
/include/nfc/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-si-muffin
@@ -741,6 +745,8 @@
741745
/subsys/net/lib/mqtt_helper/ @nrfconnect/ncs-cia
742746
/subsys/net/lib/azure_* @nrfconnect/ncs-cia
743747
/subsys/net/lib/aws_* @nrfconnect/ncs-cia
748+
/subsys/net/lib/download_client* @nrfconnect/ncs-modem
749+
/subsys/net/lib/downloader/ @nrfconnect/ncs-modem
744750
/subsys/net/lib/ftp_client/ @nrfconnect/ncs-iot-oulu
745751
/subsys/net/lib/hostap_crypto/ @krish2718 @jukkar @vivekuppunda
746752
/subsys/net/lib/icalendar_parser/ @lats1980
@@ -850,6 +856,8 @@
850856
/tests/subsys/mpsl/ @nrfconnect/ncs-dragoon
851857
/tests/subsys/net/lib/aws_*/ @nrfconnect/ncs-cia
852858
/tests/subsys/net/lib/azure_iot_hub/ @nrfconnect/ncs-cia
859+
/tests/subsys/net/lib/downloader/ @nrfconnect/ncs-modem
860+
/tests/subsys/net/lib/download_client/ @nrfconnect/ncs-modem
853861
/tests/subsys/net/lib/fota_download/ @nrfconnect/ncs-pluto
854862
/tests/subsys/net/lib/lwm2m_*/ @nrfconnect/ncs-iot-oulu
855863
/tests/subsys/net/lib/mqtt_helper/ @nrfconnect/ncs-cia

applications/asset_tracker_v2/boards/native_sim.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ CONFIG_NET_CONFIG_MY_IPV4_GW="192.0.2.2"
103103
# FOTA
104104
CONFIG_FOTA_DOWNLOAD=n
105105
CONFIG_DFU_TARGET=n
106-
CONFIG_DOWNLOAD_CLIENT=n
107-
CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=n
106+
CONFIG_DOWNLOADER=n
108107

109108
# MCUBOOT
110109
CONFIG_BOOTLOADER_MCUBOOT=n

applications/asset_tracker_v2/doc/asset_tracker_v2_description.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ This application uses the following |NCS| libraries and drivers:
235235
* :ref:`lib_date_time`
236236
* :ref:`lte_lc_readme`
237237
* :ref:`modem_info_readme`
238-
* :ref:`lib_download_client`
238+
* :ref:`lib_downloader`
239239
* :ref:`lib_fota_download`
240240
* :ref:`caf_leds`
241241

applications/asset_tracker_v2/overlay-carrier.conf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ CONFIG_PDN=y
1818
# AT Monitor is used by PDN library
1919
CONFIG_AT_MONITOR=y
2020

21-
# Download client for DFU
22-
CONFIG_DOWNLOAD_CLIENT_MAX_FILENAME_SIZE=230
21+
# Downloader for DFU
22+
CONFIG_DOWNLOADER_MAX_FILENAME_SIZE=230
2323

2424
# Modem info
2525
CONFIG_MODEM_INFO_BUFFER_SIZE=512
@@ -36,3 +36,6 @@ CONFIG_DFU_TARGET=y
3636

3737
# Asserts
3838
CONFIG_ASSERT_VERBOSE=n
39+
40+
# IPv4 (IPv6 is enabled by default)
41+
CONFIG_NET_IPV4=y

applications/asset_tracker_v2/prj.conf

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,9 @@ CONFIG_FCB=y
6060
# FOTA
6161
CONFIG_FOTA_DOWNLOAD=y
6262
CONFIG_DFU_TARGET=y
63-
CONFIG_DOWNLOAD_CLIENT=y
64-
CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
65-
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
66-
CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=2300
67-
CONFIG_DOWNLOAD_CLIENT_MAX_HOSTNAME_SIZE=128
63+
CONFIG_DOWNLOADER=y
64+
CONFIG_DOWNLOADER_STACK_SIZE=4096
65+
CONFIG_DOWNLOADER_MAX_HOSTNAME_SIZE=128
6866

6967
# Flash - Used in FOTA, settings and storage for P-GPS.
7068
CONFIG_FLASH=y

applications/serial_lte_modem/doc/slm_description.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ This application uses the following |NCS| libraries:
684684
* :ref:`lib_ftp_client`
685685
* :ref:`sms_readme`
686686
* :ref:`lib_fota_download`
687-
* :ref:`lib_download_client`
687+
* :ref:`lib_downloader`
688688
* :ref:`lib_nrf_cloud`
689689
* :ref:`lib_nrf_cloud_agnss`
690690
* :ref:`lib_nrf_cloud_pgps`

applications/serial_lte_modem/overlay-carrier.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CONFIG_FP_HARDABI=y
1313
CONFIG_PDN=y
1414

1515
# Download client for DFU
16-
CONFIG_DOWNLOAD_CLIENT_MAX_FILENAME_SIZE=230
16+
CONFIG_DOWNLOADER_MAX_FILENAME_SIZE=230
1717

1818
# Modem info
1919
CONFIG_MODEM_INFO_BUFFER_SIZE=512
@@ -28,3 +28,6 @@ CONFIG_LWM2M_CARRIER_SETTINGS=y
2828

2929
# DFU target library
3030
CONFIG_DFU_TARGET=y
31+
32+
# IPv4 (IPv6 is enabled by default)
33+
CONFIG_NET_IPV4=y

applications/serial_lte_modem/prj.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ CONFIG_HTTP_PARSER_URL=y
6262
CONFIG_FOTA_DOWNLOAD=y
6363
CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y
6464
CONFIG_DFU_TARGET=y
65-
CONFIG_DOWNLOAD_CLIENT=y
66-
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
67-
CONFIG_DOWNLOAD_CLIENT_MAX_FILENAME_SIZE=2048
65+
CONFIG_DOWNLOADER=y
66+
CONFIG_DOWNLOADER_STACK_SIZE=4096
67+
CONFIG_DOWNLOADER_MAX_FILENAME_SIZE=2048
6868
CONFIG_BOOTLOADER_MCUBOOT=y
6969
CONFIG_IMG_MANAGER=y
7070

applications/serial_lte_modem/src/slm_at_fota.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
LOG_MODULE_REGISTER(slm_fota, CONFIG_SLM_LOG_LEVEL);
2727

2828
/* file_uri: scheme://hostname[:port]path[?parameters] */
29-
#define FILE_URI_MAX CONFIG_DOWNLOAD_CLIENT_MAX_FILENAME_SIZE
29+
#define FILE_URI_MAX CONFIG_DOWNLOADER_MAX_FILENAME_SIZE
3030
#define SCHEMA_HTTP "http"
3131
#define SCHEMA_HTTPS "https"
32-
#define URI_HOST_MAX CONFIG_DOWNLOAD_CLIENT_MAX_HOSTNAME_SIZE
32+
#define URI_HOST_MAX CONFIG_DOWNLOADER_MAX_HOSTNAME_SIZE
3333
#define URI_SCHEMA_MAX 8
3434
#define ERASE_POLL_TIME 2
3535

0 commit comments

Comments
 (0)