Skip to content

Commit c8b80f2

Browse files
committed
Make HEADER_LEN public
1 parent f3708b0 commit c8b80f2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/forward_traffic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use tokio::time::timeout;
2121
/// read operation would ever return. We are going to use that extra space
2222
/// to store our 2 byte udp-over-tcp header.
2323
pub const MAX_DATAGRAM_SIZE: usize = u16::MAX as usize;
24-
const HEADER_LEN: usize = mem::size_of::<u16>();
24+
pub const HEADER_LEN: usize = mem::size_of::<u16>();
2525

2626
/// Forward traffic between the given UDP and TCP sockets in both directions.
2727
/// This async function runs until one of the sockets are closed or there is an error.

src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ mod tcp_options;
9393

9494
pub use tcp_options::{ApplyTcpOptionsError, ApplyTcpOptionsErrorKind, TcpOptions};
9595

96+
/// Size of the header (in bytes) that is prepended to each datagram in the TCP stream.
97+
pub use forward_traffic::HEADER_LEN;
98+
9699
/// Helper trait for `Result<Infallible, E>` types. Allows getting the `E` value
97100
/// in a way that is guaranteed to not panic.
98101
pub trait NeverOkResult<E> {

0 commit comments

Comments
 (0)