Fix rustls client/server filters (#401)

This commit is contained in:
Nikolay Kim 2024-08-26 16:00:48 +05:00 committed by GitHub
parent 9b24698087
commit c71678c999
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 25 deletions

View file

@ -1,5 +1,9 @@
# Changes
## [2.0.1] - 2024-08-26
* Fix rustls client/server filters
## [2.0.0] - 2024-05-28
* Use async fn for Service::ready() and Service::shutdown()

View file

@ -1,6 +1,6 @@
[package]
name = "ntex-tls"
version = "2.0.0"
version = "2.0.1"
authors = ["ntex contributors <team@ntex.rs>"]
description = "An implementation of SSL streams for ntex backed by OpenSSL"
keywords = ["network", "framework", "async", "futures"]
@ -26,10 +26,10 @@ rustls = ["tls_rust"]
[dependencies]
ntex-bytes = "0.1"
ntex-io = "2.0"
ntex-util = "2.0"
ntex-service = "3.0"
ntex-net = "2.0"
ntex-io = "2"
ntex-util = "2"
ntex-service = "3"
ntex-net = "2"
log = "0.4"

View file

@ -104,17 +104,16 @@ impl FilterLayer for TlsClientFilter {
'outer: loop {
if !src.is_empty() {
src.split_to(session.writer().write(src)?);
} else {
break;
}
while session.wants_write() {
match session.write_tls(&mut io) {
Ok(0) => continue 'outer,
Ok(_) => continue,
Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => {
break
loop {
match session.write_tls(&mut io) {
Ok(0) => continue 'outer,
Ok(_) => continue,
Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => {
break
}
Err(err) => return Err(err),
}
Err(err) => return Err(err),
}
}
break;

View file

@ -112,17 +112,16 @@ impl FilterLayer for TlsServerFilter {
'outer: loop {
if !src.is_empty() {
src.split_to(session.writer().write(src)?);
} else {
break;
}
while session.wants_write() {
match session.write_tls(&mut io) {
Ok(0) => continue 'outer,
Ok(_) => continue,
Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => {
break
loop {
match session.write_tls(&mut io) {
Ok(0) => continue 'outer,
Ok(_) => continue,
Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => {
break
}
Err(err) => return Err(err),
}
Err(err) => return Err(err),
}
}
break;