Commit d017157
authored
Fix TCP race condition, remove fixed delay in CC (#5167)
ClientContext::_wait_for_sent() could dereference a TCP's _pcb after
the connection was dropped by the OS, resulting in a crash.
Move the connection dropped check to catch this case, and replace
a fixed millisecond delay() with a yield and timeout value to minimize
wasted time when transmission completes.1 parent 83a8076 commit d017157
1 file changed
+17
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
312 | 311 | | |
313 | | - | |
314 | 312 | | |
315 | 313 | | |
316 | | - | |
| 314 | + | |
317 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
318 | 324 | | |
319 | 325 | | |
320 | 326 | | |
321 | 327 | | |
322 | 328 | | |
323 | 329 | | |
324 | 330 | | |
325 | | - | |
326 | 331 | | |
327 | | - | |
| 332 | + | |
| 333 | + | |
328 | 334 | | |
329 | 335 | | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
| 336 | + | |
335 | 337 | | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
340 | 341 | | |
341 | | - | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
| 344 | + | |
344 | 345 | | |
345 | 346 | | |
346 | 347 | | |
| |||
0 commit comments