about summary refs log tree commit diff
path: root/users/Profpatsch/read-http.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-09-25 r/4966 feat(users/Profpatsch/netencode.rs): parse multiple stdin valuesProfpatsch1-1/+1
Adds support for parsing multiple netencode values from stdin. This is overly complicated for my tastes, but I don’t see a better way of writing this logic that does not read all of stdin before starting to parse the first value. A kingdom for a conduit. Change-Id: Ia4f849d4096c43e887756b756d2a85d7f9cd380a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6631 Autosubmit: Profpatsch <mail@profpatsch.de> Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
2022-02-08 r/3791 style(rust): Format all Rust code with rustfmtVincent Ambo1-57/+95
Change-Id: Iab7e00cc26a4f9727d3ab98691ef379921a33052 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5240 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: grfn <grfn@gws.fyi> Reviewed-by: tazjin <tazjin@tvl.su>
2021-02-13 r/2206 feat(users/Profpatsch/execline/exec_helpers): add no_args()Profpatsch1-0/+2
Some programs don’t need any arguments, so fail if they do get them, because that’s usually a bug. Change-Id: I28639056d3d9cea0cc0e7fcbfa42120c4f129c8c Reviewed-on: https://cl.tvl.fyi/c/depot/+/2503 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-09 r/2195 feat(users/Profpatsch/read-http): use netencode::dec for arglibProfpatsch1-14/+13
Interestingly, the code is not any shorter, but a lot more declarative, and all parsing footwork and error message generation is done by the `Decoder` trait. \o/ Change-Id: Idb1064a3b5198e38e06e1860d4d71054ae53bbb9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2499 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-09 r/2192 feat(users/Profpatsch/arglib): use exec_helpers for rustProfpatsch1-3/+3
Change-Id: I3056385eb11e45ae13456f4c47052651ba5fb62f Reviewed-on: https://cl.tvl.fyi/c/depot/+/2496 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-06 r/2187 feat(users/Profpatsch/netencode): `encode()` impl for T and UProfpatsch1-1/+1
Also change the toplevel `encode()` to take a `&U` instead of an owned `U`. Change-Id: I8e51540cc531e70ae1c94e3676f4dd88da7a924d Reviewed-on: https://cl.tvl.fyi/c/depot/+/2491 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-06 r/2186 feat(users/Profpatsch/{netencode,http-parse}): use HashMapProfpatsch1-21/+39
`U::Record` is required to be a hash map (later keys should be ignored), so why not do the hash map immediately. This surfaced a problem with read-http, because duplicate headers in http are possible, but before they’d be silently ignored. Now we merge them into a `U::List` in case, to be handled by consumers of read-http. Change-Id: Ifd594916f76e5acf9d08e705e0dec2c10a0081c9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2490 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-06 r/2183 fix(users/Profpatsch/netencode): decode U::Text directly into strProfpatsch1-4/+4
Since `Text` is a scalar, it doesn’t make sense to delay the utf-8 verification to the consumer. Change-Id: I36e4d228fbf35374d7c1addb4b24828cf6e927e5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2478 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 r/2176 feat(users/Profpatsch): add die_* helpers for semantic exit errorsProfpatsch1-0/+192
There is this semantic exit code schema championed by execline and skaware tooling, and we refined and documented it a bit in lorri https://github.com/nix-community/lorri/blob/d1d673d42090f0cfe8ab9b92b465315a9e7d30a3/src/ops/mod.rs#L24-L35 in the past. This just transcribes the error messages into simple helper functions. Applies the functions to the places where we would panic or die `sys::exit()` instead. Change-Id: I15ca05cd6f99a25a3378518be94110eab416354e Reviewed-on: https://cl.tvl.fyi/c/depot/+/2475 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>