mirror of
https://github.com/mullvad/udp-over-tcp.git
synced 2024-10-23 07:05:30 +08:00
Make HEADER_LEN public
This commit is contained in:
parent
59913ab0f7
commit
c4c839bd11
@ -21,7 +21,7 @@ use tokio::time::timeout;
|
||||
/// read operation would ever return. We are going to use that extra space
|
||||
/// to store our 2 byte udp-over-tcp header.
|
||||
pub const MAX_DATAGRAM_SIZE: usize = u16::MAX as usize;
|
||||
const HEADER_LEN: usize = mem::size_of::<u16>();
|
||||
pub const HEADER_LEN: usize = mem::size_of::<u16>();
|
||||
|
||||
/// Forward traffic between the given UDP and TCP sockets in both directions.
|
||||
/// This async function runs until one of the sockets are closed or there is an error.
|
||||
|
@ -93,6 +93,9 @@ mod tcp_options;
|
||||
|
||||
pub use tcp_options::{ApplyTcpOptionsError, ApplyTcpOptionsErrorKind, TcpOptions};
|
||||
|
||||
/// Size of the header (in bytes) that is prepended to each datagram in the TCP stream.
|
||||
pub use forward_traffic::HEADER_LEN;
|
||||
|
||||
/// Helper trait for `Result<Infallible, E>` types. Allows getting the `E` value
|
||||
/// in a way that is guaranteed to not panic.
|
||||
pub trait NeverOkResult<E> {
|
||||
|
Loading…
Reference in New Issue
Block a user