(
&self,
inbound: TcpStream,
buffer: Vec<u8>,
h2: bool,
)
| 245 | } |
| 246 | |
| 247 | async fn tls_accept( |
| 248 | &self, |
| 249 | inbound: TcpStream, |
| 250 | buffer: Vec<u8>, |
| 251 | h2: bool, |
| 252 | ) -> Result<TlsStream<MergedStream>> { |
| 253 | let stream = MergedStream { |
| 254 | buffer, |
| 255 | buffer_cursor: 0, |
| 256 | inbound, |
| 257 | }; |
| 258 | let acceptor = if h2 { |
| 259 | &self.h2_acceptor |
| 260 | } else { |
| 261 | &self.acceptor |
| 262 | }; |
| 263 | let tls_stream = timeout( |
| 264 | self.config.proxy.timeouts.handshake, |
| 265 | acceptor.accept(stream), |
| 266 | ) |
| 267 | .await |
| 268 | .context("handshake timeout")? |
| 269 | .context("failed to accept tls connection")?; |
| 270 | Ok(tls_stream) |
| 271 | } |
| 272 | |
| 273 | pub(super) async fn proxy( |
| 274 | &self, |
no test coverage detected