Commit 2631911
[fastboot]: fix clippy errors
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>1 parent 8d8047c commit 2631911
File tree
4 files changed
+31
-7
lines changed- src/developer
- fastboot/src
- ffx
- lib/fastboot/interface/src
- tests/target/src
4 files changed
+31
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
174 | | - | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| |||
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
183 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
187 | 191 | | |
188 | | - | |
189 | 192 | | |
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
193 | 196 | | |
194 | 197 | | |
195 | 198 | | |
196 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
197 | 203 | | |
198 | 204 | | |
199 | 205 | | |
200 | | - | |
201 | 206 | | |
202 | 207 | | |
203 | 208 | | |
| |||
206 | 211 | | |
207 | 212 | | |
208 | 213 | | |
209 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
210 | 218 | | |
211 | 219 | | |
212 | 220 | | |
| |||
263 | 271 | | |
264 | 272 | | |
265 | 273 | | |
266 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
267 | 281 | | |
268 | 282 | | |
269 | 283 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
281 | 287 | | |
282 | 288 | | |
283 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
282 | 283 | | |
283 | 284 | | |
284 | 285 | | |
| |||
0 commit comments