()
| 264 | |
| 265 | #[tokio::test] |
| 266 | async fn rejects_v2_oversize_length() { |
| 267 | // v2 prefix with a length field exceeding V2_MAX_LENGTH. |
| 268 | let mut header = Vec::new(); |
| 269 | header.extend_from_slice(V2_PROTOCOL_PREFIX); |
| 270 | header.extend_from_slice(&[0x21, 0x11]); |
| 271 | // length = V2_MAX_LENGTH bytes -> total = MIN + that, blows the cap |
| 272 | header.extend_from_slice(&(V2_MAX_LENGTH as u16).to_be_bytes()); |
| 273 | let err = read_proxy_header(&header[..]).await.unwrap_err(); |
| 274 | assert!( |
| 275 | format!("{err:#}").contains("too long"), |
| 276 | "unexpected error: {err:#}" |
| 277 | ); |
| 278 | } |
| 279 | |
| 280 | #[test] |
| 281 | fn synthesizes_unspec_when_no_addrs() { |
nothing calls this directly
no test coverage detected