Files
flatpak/common/flatpak-utils-http.c
Philip Withnall d6b10c26ef utils-http: Add transfer speed timeout for libcurl HTTP downloads
There was already a timeout set using `CURLOPT_CONNECTTIMEOUT`, but that
only affects the initial connection. Once a HTTP connection is
established, the timeout is ineffective.

That means that once a HTTP connection is established, there is no bound
on the length of time a download can take. Sometimes, downloads drop to
very low speeds (for Networking Reasons) and we need a way to give up on
a download if that happens.

So, set a low speed limit of 10KB/s for 60s. If a curl download goes
more slowly than this, it will be considered timed out, and the
`CURLE_OPERATION_TIMEDOUT` code path will be taken.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: https://github.com/flatpak/flatpak/issues/5519
2023-09-15 12:36:25 +01:00

47 KiB