1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-07-03 20:45:46 +00:00
actix-web/actix-http/src
Aaron Hill fe13789345
Use Pin<Box<S>> in BodyStream and SizedStream (#1328)
Fixes #1321

A better fix would be to change `MessageBody` to take a `Pin<&mut
Self>`, rather than a `Pin<&mut Self>`. This will avoid requiring the
use of `Box` for all consumers by allowing the caller to determine how
to pin the `MessageBody` implementation (e.g. via stack pinning).

However, doing so is a breaking change that will affect every user of
`MessageBody`. By pinning the inner stream ourselves, we can fix the
undefined behavior without breaking the API.

I've included @sebzim4500's reproduction case as a new test case.
However, due to the nature of undefined behavior, this could pass (and
not segfault) even if underlying issue were to regress.

Unfortunately, until rust-lang/unsafe-code-guidelines#148 is resolved,
it's not even possible to write a Miri test that will pass when the bug
is fixed.

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-01-31 09:39:34 +09:00
..
client Remove several uses of Pin::new_unchecked (#1294) 2020-01-28 12:35:51 +09:00
cookie Upgrade time to 0.2.5 (#1254) 2020-01-28 20:44:22 +09:00
encoding Replace brotli with brotli2 #1224 2019-12-20 13:50:07 +06:00
h1 add extra constraints 2020-01-10 11:36:59 +06:00
h2 Remove several uses of Pin::new_unchecked (#1294) 2020-01-28 12:35:51 +09:00
header Upgrade time to 0.2.5 (#1254) 2020-01-28 20:44:22 +09:00
ws Replace sha1 dependency with sha-1 (#1258) 2020-01-11 02:34:31 +09:00
body.rs Use Pin<Box<S>> in BodyStream and SizedStream (#1328) 2020-01-31 09:39:34 +09:00
builder.rs update to latest actix-net 2019-12-02 17:33:11 +06:00
cloneable.rs Add benchmark for full stack request lifecycle (#1298) 2020-01-25 08:05:25 +09:00
config.rs Replace UnsafeCell with Cell in DateServiceInner (#1325) 2020-01-29 21:05:08 +09:00
error.rs Enforce safety of downcast_ref at compile time. (#1326) 2020-01-30 23:43:35 +09:00
extensions.rs clippy warnings 2019-12-08 00:46:51 +06:00
helpers.rs upgrade to tokio 0.2 2019-12-05 23:35:43 +06:00
httpcodes.rs Removed httpcode 'MovedPermanenty'. (#1128) 2019-10-12 06:45:12 +06:00
httpmessage.rs clippy warnings 2019-12-08 00:46:51 +06:00
lib.rs Upgrade time to 0.2.5 (#1254) 2020-01-28 20:44:22 +09:00
message.rs clippy warnings 2019-12-08 00:46:51 +06:00
payload.rs cleanup imports 2019-12-13 11:24:57 +06:00
request.rs clippy warnings 2019-12-08 00:46:51 +06:00
response.rs cleanup imports 2019-12-13 11:24:57 +06:00
service.rs add extra constraints 2020-01-10 11:36:59 +06:00
test.rs update tests and clippy warnings 2019-12-08 12:31:16 +06:00
time_parser.rs Upgrade time to 0.2.5 (#1254) 2020-01-28 20:44:22 +09:00