You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return errors on short writes.
Fun fact: we cannot use `write_all` for this as in TCP Fastboot mode, we
write _more_ than the passed buffer (the first 8 bytes we write is the
length of the actual message we are sending), and `write_all` will panic
as it thinkss we are trying a buffer overflow as we report back that we
wrote more than we sent.
See:
https://github.com/rust-lang/futures-rs/blob/master/futures-util/src/io/write_all.rs#L33
And
https://doc.rust-lang.org/src/core/slice/mod.rs.html#1886
Instead report back if there are short writes and error
Fixed: b/42177040
Bug: b/42177040
Change-Id: I048cd4d9087168263aec5a4f7576e44341ca67bd
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1036216
Reviewed-by: Andrew Davies <awdavies@google.com>
Fuchsia-Auto-Submit: Colin Nelson <colnnelson@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Reviewed-by: Casey Dahlin <sadmac@google.com>
0 commit comments