Persistent HTTP(S) connections in opkg

Baptiste Jonglez baptiste at bitsofnetworks.org
Wed Dec 30 13:14:37 EST 2020


Following the discussion in http://lists.openwrt.org/pipermail/openwrt-devel/2020-November/032297.html

There are basically two options to implement persistent connections in opkg:

1) keep calling "wget", but pass the list of all packages to download at
   once.  On the host, wget already implements persistent connections.
   For devices, we would need to implement persistent connections in
   uclient-fetch (which is what "wget" actually points to).

2) switch to using a HTTP library (libuclient or libcurl), so that we can
   keep some TCP/TLS/HTTP context between downloads.

The first solution has a major drawback on devices: all packages would
need to be downloaded to /tmp, which will consume memory.  Currently, opkg
processes packages individually, so only one package at a time is stored
in /tmp.

The second solution adds a new library dependency, and we need to make
sure that it works both on the host and on targets.  Currently, we don't
make libuclient available to the host build system.  We would need to
build it for the host and link opkg statically against it (like it's done
for libubox).

Overall, I think the second solution makes more sense and is easier to integrate.
I would go with libuclient because we already have it available on
devices.

Any thoughts?

Thanks,
Baptiste
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20201230/cbc4a89f/attachment.sig>


More information about the openwrt-devel mailing list