Commit b6e08b7
committed
fix(host): use ioctlsocket(FIONREAD) fallback for read-readiness on Windows
select() on Windows fails to report read-readiness on connected
sockets (both TCP and UDP), even when data is sitting in the receive
buffer. This causes blocking urllib calls without a timeout to hang
indefinitely — the guest's poll loop never sees POLLIN.
Add ioctlsocket(FIONREAD) as a fallback in both handle_net_poll and
hl_sleep_poll_sockets: if select() misses read-readiness, check
whether the socket has bytes pending in its receive buffer.
Signed-off-by: danbugs <danilochiarlone@gmail.com>1 parent 9960572 commit b6e08b7
1 file changed
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1706 | 1706 | | |
1707 | 1707 | | |
1708 | 1708 | | |
1709 | | - | |
| 1709 | + | |
| 1710 | + | |
1710 | 1711 | | |
1711 | 1712 | | |
1712 | 1713 | | |
| |||
1819 | 1820 | | |
1820 | 1821 | | |
1821 | 1822 | | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
1822 | 1834 | | |
1823 | 1835 | | |
1824 | 1836 | | |
| |||
1892 | 1904 | | |
1893 | 1905 | | |
1894 | 1906 | | |
1895 | | - | |
| 1907 | + | |
1896 | 1908 | | |
1897 | 1909 | | |
1898 | 1910 | | |
| |||
1937 | 1949 | | |
1938 | 1950 | | |
1939 | 1951 | | |
1940 | | - | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
1941 | 1965 | | |
1942 | 1966 | | |
1943 | 1967 | | |
| |||
0 commit comments