Commit 364d054
committed
Fix a bad race condition that causes intermittent socket receive
failures.
The issue is caused by the code checking socket status *after* checking
if bytes are available. Bytes may have become available between the
last byte available check and the socket status check. This causes us to
incorrectly ignore the newly available bytes and return 0 to the caller,
which in any blocking/timeout scenario tells the caller no more bytes
will ever be available.
This was introduced in commit 89b9f10
See also
adafruit#151
as a fix for
adafruit#1351 parent 9000b5a commit 364d054
1 file changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
604 | | - | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
605 | 612 | | |
606 | 613 | | |
607 | 614 | | |
| |||
620 | 627 | | |
621 | 628 | | |
622 | 629 | | |
623 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
624 | 633 | | |
625 | 634 | | |
626 | 635 | | |
| |||
0 commit comments