mirror of https://github.com/rwf2/Rocket.git
52de9a1fa6
Tokio's `File::write_all()` method has an unexpected quirk: it doesn't actually write all the requested content to the file when the returned future resolves. Instead, the write is attempted and queued. This means that the `persist()` method can resolve without the data being persisted to the file system. Subsequent reads of the ostensibly written-to file can thus fail to contain the expected data. An call to `flush()` following `write_all()` would circumvent the issue. Alternatively, calling `fs::write()` actually writes to the file system before returning and requires fewer lines of code. This commit thus swaps the call to `write_all()` with `fs::write()`. |
||
---|---|---|
.. | ||
catcher | ||
config | ||
data | ||
fairing | ||
form | ||
fs | ||
local | ||
request | ||
response | ||
route | ||
router | ||
serde | ||
shield | ||
cookies.rs | ||
error.rs | ||
ext.rs | ||
lib.rs | ||
log.rs | ||
mtls.rs | ||
outcome.rs | ||
phase.rs | ||
rocket.rs | ||
sentinel.rs | ||
server.rs | ||
shutdown.rs | ||
state.rs | ||
trip_wire.rs |