Range header issues
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 28/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- rust
- Ambito
- networking
Direzione di ricerca
Start with the Range header implementation and its Range::bytes and satisfiable_ranges entry points. Review the proposed ByteRangeSpec representation, iterator construction, collection-backed storage, and unknown-resource-size behavior; done means all four listed issues are addressed consistently.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The Range header is one of the least useful header types in this library. Most of these problems stem from the fact that it contains only a string HeaderValue, instead of a parsed representation of the Range.
-
The internal representation of range endpoints passed to
bytesand returned fromsatisfiable_rangesisBound<u64>. But this is a very poor fit, because it suggests in the return type thatBound::Excludedwould be a valid value to use in aRangeheader, when it is actually never possible for it to appear.headersshould re-introduce theByteRangeSpecenum to encode the three valid cases for theRangeheader. -
Range::bytesallows construction from a singleimpl RangeBounds<u64>.Rangeshould be extended to allow construction fromimpl Iterator<ByteRangeSpec>. -
The internal representation of a
Rangeis a string cloned from theHeaderValuepassed todecode. It should instead be a collection ofByteRanges, perhaps aSmallVec<[ByteRangeSpec; 1]>since the expected case is that there will only be one range (multipart ranges are generally uncommon).If you are constructing or parsing this header, it is expected that you are going to access the fields, so the extra memory overhead of doing so is explicitly necessary. And the type already clones the string header value! Doing the SmallVec optimization would reduce the number of allocations by 1 for the typical case.
-
satisfiable_rangesassumes the caller will know the size of the resource being fetched. It may not, in which case passingu64::MAXwill return nonsense results when a suffix range is parsed.
- Lingua principale
- Rust
- Stelle
- 200
- Fork
- 107
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hyperium/headers
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 78/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Link support Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
Tutte le issue di hyperium/headers
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BurntSushi/jiff#653 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ZcashFoundation/zeeder#106 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
oxidize-rb/rb-sys#807 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
todo:ticket
Difficoltà 2/5 1-2 giorni Idoneità per principianti 74/100