Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HTTP support to SparseIndex #119

Merged
merged 5 commits into from
Jun 15, 2023

Conversation

Jake-Shadle
Copy link
Contributor

  • Disable rustfmt
  • Add CRATES_IO_HTTP_INDEX
  • Cleanup index initialization
  • Add HTTP support to SparseIndex

This adds support for creating HTTP requests and parsing HTTP responses for an HTTP sparse index via the http crate. This method follows the sans-io approach to allow the calling crate to decide what HTTP client it wants to use to send HTTP requests so that this crate is not tied to any particular HTTP client implementation, nor does it have to care if the user wants async or not I/O or whatever else.

This is behind the sparse-http feature gate but that can be removed if the feature is deemed acceptable by default since it is fairly lightweight, especially when compared to git.

This implementation leaves it up to the user to decompress gzip encoded server responses, but gzip decompression would be easy to add either behind an additional feature flag, or as part of the sparse-http feature.

Resolves: #87

@Jake-Shadle
Copy link
Contributor Author

Note this removes the separator parameter from crates_prefix in favor of unconditionally using / it is entirely pointless for how this crate is used as Windows/libgit has no issues understanding / or \ as equivalent path separators.

@kornelski
Copy link
Collaborator

Have you tested this on Windows?

I previously got bug reports about Windows actually caring about path separator char:
#93

@Jake-Shadle
Copy link
Contributor Author

Ehh I guess I'll revert that, that's annoying.

@kornelski kornelski merged commit cdc8fde into frewsxcv:master Jun 15, 2023
@kornelski
Copy link
Collaborator

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sparse registry support
2 participants