-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix TCP keepalive handling on Haiku and OpenBSD
On Haiku and OpenBSD don't call `setsockopt(fd, IPPROTO_TCP, SO_KEEPALIVE, secs)`, it is incorrect because `SO_KEEPALIVE` belongs to `SOL_SOCKET` layer, because it accepts a boolean instead of the number of seconds, and because there is no way to set keepalive idle time per socket on these operating systems. On Haiku and OpenBSD it is only possible to enable and disable keepalives, and it is already done with `setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, 1)` in a portable way in `Socket.set_keepalive()` defined in `src/socket.rs`.
- Loading branch information
1 parent
1c67209
commit b0732a3
Showing
2 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters