fix tests

This commit is contained in:
Rob Ede 2022-06-27 03:09:49 +01:00
parent f1b3b532b7
commit 12785710e9
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
3 changed files with 9 additions and 6 deletions

View File

@ -195,7 +195,7 @@ impl TlsAcceptorConfig {
pub fn handshake_timeout(self, dur: std::time::Duration) -> Self {
Self {
handshake_timeout: Some(dur),
..self
// ..self
}
}
}

View File

@ -2,8 +2,7 @@
extern crate tls_openssl as openssl;
use std::time::Duration;
use std::{convert::Infallible, io};
use std::{convert::Infallible, io, time::Duration};
use actix_http::{
body::{BodyStream, BoxBody, SizedStream},
@ -92,7 +91,7 @@ async fn h2_1() -> io::Result<()> {
})
.openssl_with_config(
tls_config(),
TlsAcceptorConfig::new(Some(Duration::from_secs(5))),
TlsAcceptorConfig::default().handshake_timeout(Duration::from_secs(5)),
)
.map_err(|_| ())
})

View File

@ -8,13 +8,14 @@ use std::{
net::{SocketAddr, TcpStream as StdTcpStream},
sync::Arc,
task::Poll,
time::Duration,
};
use actix_http::{
body::{BodyStream, BoxBody, SizedStream},
error::PayloadError,
header::{self, HeaderName, HeaderValue},
Error, HttpService, Method, Request, Response, StatusCode, Version,
Error, HttpService, Method, Request, Response, StatusCode, TlsAcceptorConfig, Version,
};
use actix_http_test::test_server;
use actix_rt::pin;
@ -160,7 +161,10 @@ async fn h2_1() -> io::Result<()> {
assert_eq!(req.version(), Version::HTTP_2);
ok::<_, Error>(Response::ok())
})
.rustls(tls_config())
.rustls_with_config(
tls_config(),
TlsAcceptorConfig::default().handshake_timeout(Duration::from_secs(5)),
)
})
.await;