scuffle_http/backend/hyper/utils.rs
1/// Returns true if the error is a fatal TCP error.
2///
3/// Not all errors are fatal, some can be ignored.
4pub(crate) fn is_fatal_tcp_error(err: &std::io::Error) -> bool {
5 matches!(
6 err.raw_os_error(),
7 Some(libc::EFAULT)
8 | Some(libc::EINVAL)
9 | Some(libc::ENFILE)
10 | Some(libc::EMFILE)
11 | Some(libc::ENOBUFS)
12 | Some(libc::ENOMEM)
13 )
14}