Commit 9b558e4
committed
fix: eliminate sink removal race in send_to_tcp and send_to_tcp_sync
send_to_tcp previously removed the sink from tcp_punch before spawning
a task, creating a window where a back-to-back call saw no entry and
fell back to UDP (undeliverable for port-0 WebSocket peers). Replace
the spawn with an inline await so the re-insert is atomic relative to
the calling task and no concurrent caller can observe a missing entry.
Apply the same re-insert-after-send fix to send_to_tcp_sync, which was
also consuming the sink without putting it back.1 parent fb8cc1a commit 9b558e4
1 file changed
Lines changed: 11 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
989 | 989 | | |
990 | 990 | | |
991 | 991 | | |
992 | | - | |
993 | 992 | | |
994 | | - | |
| 993 | + | |
995 | 994 | | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
1003 | 1002 | | |
1004 | 1003 | | |
1005 | 1004 | | |
| |||
1033 | 1032 | | |
1034 | 1033 | | |
1035 | 1034 | | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
1036 | 1038 | | |
1037 | 1039 | | |
1038 | 1040 | | |
| |||
0 commit comments