Skip to content

Commit

Permalink
clarify the max size of the CMSG buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
build-mesh.bot committed Nov 9, 2023
1 parent 3717e8d commit 054d252
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion quinn-udp/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ use crate::EcnCodepoint;

use super::{cmsg, log_sendmsg_error, RecvMeta, Transmit, UdpSockRef, IO_ERROR_LOG_INTERVAL};

const CMSG_LEN: usize = 128; // FIXME arbitrary value, same as unix ?, is it too small/much ?
// Enough to store max(IP_PKTINFO + IP_ECN, IPV6_PKTINFO + IPV6_ECN) bytes (header + data) and some extra margin
const CMSG_LEN: usize = 128;

// FIXME this could use [`std::sync::OnceLock`] once the MSRV is bumped to 1.70 and upper
static WSARECVMSG_PTR: OnceCell<WinSock::LPFN_WSARECVMSG> = OnceCell::new();
Expand Down

0 comments on commit 054d252

Please sign in to comment.