1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-11 01:39:33 +00:00
actix-web/actix-multipart/src
Aaron Hill b36fdc46db Remove several usages of 'unsafe' (#968)
* Replace UnsafeCell in DateServiceInner with Cell

The previous API was extremely dangerous - calling `get_ref()`
followed by `reset()` would trigger instant UB, without requiring
any `unsafe` blocks in the caller.

By making DateInner `Copy`, we can use a normal `Cell` instead
of an `UnsafeCell`. This makes it impossible to cause UB (or even panic)
with the API.

* Split unsafe block HttpServiceHandlerResponse

Also add explanation of the safety of the usage of `unsafe`

* Replace UnsafeCell with RefCell in PayloadRef

This ensures that a mistake in the usage of 'get_mut' will cause
a panic, not undefined behavior.
2019-07-18 04:45:17 +06:00
..
error.rs Handle cancellation of uploads #834 #736 2019-05-12 11:43:05 -07:00
extractor.rs make extractor config type explicit 2019-04-13 16:35:25 -07:00
lib.rs clippy warnings 2019-07-17 15:08:30 +06:00
server.rs Remove several usages of 'unsafe' (#968) 2019-07-18 04:45:17 +06:00