Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP_FASTOPEN option for Socket #336

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ task:
- cargo build
- cargo build --no-default-features
enable_tcp_fastopen:
- sysctl net.inet.tcp.fastopen.client_enabled=1
- sysctl net.inet.tcp.fastopen.server_enabled=1
- sudo sysctl net.inet.tcp.fastopen.client_enable=1
zonyitoo marked this conversation as resolved.
Show resolved Hide resolved
- sudo sysctl net.inet.tcp.fastopen.server_enable=1
amd64_test_script:
- . $HOME/.cargo/env
- cargo test --all-features
Expand Down
10 changes: 7 additions & 3 deletions tests/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1302,8 +1302,12 @@ fn tcp_fastopen() {
socket.set_tcp_fastopen(5).unwrap();

#[cfg(any(target_os = "linux", target_os = "android"))]
let expected = 5;
{
assert_eq!(socket.tcp_fastopen().unwrap(), 5);
}

#[cfg(not(any(target_os = "linux", target_os = "android")))]
let expected = 1;
assert_eq!(socket.tcp_fastopen().unwrap(), expected);
{
assert_ne!(socket.tcp_fastopen().unwrap(), 0);
}
}