-
Notifications
You must be signed in to change notification settings - Fork 675
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
Add support of TCP_CONGESTION for setsockopt #972
Conversation
I use this code to test the feature but I don't know how to integrate into the CI (I don't know if extern crate nix;
use nix::sys::socket::sockopt;
use nix::sys::socket::{getsockopt, setsockopt, socket, AddressFamily, SockFlag, SockType};
use std::ffi::CString;
fn main() {
let socket = socket(
AddressFamily::Inet,
SockType::Stream,
SockFlag::empty(),
None,
).unwrap();
let algo = CString::new("reno").expect("Cannot create CString");
setsockopt(socket, sockopt::TcpCongestion, &algo).expect("setsockopt");
assert_eq!(algo, CString::new("reno").unwrap());
assert_eq!(
getsockopt(socket, sockopt::TcpCongestion).unwrap(),
CString::new("reno").unwrap()
);
} |
I don't understand why the buildbot is failing because |
Looks like libc has only defined |
Done : rust-lang/libc#1151 |
a4c162a
to
4cac38d
Compare
rust-lang/libc#1151 was merged in libc. |
Ok, this PR is starting to look pretty good. I think there are only two issues left:
|
CI fails but actually the code is OK. I tried CI on a full emulated MIPS or PowerPC system and the test run well. I think that the CI fails because only the binary is run on a emulated processor but the kernel is still the same than the host. |
QEMU does emulate the full system. It's not just a binary translator. However, it's got a lot of bugs. What did you use for a "full emulated MIPS or PowerPC system"? |
22cb17d
to
7fa3cfb
Compare
Rebase done and I squashed some commits. |
Could you please squash all commits together? |
2 similar comments
Could you please squash all commits together? |
Could you please squash all commits together? |
Could you please squash all commits together? |
7fa3cfb
to
b75d31d
Compare
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the comment dupes; github seems to have a partial outage today.
bors r+
Thanks for the reviews and advices ! |
Implementation proposal for support of TCP_CONGESTION param for
setsockopt
andgetsockopt
with the CString type.