Skip to content

Commit 40f1732

Browse files
authored
Merge pull request #10 from tmccombs/tls-native-send
Make it so that TlsListener is Send when using native-tls
2 parents 50a5682 + f7d0e53 commit 40f1732

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Upcoming release
4+
5+
### Changed
6+
7+
- The implementation of `AsyncTls` for `tokio_native_tls::TlsAcceptor` now requires the connection type to implement `Send`. This in turn allows `TlsListener` to be `Send` when using the `native-tls` feature. Technically, this is a breaking change. However, in practice it is unlikely to break existing code and makes using `TlsListener` much easier to use when `native-tls` is enabled.
8+
39
## 0.4.0 - 2022-02-22
410

511
NOTE: This release contains several breaking changes.

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ impl<C: AsyncRead + AsyncWrite + Unpin> AsyncTls<C> for tokio_rustls::TlsAccepto
191191
#[cfg(feature = "native-tls")]
192192
impl<C> AsyncTls<C> for tokio_native_tls::TlsAcceptor
193193
where
194-
C: AsyncRead + AsyncWrite + Unpin + 'static,
194+
C: AsyncRead + AsyncWrite + Unpin + Send + 'static,
195195
{
196196
type Stream = tokio_native_tls::TlsStream<C>;
197197
type Error = tokio_native_tls::native_tls::Error;
198-
type AcceptFuture = Pin<Box<dyn Future<Output = Result<Self::Stream, Self::Error>>>>;
198+
type AcceptFuture = Pin<Box<dyn Future<Output = Result<Self::Stream, Self::Error>> + Send>>;
199199

200200
fn accept(&self, conn: C) -> Self::AcceptFuture {
201201
let tls = self.clone();

0 commit comments

Comments
 (0)