modernize curl usage #246

Open
opened 2024-04-22 03:21:06 +00:00 by pennae · 3 comments
Owner

there's a bunch of ancient curl stuff that needs changed:

  1. checks for features that were added over a decade ago (https://gerrit.lix.systems/c/lix/+/853)
  2. usage of pipes and curl_multi_wait instead of curl_multi_poll (https://gerrit.lix.systems/c/lix/+/854)
  3. questionable header parsing #245 (https://gerrit.lix.systems/c/lix/+/856)
  4. hol blocking when a consumer of downloaded data is slow
  5. the whole checkInterrupted mess
  6. content decompression inline into curl wrapper
  7. highly questionable/absent raii
  8. s3 support is hacked into curl for some reason?
  9. maybe drop the curl_multi pretense and do curl_share in threads? (nope, won't share connections between threads)
there's a bunch of ancient curl stuff that needs changed: 1. [x] checks for features that were added over a decade ago (https://gerrit.lix.systems/c/lix/+/853) 1. [x] usage of pipes and `curl_multi_wait` instead of `curl_multi_poll` (https://gerrit.lix.systems/c/lix/+/854) 1. [x] questionable header parsing #245 (https://gerrit.lix.systems/c/lix/+/856) 1. [ ] hol blocking when a consumer of downloaded data is slow 1. [ ] the whole checkInterrupted mess 1. [ ] content decompression inline into curl wrapper 1. [ ] highly questionable/absent raii 1. [ ] s3 support is hacked into curl for some reason? 1. [x] ~~maybe drop the curl_multi pretense and do curl_share in threads?~~ (nope, won't share connections between threads)
Owner

We probably want to replace any of the existing S3 support with CURLOPT_AWS_SIGV4 - sending a PUT to an S3 endpoint with the encryption flags set is (iirc?) exactly what Nix does already.

Curl 7.75.0 has been released since February of 2021, which should be more than modern enough.

(It'd be nice if the HTTP binary cache stuff would also let us set authorization headers more arbitrarily; for e.g. Basic auth support.)

We probably want to replace any of the existing S3 support with [CURLOPT_AWS_SIGV4](https://curl.se/libcurl/c/CURLOPT_AWS_SIGV4.html) - sending a `PUT` to an S3 endpoint with the encryption flags set is (iirc?) exactly what Nix does already. Curl 7.75.0 has been released since February of 2021, which should be more than modern enough. (It'd be nice if the HTTP binary cache stuff would also let us set authorization headers more arbitrarily; for e.g. Basic auth support.)

Would it be in scope for this issue to also get progress reports in the CLI for large downloads, or should I open a different issue? It may be more UI related.

Right now it looks like stuff just hangs in curl.

Would it be in scope for this issue to also get progress reports in the CLI for large downloads, or should I open a different issue? It may be more UI related. Right now it looks like stuff just hangs in curl.
Author
Owner

please open a new issue; iwrc we have all the infra needed to give progress reports fort individual downloads but just hide all but the global progress meter for some reason

please open a new issue; iwrc we have all the infra needed to give progress reports fort individual downloads but just hide all but the global progress meter for some reason
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#246
No description provided.