Persistent HTTP(S) connections in opkg

Paul Spooren mail at aparcar.org
Thu Dec 31 14:48:00 EST 2020



On Mi, Dez 30, 2020 at 19:14, Baptiste Jonglez 
<baptiste at bitsofnetworks.org> wrote:
> 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?

I agree that the second solution sounds better! Thanks for tackling 
that. Based on your recent uclient-fetch patch I'm assuming you're 
already looking for a possible implementation?

> 
> Thanks,
> Baptiste
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel





More information about the openwrt-devel mailing list