mirror of
https://github.com/facebook/sapling.git
synced 2024-10-16 11:52:02 +03:00
399fd6c573
Summary: This updates the lfs server and eden api server to use a newer version of Gotham, which comes along with an updated version of Bytes and Hyper. A few things had to change for this: - New bytes don't support concatenation, so we need to fold them ourselves, except... - ... new Hyper bodies don't tell you how big they are (either in requests or responses), so we need to inspect headers to find the size instead (I added this in `gotham_ext::body_ext::BodyExt`, although it arguably belongs more in a `hyper_ext` crate, but creating a new crate for just this seems overkill). - New Hyper requires its data stream to be `Sync` for reasons that have more to do with developer experience than runtime (https://github.com/hyperium/hyper/pull/1857). Unfortunately, our Filestore streams aren't `Sync`, because our `BoxFuture` contains a `dyn Future` that isn't explicitly `Sync` (which is how we pull things out of blobstores). Even if `BoxFuture` contained a `Sync` future, that still wouldn't be enough anyway, because `compat()` explicitly implements `!Sync` on the stream it returns. I'll ask upstream in Hyper if this can possibly change in the future, but for now we can work around it by wrapping the stream in a channel. I'll keep an eye out for performance here. - When I updated our "pre state data" tweaks on top of Gotham, I renamed those to "socket data", since that's a better name or what they are (hence the changes here). - I updated the lfs_protocol to stop depending on Hyper and instead depend on http, since that's all we need here. As you review this, please pay close attention to the updated implementation of `SignalStream`. Since this is a custom `Stream` in new futures, it requires a bit of `unsafe { ... }`. Note that, unfortunately, the diff includes both the Gotham update and the server updates, since they have to happen together. Reviewed By: kulshrax, dtolnay Differential Revision: D20342689 fbshipit-source-id: a490db96ca7c4da8ff761cb80c1e7e3c836bad87
20 lines
351 B
TOML
20 lines
351 B
TOML
[package]
|
|
name = "lfs_protocol"
|
|
edition = "2018"
|
|
version = "0.1.0"
|
|
authors = ['Facebook']
|
|
license = "GPLv2+"
|
|
include = ["src/**/*.rs"]
|
|
|
|
[dependencies]
|
|
anyhow = "1.0"
|
|
faster-hex = "0.4"
|
|
http = "0.2"
|
|
quickcheck = "0.9"
|
|
serde = { version = "1.0", features = ["derive", "rc"] }
|
|
|
|
[dev-dependencies]
|
|
assert_matches = "1.3"
|
|
maplit = "1.0"
|
|
serde_json = "1.0"
|