We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6f9cc3 commit a0869f9Copy full SHA for a0869f9
src/sys/socket/mod.rs
@@ -2190,7 +2190,7 @@ impl Backlog {
2190
2191
let val = val.into();
2192
2193
- if !(MIN..Self::MAXCONN.0).contains(&val) {
+ if !(MIN..=Self::MAXCONN.0).contains(&val) {
2194
return Err(Errno::EINVAL);
2195
}
2196
test/sys/test_socket.rs
@@ -1695,6 +1695,13 @@ pub fn test_named_unixdomain() {
1695
assert_eq!(&buf[..], b"hello");
1696
1697
1698
+#[test]
1699
+pub fn test_listen_maxbacklog() {
1700
+ use nix::sys::socket::Backlog;
1701
+
1702
+ assert!(Backlog::new(libc::SOMAXCONN).is_ok());
1703
+}
1704
1705
#[test]
1706
pub fn test_listen_wrongbacklog() {
1707
use nix::sys::socket::Backlog;
0 commit comments