Remove assertion on output length for getsockopt
.
POSIX allows `getsockopt` to set `*option_len` to a smaller value if necessary. Windows will set `*option_len` to 1 for boolean options even when the caller passes a `BOOL` (`int`) with `*option_len` as 4.
This commit is contained in:
parent
3eb983ed99
commit
f2ebd0a11f
@ -87,7 +87,6 @@ pub fn getsockopt<T: Copy>(sock: &Socket, level: c_int, option_name: c_int) -> i
|
||||
&mut option_value as *mut T as *mut _,
|
||||
&mut option_len,
|
||||
))?;
|
||||
assert_eq!(option_len as usize, mem::size_of::<T>());
|
||||
Ok(option_value)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user