tpws: fix-seg wait before send. tune max delay.

This commit is contained in:
bol-van
2024-11-19 09:51:32 +03:00
parent fc2d511d78
commit a93b142dcd
5 changed files with 40 additions and 22 deletions

View File

@@ -484,10 +484,11 @@ bool socket_has_notsent(int sfd)
if (getsockopt(sfd, IPPROTO_TCP, TCP_INFO, (char *)&tcpi, &ts) < 0)
return false;
if (tcpi.tcpi_state != 1)
if (tcpi.tcpi_state != 1) // TCP_ESTABLISHED
return false;
size_t s = (char *)&tcpi.tcpi_notsent_bytes - (char *)&tcpi.tcpi_state;
if (ts < s)
// old structure version
return false;
return !!tcpi.tcpi_notsent_bytes;
}